Method: MailserviceController#admin_user_delete
- Defined in:
- app/controllers/mailservice_controller.rb
#admin_user_delete(login, login_confirmation) ⇒ Object
Deletes a user.
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'app/controllers/mailservice_controller.rb', line 198 def admin_user_delete login, login_confirmation user_admin? if login_confirmation != login then raise "Login and login confirmation not the same" end if User.find(session[:user_id]).login == login then raise "Trying to delete yourself? Very funny" end u=User.find_by_login login if u then User.delete u.id return true else return false end end |