當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Flight::redirect方法代碼示例

本文整理匯總了PHP中Flight::redirect方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flight::redirect方法的具體用法?PHP Flight::redirect怎麽用?PHP Flight::redirect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Flight的用法示例。


在下文中一共展示了Flight::redirect方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save_pass

 /**
  * Save chosen password
  */
 public function save_pass()
 {
     $pass = F::request()->data->password;
     $pass2 = F::request()->data->password2;
     if ($pass === $pass2) {
         if (!empty($pass)) {
             if (Action::savePassword($pass)) {
                 $_SESSION['flashbag'] = '
                 <div class="alert alert-success alert-dismissible">
                     <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                     Your password has successfully been set.
                 </div>';
                 $_SESSION['admin'] = 1;
                 F::redirect('/settings');
                 exit;
             } else {
                 $_SESSION['flashbag'] = '<div class="alert alert-danger">An error occured. Please verify that the app/ and src/ folder are writable.</div>';
             }
         } else {
             $_SESSION['flashbag'] = '<div class="alert alert-warning">No password ? Are you serious ? Put at least some letters.</div>';
         }
     } else {
         $_SESSION['flashbag'] = '<div class="alert alert-danger">You must enter the same password twice.</div>';
     }
     $this->index();
 }
開發者ID:ray0be,項目名稱:fastdoc,代碼行數:29,代碼來源:Install.php

示例2: checkLogin

 /**
  * Checks whether or not user is logged in. Redirects to login page if not.
  */
 private static function checkLogin()
 {
     // session stuff
     if (!isset($_SESSION['logged'])) {
         Flight::redirect('./login');
     }
 }
開發者ID:bubach,項目名稱:VisualQuery,代碼行數:10,代碼來源:dashboard.php

示例3: init

 public function init()
 {
     $data = $_REQUEST;
     if (isset($data[Profile::GET_CHANGE_PASSWORD_BUTTON])) {
         if (strlen($data[Profile::GET_CHANGE_PASSWORD]) > 0) {
             if (!User::passwordIsValid($data[Profile::GET_CHANGE_PASSWORD])) {
                 Flight::redirect($_SERVER['REDIRECT_URL'] . '?success=0');
             } else {
                 $user = Auth::getInstance()->getUser();
                 $user->password = User::getHashPassword(trim(strip_tags($data[Profile::GET_CHANGE_PASSWORD])), $user->login);
                 $user->save();
                 Flight::redirect($_SERVER['REDIRECT_URL'] . '?success=1');
                 return true;
             }
         }
         if (strlen($data[Profile::GET_CHANGE_PHONE]) > 0) {
             if (!User::validatePhone(trim($data[Profile::GET_CHANGE_PHONE]))) {
                 Flight::redirect($_SERVER['REDIRECT_URL'] . '?success=2');
             } else {
                 $user = Auth::getInstance()->getUser();
                 $user->number = trim($data[Profile::GET_CHANGE_PHONE]);
                 $user->save();
                 Flight::redirect($_SERVER['REDIRECT_URL'] . '?success=1');
                 return true;
             }
         }
     }
 }
開發者ID:smilexx,項目名稱:counter,代碼行數:28,代碼來源:Profile.php

示例4: deleteTeam

 public function deleteTeam($id)
 {
     Flight::auth()->check(20);
     $team = Flight::teams()->getTeamWithId($id);
     $team->delete();
     Flight::redirect('/teams');
 }
開發者ID:happyoniens,項目名稱:Club,代碼行數:7,代碼來源:teamController.php

示例5: __construct

 /**
  * Check if the user is authorized
  */
 public function __construct($install, $login = false)
 {
     if (!isset($_SESSION['admin']) && !$install && !$login) {
         F::redirect('/login');
     }
     parent::__construct($install);
 }
開發者ID:ray0be,項目名稱:fastdoc,代碼行數:10,代碼來源:AdminController.php

示例6: init

 public function init()
 {
     $data = $_REQUEST;
     if (isset($data[Profile::GET_CHANGE_PASSWORD_BUTTON])) {
         $user = Auth::getInstance()->getUser();
         if (strlen(trim($data[Profile::GET_CHANGE_MAIL])) > 0) {
             if ($user->email != trim($data[Profile::GET_CHANGE_MAIL])) {
                 if (User::validEmail(trim(strip_tags($data[Profile::GET_CHANGE_MAIL])))) {
                     $user->email = trim(strip_tags($data[Profile::GET_CHANGE_MAIL]));
                     $user->password = User::getHashPassword($user->password, strtolower($user->email));
                 } else {
                     Flight::redirect($_SERVER['REDIRECT_URL'] . '?success=2');
                 }
             }
         }
         if (strlen(trim($data[Profile::GET_CHANGE_PASSWORD])) > 0) {
             if (!User::passwordIsValid($data[Profile::GET_CHANGE_PASSWORD])) {
                 Flight::redirect($_SERVER['REDIRECT_URL'] . '?success=0');
             } else {
                 $user->password = User::getHashPassword(trim(strip_tags($data[Profile::GET_CHANGE_PASSWORD])), strtolower($user->email));
             }
         }
         $user->save();
         Flight::redirect($_SERVER['REDIRECT_URL'] . '?success=1');
         return true;
     }
 }
