Esempio n. 1
0
 /**
  * Check if username is valid and insert it
  */
 public function ChangeIt()
 {
     try {
         VarTest::Length(1, 255, $this->nick);
         $sth = DB::prep("UPDATE messaging_users SET nick = :nick WHERE user_id = :userid");
         $sth->bindParam(":nick", $this->nick, PDO::PARAM_STR, 255);
         $sth->bindParam(":userid", $this->user_id, PDO::PARAM_INT);
         $sth->execute();
         $_SESSION['visitor_chat_nick'] = $this->nick;
         echo 1;
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
Esempio n. 2
0
 /**
  * Checks if admin username exists in database, if user exists and length of username is not between 3 and 255, exception is thrown and error array is filled.
  *
  * @return void
  * @author Gregor Kuplenik, gregor.kuplenik@insis.si
  */
 private function CheckGroupTitle()
 {
     try {
         VarTest::Length(3, 255, $this->title, "", 2);
     } catch (Exception $e) {
         $this->Fill($e->getCode());
     }
 }