コード例 #1
0
ファイル: Session.php プロジェクト: DamdamD/Website
 public function getFlash()
 {
     if ($this->hasFlash()) {
         $flash = $_SESSION['flash'];
         unset($_SESSION['flash']);
         return Secure::toClient($flash);
     }
     return '';
 }
コード例 #2
0
ファイル: Page.php プロジェクト: DamdamD/Website
 public function get($varName, $alt = '')
 {
     if (array_key_exists($varName, $this->views)) {
         return $this->views[$varName];
     } elseif (array_key_exists($varName, $this->vars)) {
         return Secure::toClient($this->vars[$varName]);
     } elseif (array_key_exists($varName, $GLOBALS)) {
         return Secure::toClient($GLOBALS[$varName]);
     }
     return $alt;
 }
コード例 #3
0
 public function executeTryLogUp(HTTPRequest $request)
 {
     //On récupère le manager de Users
     $manager = $this->getManagerOf($this->module(), 'Users');
     //Verify if this nickname already exists
     if ($manager->exists($request->postData('nickname'))) {
         echo 'nickname';
         exit;
     } else {
         if ($manager->exists($request->postData('mail'))) {
             echo 'mail';
             exit;
         } else {
             //Create a new user
             $newUser = new User(['nickname' => $request->postData('nickname'), 'pass' => Secure::passHash($request->postData('pass')), 'mail' => $request->postData('mail'), 'authLevel' => User::MEMBER]);
             //Save into dataBase
             $manager->save($newUser);
             if ($GLOBALS['userManager']->set($request->postData('nickname'), $request->postData('pass'))) {
                 echo 'ok';
                 exit;
             }
         }
     }
 }