Exemplo n.º 1
0
 /**
  * @param string $password
  * Will encrypt and set the password
  * and update  db when changing the password of
  * an existing admin
  */
 public function setPassword($password)
 {
     $this->password = Util::encryptPass($password);
     if ($this->id != 0) {
         phpList::DB()->query(sprintf('UPDATE %s
                 SET password = "******", passwordchanged = CURRENT_TIMESTAMP
                 WHERE id = %s', Config::getTableName('admin'), $this->password, $this->id));
     }
 }