Esempio n. 1
0
 /**
  * ÃÜÂëΪ¿Õʱ£¬ÃÜÂë×Ö¶ÎʹÓÃÔ­À´µÄÃÜÂë
  */
 function beforeSave($insert)
 {
     parent::beforeSave($insert);
     if ($this->from_password) {
         $this->from_password = base64_encode(SecurityHelper::encrypt($this->from_password, \Yii::$app->params['SecurityHelper']));
     } else {
         $this->from_password = $this->old;
     }
     return true;
 }
Esempio n. 2
0
 public function validatePassword($password)
 {
     return SecurityHelper::validatePassword($password, $this->password);
 }