コード例 #1
0
ファイル: EmailConfirmTokens.php プロジェクト: freesaga/getit
 public static function findFirstByUsername($username)
 {
     return EmailConfirmTokens::findFirst(array("username = :username:"******"bind" => array('username' => $username)));
 }
コード例 #2
0
ファイル: SessionController.php プロジェクト: freesaga/getit
 public function completeRegAction($token)
 {
     //email verified, remove token for confirmation
     $ect = EmailConfirmTokens::findFirstByToken($token);
     if ($ect) {
         $username = $ect->username;
         $user = Users::findFirstByUsername($username);
         if ($user) {
             $user->emailConfirmed = 1;
             $user->save();
             $this->flashSession->success("Email Verificatiom Successful!");
             $ect->delete();
         } else {
             $this->flashSession->error("Email Verification Failed! Cannot find user. Try again.");
         }
     } else {
         $this->flashSession->error("Email Verification Failed! Invalid tokens. Try again.");
     }
     $this->response->redirect('index');
     $this->view->disable();
 }