From: avl Date: Tue, 9 Sep 2008 11:48:26 +0000 (+0300) Subject: Change SelfPassword Form X-Git-Tag: 0.5~500 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=22fde95e079bb6e60bce849d2cff5903e7c2651d;p=ipf.git Change SelfPassword Form --- 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; + } +}