Skip to content

Commit

Permalink
accounts can be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
will-r committed Nov 22, 2011
1 parent ac01900 commit fedcb2b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/accounts_controller.rb
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/models/reader.rb
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions app/views/admin/readers/_form.html.haml
Expand Up @@ -66,6 +66,9 @@
~ f.text_area "description", :size => "53x8", :class => "textarea"

- 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"
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion 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"
Expand Down

0 comments on commit fedcb2b

Please sign in to comment.