Preview: ChangepasswordForm.php
Size: 1.77 KB
/home/jambtst2015/public_html/protected/models/ChangepasswordForm.php
<?php
/**
* ContactForm class.
* ContactForm is the data structure for keeping
* contact form data. It is used by the 'contact' action of 'SiteController'.
*/
class ChangepasswordForm extends CFormModel
{
public $old_password;
public $new_password;
public $confirm_password;
/**
* Declares the validation rules.
*/
public function rules()
{
//echo Helpers::get_controler_name(5);
return array(
// name, email, subject and body are required
//array('pinfile', 'ext.validators.fileUploadErrorValidator'),
//array('pinfile', 'required'),
//array('pinfile', 'file', 'types'=>'csv', 'message'=>'Jpg files only', 'allowEmpty'=>false, 'on'=>'insert', 'on'=>'update'),
//array('pinfile', 'file', 'types'=>'jpg')
//array('pinfile', 'file', 'types'=>'jpg, gif, png'),
//array('pinfile', 'file', 'allowEmpty' => true, 'safe' => true, 'types' => 'jpg, jpeg, gif, png'),
array('old_password,new_password,confirm_password','required'),
array('new_password', 'length','min'=>6),
array('confirm_password', 'length','min'=>6),
array('confirm_password', 'compare', 'compareAttribute' => 'new_password'),
//, 'allowEmpty'=>true, 'wrongType'=>Yii::t('app','bad_file')
// email has to be a valid email address
//array('email', 'email'),
// verifyCode needs to be entered correctly
//array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),
);
}
/**
* Declares customized attribute labels.
* If not declared here, an attribute would have a label that is
* the same as its name with the first letter in upper case.
*/
public function attributeLabels()
{
return array(
//'verifyCode'=>'Verification Code',
//'pinfile'=>'Verification Code',
);
}
}
Directory Contents
Dirs: 0 × Files: 45