Gc\User\Model::setPassword PHP Method

setPassword() public method

Set user password
public setPassword ( string $userPassword, boolean $encrypt = true ) : void
$userPassword string User password
$encrypt boolean Encrypt or not the password
return void
    public function setPassword($userPassword, $encrypt = true)
    {
        $this->setData('password', $encrypt ? sha1(trim($userPassword)) : trim($userPassword));
    }

Usage Example

コード例 #1
0
ファイル: AclTest.php プロジェクト: gotcms/gotcms
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     $this->user = UserModel::fromArray(array('lastname' => 'User test', 'firstname' => 'User test', 'email' => '*****@*****.**', 'login' => 'test', 'user_acl_role_id' => 1));
     $this->user->setPassword('test');
     $this->user->save();
     $this->object = new Acl($this->user);
 }
All Usage Examples Of Gc\User\Model::setPassword