comparison app/models/.svn/text-base/auth_source.rb.svn-base @ 245:051f544170fe

* Update to SVN trunk revision 4993
author Chris Cannam
date Thu, 03 Mar 2011 11:42:28 +0000
parents 513646585e45
children
comparison
equal deleted inserted replaced
244:8972b600f4fb 245:051f544170fe
14 # You should have received a copy of the GNU General Public License 14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software 15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 class AuthSource < ActiveRecord::Base 18 class AuthSource < ActiveRecord::Base
19 include Redmine::Ciphering
20
19 has_many :users 21 has_many :users
20 22
21 validates_presence_of :name 23 validates_presence_of :name
22 validates_uniqueness_of :name 24 validates_uniqueness_of :name
23 validates_length_of :name, :maximum => 60 25 validates_length_of :name, :maximum => 60
28 def test_connection 30 def test_connection
29 end 31 end
30 32
31 def auth_method_name 33 def auth_method_name
32 "Abstract" 34 "Abstract"
35 end
36
37 def account_password
38 read_ciphered_attribute(:account_password)
39 end
40
41 def account_password=(arg)
42 write_ciphered_attribute(:account_password, arg)
33 end 43 end
34 44
35 def allow_password_changes? 45 def allow_password_changes?
36 self.class.allow_password_changes? 46 self.class.allow_password_changes?
37 end 47 end