Permalink
Browse files

accounts can be disabled

  • Loading branch information...
1 parent ac01900 commit fedcb2bf209125b2173f9f1c0631ab3ebfa9a492 @will-r will-r committed Nov 22, 2011
View
2 app/controllers/accounts_controller.rb
@@ -151,7 +151,7 @@ def check_registration_allowed
private
def get_readers_and_groups
- @readers = Reader.visible_to(current_reader)
+ @readers = Reader.enabled.visible_to(current_reader)
@groups = current_reader.groups
@reader = Reader.find(params[:id]) if params[:id]
end
View
2 app/models/reader.rb
@@ -47,6 +47,8 @@ class Reader < ActiveRecord::Base
named_scope :active, :conditions => "activated_at IS NOT NULL"
named_scope :inactive, :conditions => "activated_at IS NULL"
named_scope :imported, :conditions => "old_id IS NOT NULL"
+ named_scope :disabled, :conditions => "disabled = 1"
+ named_scope :enabled, :conditions => "disabled = 0"
named_scope :except, lambda { |readers|
readers = [readers].flatten.compact
View
3 app/views/admin/readers/_form.html.haml
@@ -67,6 +67,9 @@
- form.edit_notes do
%p
+ = f.check_box :disabled
+ = f.label :disabled
+ %p
= f.label :notes, t('reader_extension.notes'), :class => "optional"
~ f.text_area "notes", :size => "53x4", :class => "textarea"
View
1 config/locales/en.yml
@@ -13,6 +13,7 @@ en:
dob: "Date of birth"
dob_secret: "Keep secret"
description: "A but of text about yourself"
+ disabled: "Disable account (hides without deleting)"
email: "Email address"
forename: "Forename"
honorific: "Title or rank"
View
2 lib/radiant-reader-extension.rb
@@ -1,5 +1,5 @@
module RadiantReaderExtension
- VERSION = '3.0.36'
+ VERSION = '3.0.37'
SUMMARY = %q{Reader/viewer/visitor registration, login and access-control for Radiant CMS}
DESCRIPTION = %q{Provides reader/member/user registration and management functions including password-reminder, group-based page access control and administrative email.}
URL = "http://radiant.spanner.org/reader"

0 comments on commit fedcb2b

Please sign in to comment.