From 22fde95e079bb6e60bce849d2cff5903e7c2651d Mon Sep 17 00:00:00 2001 From: avl Date: Tue, 9 Sep 2008 14:48:26 +0300 Subject: [PATCH] Change SelfPassword Form --- ipf/auth/forms/changeselfpassword.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ipf/auth/forms/changeselfpassword.php diff --git a/ipf/auth/forms/changeselfpassword.php b/ipf/auth/forms/changeselfpassword.php new file mode 100644 index 0000000..2a8e7f4 --- /dev/null +++ b/ipf/auth/forms/changeselfpassword.php @@ -0,0 +1,23 @@ +fields['oldpassword'] = new IPF_Form_Field_Varchar(array(label=>'Current Password', 'required'=>true, 'widget'=>'IPF_Form_Widget_PasswordInput')); + $this->fields['password1'] = new IPF_Form_Field_Varchar(array(label=>'New Password', 'required'=>true,'widget'=>'IPF_Form_Widget_PasswordInput')); + $this->fields['password2'] = new IPF_Form_Field_Varchar(array(label=>'New Password (repeat)','required'=>true,'widget'=>'IPF_Form_Widget_PasswordInput','help_text'=>'Enter the same password as above, for verification.')); + } + + function isValid(){ + $ok = parent::isValid(); + if ($ok===true){ + if ($this->cleaned_data['password1']!=$this->cleaned_data['password2']){ + $this->is_valid = false; + $this->errors['password2'][] = "The two password fields didn't match."; + return false; + } + } + return $ok; + } +} -- 2.49.0