mhm… i’m still having problems…
i added a field newpassword to the BoUsers class, then my _formpass.php looks like this:
<div class="row">
<?php echo $form->labelEx($model,'password'); ?>
<?php echo $form->passwordField(BoUsers::model(),'password',array('size'=>50,'maxlength'=>50)); ?>
<?php echo $form->error($model,'password'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'newpassword'); ?>
<?php echo $form->passwordField(BoUsers::model(),'newpassword',array('size'=>50,'maxlength'=>50)); ?>
<?php echo $form->error($model,'newpassword'); ?>
</div>
and my actionNewpassword is:
public function actionNewpassword()
{
$model=$this->loadModel();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['BoUsers']))
{
if($model->validatePassword(sha1($_POST['BoUsers']['password']))){
$model->attributes=$_POST['BoUsers'];
echo $_POST['BoUsers']['newpassword'];
$model->password = sha1($model->newpassword);
if($model->save())
$this->redirect(array('view','id'=>$model->idBOUsers));
}
else $model->addError('password','The password provided is incorrect!');
}
$this->render('newpassword',array(
'model'=>$model,
));
}
. i also added a rule in the model:
array('newpassword','required','on'=>'newpassword', 'message'=>'hey, guy... set a password!'),
expecting my newpassword field to be required in the form, but it’s not. Does anyone know why?
… nothing works at the moment 