当前位置: 首页>>代码示例>>PHP>>正文


PHP Url::redirect方法代码示例

本文整理汇总了PHP中Url::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::redirect方法的具体用法?PHP Url::redirect怎么用?PHP Url::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Url的用法示例。


在下文中一共展示了Url::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Signin

 function Signin($row)
 {
     Module::Module($row);
     switch (Url::get('cmd')) {
         case 'check_account':
             $this->check_account();
             exit;
         case 'check_email':
             $this->check_email();
             exit;
         case 'check_security_code':
             $this->check_security_code();
             exit;
         case 'check_email_format':
             $this->check_email_format();
             exit;
         default:
             if (!User::is_login()) {
                 require_once 'forms/signin.php';
                 $this->add_form(new SigninForm());
             } else {
                 $href = base64_decode(Url::get('href'));
                 if ($href) {
                     $href = str_replace('SID=' . $_COOKIE['PHPSESSID'], '', $href);
                     Url::redirect_url($href);
                 } else {
                     Url::redirect();
                 }
             }
             break;
     }
 }
开发者ID:hqd276,项目名称:bigs,代码行数:32,代码来源:class.php

示例2: AdminNews

 function AdminNews($row)
 {
     Module::Module($row);
     if (User::is_admin()) {
         $cmd = Url::get('cmd');
         switch ($cmd) {
             case "edit":
             case "add_item":
                 require_once 'forms/detail.php';
                 $this->add_form(new AdminNewsDetail());
                 break;
             case "delete":
                 $url = urldecode(Url::get('url'));
                 $id = Url::get('id');
                 if (!is_numeric($id)) {
                     Url::redirect('admin_news_item');
                     return;
                 }
                 DB::delete_id('news_item', $id);
                 eb_memcache::do_remove('news_item:' . $id);
                 Url::redirect_url($url);
                 break;
             default:
                 require_once 'forms/list.php';
                 $this->add_form(new AdminNewsForm());
                 break;
         }
     } else {
         Url::access_denied();
     }
 }
开发者ID:hqd276,项目名称:bigs,代码行数:31,代码来源:class.php

示例3: leave

 public function leave()
 {
     if ($this->_user->isPlaying()) {
         $this->_user->exitBattlefield();
     }
     Url::redirect(Url::generate('Play'));
 }
开发者ID:JLacoude,项目名称:Atrexus,代码行数:7,代码来源:Battlefields.php

