Class: AdminController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AdminController
- Defined in:
- app/controllers/admin_controller.rb
Instance Method Summary collapse
-
#admin_get_confirmation_code(mailinglist_name, address) ⇒ Object
Returns the confirmation code for a particular combination of mailing list and address.
-
#admin_mailinglists_all ⇒ Object
Returns all mailing lists in this domain.
-
#admin_user_collection ⇒ Object
Returns all users in this domain, as a hash.
-
#admin_user_delete(login, login_confirmation) ⇒ Object
Deletes a user.
-
#admin_user_list ⇒ Object
Returns all users in this domain.
- #admin_user_new ⇒ Object
-
#admin_user_reset_password(login, password, password_confirmation) ⇒ Object
Resets a user’s password.
-
#admin_user_signup ⇒ Object
Creates a new user.
-
#is_admin ⇒ Object
Returns true if the user is an administrator and false otherwise.
-
#list_users ⇒ Object
domain_name.
Instance Method Details
#admin_get_confirmation_code(mailinglist_name, address) ⇒ Object
Returns the confirmation code for a particular combination of mailing list and address.
This one should probably resend the confirmation message.
63 64 65 |
# File 'app/controllers/admin_controller.rb', line 63 def admin_get_confirmation_code mailinglist_name, address render :controller => 'mailservice', :action => 'admin_get_confirmation_code', :params => 'mailinglist_name, address' end |
#admin_mailinglists_all ⇒ Object
Returns all mailing lists in this domain.
68 69 70 |
# File 'app/controllers/admin_controller.rb', line 68 def admin_mailinglists_all render :controller => 'mailservice', :action => 'admin_mailinglists_all' end |
#admin_user_collection ⇒ Object
Returns all users in this domain, as a hash
45 46 47 |
# File 'app/controllers/admin_controller.rb', line 45 def admin_user_collection render :controller => 'mailservice', :action => 'admin_user_collection' end |
#admin_user_delete(login, login_confirmation) ⇒ Object
Deletes a user.
55 56 57 |
# File 'app/controllers/admin_controller.rb', line 55 def admin_user_delete login, login_confirmation render :controller => 'mailservice', :action => 'admin_user_delete', :params => 'login, login_confirmation' end |
#admin_user_list ⇒ Object
Returns all users in this domain.
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/admin_controller.rb', line 23 def admin_user_list if session[:domain] all_users=User.find_all_by_domain_id session[:domain].id end if all_users @users = all_users end render :controller => 'mailservice', :action => 'admin_user_list' end |
#admin_user_new ⇒ Object
3 4 |
# File 'app/controllers/admin_controller.rb', line 3 def admin_user_new end |
#admin_user_reset_password(login, password, password_confirmation) ⇒ Object
Resets a user’s password.
50 51 52 |
# File 'app/controllers/admin_controller.rb', line 50 def admin_user_reset_password login, password, password_confirmation render :controller => 'mailservice', :action => 'admin_user_reset_password', :params => 'login, password, password_confirmation' end |
#admin_user_signup ⇒ Object
Creates a new user. NOTE: This method requires that you’re already signed in as an administrator.
13 14 15 16 17 18 19 20 |
# File 'app/controllers/admin_controller.rb', line 13 def admin_user_signup #if # redirect_to :controller => 'mailinglist', :action => 'list_users' #flash[:notice] = "IT WORKED" #else #end # render :controller => 'mailservice', :action => 'admin_user_signup', :params => 'login, password, password_confirmation' end |
#is_admin ⇒ Object
Returns true if the user is an administrator and false otherwise
7 8 9 |
# File 'app/controllers/admin_controller.rb', line 7 def is_admin user_admin? rescue false end |
#list_users ⇒ Object
domain_name
33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/admin_controller.rb', line 33 def list_users # domain_name #@users = session[:domain].users domain_name = session[:domain] domain = Domain.find_by_name domain_name if domain then @users = User.find_all_by_domain_id domain.id else # error "Domain \"#{domain_name}\" does not exist." end end |