Method: MailserviceController#user_change_real_name

Defined in:
app/controllers/mailservice_controller.rb

#user_change_real_name(password, new_name) ⇒ Object

Allows the user to change his real name.



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'app/controllers/mailservice_controller.rb', line 344

def user_change_real_name password, new_name
    user_logged_in?
    user=User.find(session[:user_id])

    if User.authenticate(user., password) then
        ml = user.mailinglist
        ml.description=new_name
        if ml.save
            return new_name
        else
            errstr = ml.errors.sort.map do |fac, err|
                "#{fac}: #{err}"
            end.join("\n")

            raise RuntimeError, errstr
        end
    else
        raise "auth: password incorrect"
    end
end