示例4: RegisterSuccess

 function RegisterSuccess($row)
 {
     Module::Module($row);
     switch (Url::get('cmd')) {
         case 'notify':
             //Thông báo kích hoạt tài khoản (nếu bật chế độ cần kích hoạt - USER_ACTIVE_ON = true )
             if (!User::is_login() && USER_ACTIVE_ON) {
                 require_once 'forms/notify.php';
                 $this->add_form(new NotifyForm());
             } else {
                 Url::redirect_current();
             }
             break;
         case 'active':
             //Kích hoạt tài khoản
             if (!User::is_login() && USER_ACTIVE_ON) {
                 require_once 'forms/active.php';
                 $this->add_form(new ActiveForm());
             } else {
                 Url::redirect('profile', array('user_id' => User::id(), 'user_name' => User::user_name()));
             }
             break;
         case 'activated':
         default:
             require_once 'forms/register_success.php';
             $this->add_form(new RegisterSuccessForm());
             break;
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:29,代码来源:class.php

示例5: IntroBannerForm

 function IntroBannerForm()
 {
     Form::Form('IntroBannerForm');
     //ngannv tùy biến dung  JW Image Rotator
     $this->link_js(FOLDER_JS . 'imagerotator/swfobject.js');
     $cmd = Url::get("cmd");
     $id = Url::get("id", 0);
     if ($cmd == 'del_hb' && $id) {
         if (file_exists(DATA_PATH . "home_banner/{$id}.swf")) {
             @unlink(DATA_PATH . "home_banner/{$id}.swf");
         }
         if (file_exists(DATA_PATH . "home_banner/{$id}.gif")) {
             @unlink(DATA_PATH . "home_banner/{$id}.gif");
         }
         if (file_exists(DATA_PATH . "home_banner/{$id}.jpg")) {
             @unlink(DATA_PATH . "home_banner/{$id}.jpg");
         }
         if (file_exists(DATA_PATH . "home_banner/{$id}.jpeg")) {
             @unlink(DATA_PATH . "home_banner/{$id}.jpeg");
         }
         if (file_exists(DATA_PATH . "home_banner/{$id}.png")) {
             @unlink(DATA_PATH . "home_banner/{$id}.png");
         }
         Url::redirect();
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:26,代码来源:IntroBanner.php

示例6: create

 public function create()
 {
     Session::init();
     if (Session::get('username')) {
         if (Session::get('admin')) {
             Url::redirect('exec');
         }
     } else {
         Url::redirect('');
     }
     $data['title'] = 'Wishlist';
     $tripId = \helpers\Session::get("tripId");
     $data['applicants'] = $this->mab->get_wishlist($tripId);
     $data['roster'] = $this->mab->get_official_roster($tripId);
     foreach ($data['applicants'] as $applicants_info) {
         $applicants_info->age = $this->mab->get_age_at_time($applicants_info->dateOfBirth, date('Y-m-d', time()));
     }
     if (isset($_POST['draft'])) {
         $trip_id = $this->mab->verify_applicant($_POST['applicationId']);
         if ($trip_id == NULL) {
             $this->mab->add_to_trip($_POST['applicationId'], $tripId);
             $this->mab->applicant_becomes_person($_POST['applicationId']);
             $this->mab->person_becomes_trip_member($_POST['applicationId'], $tripId);
         } else {
             if ($trip_id == $tripId) {
                 echo 'This is your participant';
             } else {
                 echo 'Application has already been drafted.';
             }
         }
     }
     View::rendertemplate('header', $data);
     View::render('wishlist/wishlist', $data, $error);
     View::rendertemplate('footer', $data);
 }
开发者ID:rlh5z6,项目名称:MAB_draft_application,代码行数:35,代码来源:wishlist.php

示例7: AdminUsers

 function AdminUsers($row)
 {
     Module::Module($row);
     if (User::is_admin()) {
         $cmd = Url::get('cmd');
         switch ($cmd) {
             case "edit_user":
             case "add_user":
                 require_once 'forms/detail.php';
                 $this->add_form(new AdminUserDetail());
                 break;
             case "list_users":
                 require_once 'forms/list.php';
                 $this->add_form(new AdminListUsersForm());
                 break;
             case "delete_user":
                 $id = Url::get('id');
                 if (!is_numeric($id)) {
                     Url::redirect('admin_users');
                     return;
                 }
                 break;
         }
     } else {
         Url::access_denied();
     }
 }
开发者ID:hqd276,项目名称:bigs,代码行数:27,代码来源:class.php

示例8: edit

 public function edit($id)
 {
     $data['title'] = 'Edit User';
     $data['row'] = $this->_model->getuser($id);
     if (isset($_POST['submit'])) {
         $username = $_POST['username'];
         $password = $_POST['password'];
         $email = $_POST['email'];
         if ($username == '') {
             $error[] = 'Username is required';
         }
         if ($password == '') {
             $error[] = 'Password is required';
         }
         if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
             $error[] = 'Email is not valid';
         }
         if (!$error) {
             $postdata = array('username' => $username, 'password' => \helpers\password::make($password), 'email' => $email);
             $where = array('memberID' => $id);
             $this->_model->update_user($postdata, $where);
             Session::set('message', 'User Updated');
             Url::redirect('admin/users');
         }
     }
     View::renderadmintemplate('header', $data);
     View::render('admin/edituser', $data, $error);
     View::renderadmintemplate('footer', $data);
 }
开发者ID:fabioassuncao,项目名称:build-a-blog,代码行数:29,代码来源:users.php

示例9: SignIn

 function SignIn($row)
 {
     Module::Module($row);
     if (User::is_login()) {
         if ($data = Session::get('user_data') and $data['home_page']) {
             Url::redirect_url($data['home_page']);
         } else {
             Url::redirect('home');
         }
     } else {
         // xoa toan bo du lieu dang co truoc khi dang nhap
         if (Session::is_set('user_id')) {
             $id = Session::get('user_id');
             DB::update('account', array('last_online_time' => time()), 'id=\'' . $id . '\'');
             setcookie('user_id', "", time() - 3600);
             Session::destroy('user_id');
         }
         //if(URL::get("m")== "mobile"){
         //	require_once 'forms/mlogin.php';
         //	$this->add_form(new SignInmForm);
         //}else{
         require_once 'forms/sign_in.php';
         $this->add_form(new SignInForm());
         //}
     }
 }
开发者ID:nguyenxuantung,项目名称:Website_Quan_Ly_Nha_Hang,代码行数:26,代码来源:class.php

示例10: AdminNewsCategory

 function AdminNewsCategory($row)
 {
     Module::Module($row);
     if (User::is_admin()) {
         $cmd = Url::get('cmd');
         switch ($cmd) {
             case "edit":
             case "add_category":
                 require_once 'forms/detail.php';
                 $this->add_form(new AdminNewsCategoryDetail());
                 break;
             case "delete":
                 $id = Url::get('id');
                 if (!is_numeric($id)) {
                     Url::redirect('admin_news_category');
                     return;
                 }
                 DB::delete_id('news_category', $id);
                 eb_memcache::do_remove('news_category/all');
                 eb_memcache::do_remove('news_category:' . $id);
                 Url::redirect('admin_news_category');
                 break;
             default:
                 require_once 'forms/list.php';
                 $this->add_form(new AdminNewsCategoryForm());
                 break;
         }
     } else {
         Url::access_denied();
     }
 }
开发者ID:hqd276,项目名称:bigs,代码行数:31,代码来源:class.php

示例11: ForgotPassword

 function ForgotPassword($row)
 {
     Module::Module($row);
     $user_id = (int) Url::get('id');
     if ($user_id) {
         $user = DB::fetch("SELECT user_name,email FROM user WHERE id={$user_id}");
         if ($user && md5($user['user_name'] . $user['email']) == Url::get('u')) {
             $new_password = $this->random_string();
             $user_name = $user['user_name'];
             $subject = 'Khôi phục mật khẩu thành công!';
             $messenger = file_get_contents('templates/ForgotPassword/reset_password.html');
             $message = str_replace('[[|user_name|]]', $user_name, $messenger);
             $message = str_replace('[[|password|]]', $new_password, $message);
             if (System::sendEBEmail($user['email'], $subject, $message)) {
                 DB::update('user', array('password' => User::encode_password($new_password)), "id={$user_id}");
                 Url::redirect_current(array('action' => 'reset_success'));
             } else {
                 Url::redirect_current(array('action' => 'reset_error'));
             }
         } else {
             Url::redirect('home');
         }
     }
     require_once 'forms/forgot_password.php';
     $this->add_form(new ForgotPasswordForm());
 }
开发者ID:duynhan07,项目名称:elink,代码行数:26,代码来源:class.php

示例12: create

 public function create()
 {
     Session::init();
     if (Session::get('username')) {
         if (!Session::get('admin')) {
             Url::redirect('welcome');
         }
     } else {
         Url::redirect('');
     }
     $data['title'] = 'Application Analytics';
     $data['gender'] = $this->mab->get_gender();
     $data['yearsInSchool'] = $this->mab->get_years_in_school();
     $data['apps'] = $this->mab->get_apps_by_issue();
     $data['apps1'] = $this->mab->get_apps_by_issue_rank(1);
     $data['apps2'] = $this->mab->get_apps_by_issue_rank(2);
     $data['apps3'] = $this->mab->get_apps_by_issue_rank(3);
     $data['apps_by_college'] = $this->mab->get_apps_by_college();
     $data['marketing_data'] = $this->mab->get_marketing_data();
     $data['issues'] = $this->apply_model->getAllIssues();
     if (isset($_POST['submit'])) {
         $issueId = $_POST['issues'];
         $data['issues_by_gender'] = $this->mab->get_issues_by_gender($issueId);
     }
     View::rendertemplate('exec_header', $data);
     View::render('analytics/application_analytics', $data, $error);
     View::rendertemplate('footer', $data);
 }
开发者ID:rlh5z6,项目名称:MAB_draft_application,代码行数:28,代码来源:application_analytics.php

示例13: draw

 function draw()
 {
     global $display;
     if (User::id() != 0) {
         if (User::$current->data["avatar_url"] != "") {
             $avatar = '<img src="' . AZLib::getImageThumb(User::$current->data["avatar_url"], 100, 100, 0, User::$current->data["img_server"]) . '" />';
         } else {
             $avatar = '<img src="style/images/no_avatar_item.gif" width="94" height="94"/>';
         }
         $display->add('avatar', $avatar);
         $display->add('user_name', User::$current->data["user_name"]);
         $display->add('get_cmd', Url::get('cmd'));
         $display->add('get_action', Url::get('action'));
         $display->add('get_page', Url::get('page'));
         $display->add('get_page', AZNet::$page['name']);
         $display->add('get_cmd', Url::get('cmd'));
         $display->add('user_name', User::user_name());
         $display->add('can_edit_blast', User::is_admin() || !User::is_block());
         $blast = User::$current->data['blast'];
         $avatar_link = '';
         $avatar_url = 'style/images/no_avatar_item.gif';
         if (User::$current->data['avatar_url'] != '') {
             $avatar_link = "http://" . CGlobal::$img_server[User::$current->data['img_server']] . User::$current->data['avatar_url'];
             $avatar_url = AZLib::getImageThumb(User::$current->data['avatar_url'], 80, 80, 0, User::$current->data['img_server']);
         }
         if ($blast == '') {
             $blast = '...';
         } else {
             $blast = ' ' . $blast;
             if (strpos($blast, 'http://')) {
                 $user_blast = $blast;
                 while (strpos($user_blast, 'http://')) {
                     $tmp = substr($user_blast, strpos($user_blast, 'http://'));
                     if (strpos($tmp, ' ') || strpos($tmp, '<')) {
                         if (strpos($tmp, ' ') && strpos($tmp, '<') && strpos($tmp, ' ') > strpos($tmp, '<')) {
                             $blast_url = substr($tmp, 0, strpos($tmp, '<'));
                         } else {
                             $blast_url = substr($tmp, 0, strpos($tmp, ' '));
                         }
                     } else {
                         $blast_url = $tmp;
                     }
                     $user_blast = str_replace($blast_url, '', $user_blast);
                 }
                 $new_blast_url = ' <a rel="nofollow" href="' . $blast_url . '" target="_blank">Click here</a>';
                 $blast = substr($user_blast . $new_blast_url, 1);
             }
         }
         $display->add('avatar_link', $avatar_link);
         $display->add('avatar_url', $avatar_url);
         $display->add('blast', $blast);
         $display->add('user_id', User::id());
         $TopMenu = $display->output('TopMenu', true, 'Personal');
         $display->add('TopMenu', $TopMenu);
         $display->output('change_pass', false, 'Personal');
     } else {
         Url::redirect('home');
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:59,代码来源:ChangePassword.php

示例14: RegisterSuccessForm

 function RegisterSuccessForm()
 {
     Form::Form('RegisterSuccessForm');
     if (!User::is_login()) {
         Url::redirect('home');
     }
     $this->link_css('style/postItem.css');
 }
开发者ID:duynhan07,项目名称:elink,代码行数:8,代码来源:register_success.php

示例15: login

 protected function login()
 {
     if (Router::$IS_AJAX || Router::$IS_IFRAME) {
         $this->renderError('请先登录!');
     }
     $backUrl = Url::getCurrentUrl(array('back-url' => null));
     $url = Url::make('//uc.hqoj.net/login/', array('back-url' => $backUrl));
     Url::redirect($url);
 }
开发者ID:aozhongxu,项目名称:web_hqoj,代码行数:9,代码来源:BaseController.class.php


注:本文中的Url::redirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。