PHP User::getMdp Examples

PHP User::getMdp - 4 examples found. These are the top rated real world PHP examples of User::getMdp extracted from open source projects. You can rate examples to help us improve the quality of examples.
 public function testHashMdp()
 {
     $user = new User(array("Mdp" => "blop"));
     $mdpHashCmd = hash("sha256", $user->getMdp());
     $user->setHashMdp();
     $this->assertEquals($mdpHashCmd, $user->getMdp());
 }
 public function initTable()
 {
     $adminConf = getConfigFile();
     $query = $this->db->prepare("INSERT INTO user(UserName,Mdp,DateInscription,email,Tel) VALUES (:username , :mdp , NOW() , :email , :tel);\n                 INSERT INTO user_droit(id_Droits, id_User, Date) VALUES (1,1,NOW());");
     $admin = new User(array("UserName" => $adminConf['pseudo'], "Mdp" => "admin", "email" => $adminConf['mail'], "tel" => $adminConf['tel']));
     $admin->setHashMdp();
     $query->execute(array(":username" => $admin->getUserName(), ":mdp" => $admin->getMdp(), ":email" => $admin->getEmail(), ":tel" => $admin->getTel()));
 }
 function updateUserMdp(User $user)
 {
     $query = $this->db->prepare("UPDATE user SET Mdp = :mdp where id = :id");
     $user->setMdp(hash("sha256", $user->getMdp()));
     $query->execute(array(":id" => $user->getId(), ":mdp" => $user->getMdp()));
 }
 public function getMdp()
 {
     $this->__load();
     return parent::getMdp();
 }