開發者ID:smilexx,項目名稱:quest.dev,代碼行數:27,代碼來源:Profile.php

示例7: _manage_platoon

 public static function _manage_platoon($div, $plt)
 {
     $division = Division::findByName(strtolower($div));
     $platoonId = Platoon::getIdFromNumber($plt, $division->id);
     if (!is_null($platoonId)) {
         $user = User::find(intval($_SESSION['userid']));
         $member = Member::find(intval($_SESSION['memberid']));
         if ($member->platoon_id == $platoonId || $user->role > 2 || User::isDev()) {
             $tools = Tool::find_all($user->role);
             $divisions = Division::find_all();
             $platoon = Platoon::findById($platoonId);
             $unassignedMembers = Platoon::unassignedMembers($platoonId, true);
             $squads = Squad::findByPlatoonId($platoonId);
             $memberCount = count((array) Platoon::members($platoonId));
             $js = 'manage';
             Flight::render('manage/platoon', compact('division', 'platoon', 'squads', 'unassignedMembers', 'memberCount'), 'content');
             Flight::render('layouts/application', compact('js', 'user', 'member', 'tools', 'divisions'));
         } else {
             // insufficient access
             Flight::redirect('404/', 404);
         }
     } else {
         // nonexistent platoon
         Flight::redirect('404/', 404);
     }
 }
開發者ID:Oogieboogie23,項目名稱:Division-Tracker,代碼行數:26,代碼來源:PlatoonController.php

示例8: _doAddPartTimeMember

 public static function _doAddPartTimeMember()
 {
     $member = Member::find(intval($_SESSION['memberid']));
     $member_params = array('member_id' => $_POST['member_id'], 'forum_name' => $_POST['name'], 'ingame_alias' => $_POST['ingame_alias'], 'game_id' => $member->game_id);
     PartTime::add($member_params);
     Flight::redirect('/manage/part-time');
 }
開發者ID:higginsd,項目名稱:Division-Tracker,代碼行數:7,代碼來源:DivisionController.php

示例9: deleteAbsence

 public function deleteAbsence($id)
 {
     Flight::auth()->check();
     $absence = Flight::absence()->getAbsenceWithId($id);
     $absence->delete();
     Flight::redirect(Flight::request()->referrer);
 }
開發者ID:happyoniens,項目名稱:Club,代碼行數:7,代碼來源:absenceController.php

示例10: deletePlayer

 public function deletePlayer($id)
 {
     Flight::auth()->check(20);
     $player = Flight::players()->getPlayerWithId($id);
     $team_id = $player->team;
     $player->delete();
     Flight::redirect('/team/' . $team_id);
 }
開發者ID:happyoniens,項目名稱:Club,代碼行數:8,代碼來源:playerController.php

示例11: createPost

 /**
  * Create a post
  */
 public static function createPost()
 {
     if (!Flight::has('currentUser')) {
         Flight::redirect('/');
     }
     $post = new post(['user' => Flight::get('currentUser')->id, 'title' => Flight::request()->data->title, 'content' => Flight::request()->data->content]);
     $post->store();
 }
開發者ID:happyoniens,項目名稱:Blog,代碼行數:11,代碼來源:postController.php

示例12: deleteEvent

 public function deleteEvent($id)
 {
     Flight::auth()->check();
     $event = Flight::events()->getEventWithId($id);
     $team_id = $event->team;
     $event->delete();
     Flight::redirect("/team/" . $team_id);
 }
開發者ID:happyoniens,項目名稱:Club,代碼行數:8,代碼來源:eventController.php

示例13: logout

 /**
  * Logout logged user
  */
 public function logout()
 {
     unset($_SESSION['db']);
     unset($_SESSION['logged']);
     unset($_SESSION);
     @session_destroy();
     session_regenerate_id();
     Flight::redirect('./login');
 }
開發者ID:bubach,項目名稱:VisualQuery,代碼行數:12,代碼來源:login.php

示例14: checkInstall

 /**
  * check if the install process have been done
  */
 private function checkInstall($install)
 {
     if (F::has('password')) {
         if (!$install && empty(F::get('password'))) {
             F::redirect('/install');
         } elseif ($install && !empty(F::get('password'))) {
             F::redirect('/login');
         }
     }
 }
開發者ID:ray0be,項目名稱:fastdoc,代碼行數:13,代碼來源:Controller.php

示例15: sendMessage

 public function sendMessage()
 {
     $data = $_REQUEST;
     if (isset($data[Help::GET_SEND])) {
         $message = wordwrap(trim(strip_tags($data[Help::GET_MESSAGE])), 70, "\r\n");
         $theme = trim(strip_tags($data[Help::GET_THEME]));
         if ($this->send_mime_mail(Auth::getInstance()->getUser()->login, Auth::getInstance()->getUser()->login . '@no-reply', 'admin', "admin@admin.com", 'UTF-8', 'windows-1251', $theme, $message)) {
             Flight::redirect('/help?success=1');
         }
     }
 }
開發者ID:smilexx,項目名稱:counter,代碼行數:11,代碼來源:Report.php


注:本文中的Flight::redirect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。