Exemple #1
0
 /**
  * Inserts a new row
  *
  * @param array Column-value pairs.
  * @return integer The last insert ID.
  */
 public function insert(array $data)
 {
     $user = $this->fetchRow(array("users_login = ?" => $data['users_login']));
     if ($user !== null) {
         throw new USVN_Exception(sprintf(T_("Login %s already exist."), $user->login));
     }
     if (!isset($data['users_is_admin'])) {
         $data['users_is_admin'] = false;
     }
     $data['users_secret_id'] = md5(time() . mt_rand());
     $res = parent::insert($data);
     $this->updateHtpasswd();
     return $res;
 }
Exemple #2
0
 /**
  * Overload insert's method to generate the authz file.
  *
  * @param array $data
  * @return integer the last insert ID.
  */
 public function insert(array $data)
 {
     $res = parent::insert($data);
     USVN_Authz::generate();
     return $res;
 }