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


PHP jsRedirect函数代码示例

本文整理汇总了PHP中jsRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP jsRedirect函数的具体用法?PHP jsRedirect怎么用?PHP jsRedirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: checkLogin

 public function checkLogin()
 {
     $adminID = Yaf_Session::getInstance()->__get('adminID');
     if (!$adminID) {
         jsRedirect('/admin/login');
     }
 }
开发者ID:xn1224,项目名称:YOF,代码行数:7,代码来源:Admin.php

示例2: registerActAction

 public function registerActAction()
 {
     $m['username'] = $this->getParam('username');
     $m['password'] = $this->getParam('password');
     if (!$m['username'] || !$m['password']) {
         $error = 'Username and password are required !';
         $this->showError($error, 'index');
     }
     // Username exists ?
     $where = array('username' => $m['username']);
     $num = $this->m_user->Where($where)->Total();
     if ($num) {
         $msg = '注册名已存在, 请更换';
         $this->showError($msg, 'index');
     }
     $userID = $this->m_user->Insert($m);
     if (!$userID) {
         $error = '注册失败,请重试';
         $this->showError($error, 'index');
     } else {
         $msg = '注册成功,请登录';
         $url = '/login';
     }
     jsAlert($msg);
     jsRedirect($url);
 }
开发者ID:xn1224,项目名称:YOF,代码行数:26,代码来源:Register.php

示例3: init

 private function init()
 {
     $this->m_user = $this->load('user');
     $userID = $this->getSession('userID');
     if ($userID) {
         jsRedirect('/user/profile');
     }
 }
开发者ID:udeth,项目名称:YOF,代码行数:8,代码来源:Login.php

示例4: resetGetParams

function resetGetParams($params, $newURL = null)
{
    zbx_value2array($params);
    $redirect = false;
    $url = new CUrl($newURL);
    foreach ($params as $num => $param) {
        if (!isset($_GET[$param])) {
            continue;
        }
        $redirect = true;
        $url->setArgument($param, null);
    }
    if ($redirect) {
        jsRedirect($url->getUrl());
        include_once 'include/page_footer.php';
    }
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:17,代码来源:func.inc.php

示例5: registerActAction

 public function registerActAction()
 {
     $m['username'] = $this->getPost('username');
     $m['password'] = $this->getPost('password');
     if (!$m['username'] || !$m['password']) {
         $error = 'Username and password are required !';
         $this->showError($error, 'index');
     }
     $userID = $this->m_user->Insert($m);
     if (!$userID) {
         $error = '注册失败,请重试';
         $this->showError($error, 'index');
     } else {
         $msg = '注册成功,请登录';
         $url = '/login';
     }
     jsAlert($msg);
     jsRedirect($url);
 }
开发者ID:udeth,项目名称:YOF,代码行数:19,代码来源:Register.php

示例6: resetActAction

 public function resetActAction()
 {
     $t = $this->getPost('t');
     $m = array();
     $m['password'] = md5($t['newPass']);
     if ($this->adminAccount == $_SESSION['adminName']) {
         $where = array('username' => $_SESSION['adminName']);
         $data = $this->load('Admin')->Where($where)->UpdateOne($m);
     }
     if ($data !== FALSE) {
         unset($_SESSION['admin'], $_SESSION['priv'], $_SESSION['adminID'], $_SESSION['adminName']);
         $msg = '密码修改成功,请重新登录!';
         $url = '/admin/login';
     } else {
         $msg = '密码修改失败!';
         $url = '/admin/index/reset';
     }
     jsAlert($msg);
     jsRedirect($url);
 }
开发者ID:xn1224,项目名称:YOF,代码行数:20,代码来源:Index.php

示例7: actionErrorAction

 public function actionErrorAction()
 {
     $url = 'http://yof.mylinuxer.com/article/abc?pd=1';
     jsRedirect($url);
 }
开发者ID:xinuxZ,项目名称:YOF,代码行数:5,代码来源:Profile.php

示例8: delAction

 public function delAction()
 {
     $articleID = $this->get('articleID');
     $code = $this->m_article->DeleteByID($articleID);
     jsRedirect($this->homeUrl);
 }
开发者ID:GobYang,项目名称:thaidh,代码行数:6,代码来源:Article.php

示例9: access_deny

$trigger = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => API_OUTPUT_EXTEND, 'expandDescription' => true]);
if (!$trigger) {
    access_deny();
}
$trigger = reset($trigger);
/*
 * Actions
 */
if (hasRequest('update')) {
    DBstart();
    $result = DBexecute('UPDATE triggers' . ' SET comments=' . zbx_dbstr(getRequest('comments')) . ' WHERE triggerid=' . zbx_dbstr(getRequest('triggerid')));
    $trigger['comments'] = $_REQUEST['comments'];
    if ($result) {
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, _('Trigger') . ' [' . $_REQUEST['triggerid'] . '] [' . $trigger['description'] . '] ' . _('Comments') . ' [' . $_REQUEST['comments'] . ']');
    }
    $result = DBend($result);
    show_messages($result, _('Description updated'), _('Cannot update description'));
} elseif (isset($_REQUEST['cancel'])) {
    jsRedirect('tr_status.php');
    exit;
}
/*
 * Display
 */
$triggerEditable = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => ['triggerid'], 'editable' => true]);
$data = ['triggerid' => getRequest('triggerid'), 'trigger' => $trigger, 'isTriggerEditable' => !empty($triggerEditable), 'isCommentExist' => !empty($trigger['comments'])];
// render view
$triggerCommentView = new CView('monitoring.triggerComment', $data);
$triggerCommentView->render();
$triggerCommentView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:tr_comments.php

示例10: time

        // add friend if exists & not already is a friend.
        $friendid = $db->getArray('SELECT user_id FROM ' . db_users . ' WHERE username="' . $_POST['name'] . '" LIMIT 1;');
        if (empty($friendid)) {
            $ets->page_body = '<div class="error">' . $l['ucp-fri-badname'] . '</div>';
        } else {
            // are already friends?
            $fid = $friendid['user_id'];
            if ($user->areFriends($fid)) {
                $ets->page_body = '<div class="error">' . $l['ucp-fri-exists'] . '</div>';
            } else {
                // add the friend
                $uid = $user->id;
                $now = time();
                $db->query('INSERT INTO `' . db_friends . "` ( `owner_id` , `friend_id` , `date` )\r\n\t\t\t\tVALUES (\r\n\t\t\t\t'{$uid}', '{$fid}', '{$now}'\r\n\t\t\t\t);");
                // friend is added, send back to list of friends page.
                jsRedirect('usercp.php?action=friends');
            }
        }
    }
    // Show list of friends
    if (count($user->friends) > 0) {
        $ets->page_body .= '<table class="nlb_table"><tr>
		<th>' . $l['username:'] . '</th>
		<th>' . $l['ucp-fri-profile'] . '</th><th>' . $l['ucp-fri-blog'] . '</th>
		<th>' . $l['ucp-fri-added'] . '</th>
		<th>' . $l['ucp-fri-del'] . '</th></tr>';
        // get info on friends.
        $friends = $db->getAllArray('SELECT f.date, u.username, u.blog_count, u.user_id
		FROM ' . db_users . ' as u, ' . db_friends . ' as f
		WHERE f.owner_id = ' . $user->id . ' AND u.user_id = f.friend_id
		ORDER BY f.date DESC;');
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:friends.php

示例11: checkLoginAction

 public function checkLoginAction()
 {
     $username = $this->getPost('username');
     $password = $this->getPost('password');
     if (!$username || !$password) {
         jsAlert('信息不完整!');
         jsRedirect($this->homeUrl);
     }
     // 管理员登陆
     if (SUPER_ADMIN == $username) {
         $data = $this->m_admin->checkLogin($username, $password);
     } else {
         // 普通角色登陆
         $data = $this->m_role->checkRole($username, $password);
     }
     if (!$data) {
         // Login fail
         $log['status'] = 0;
         jsAlert('账号或密码不正确!');
         jsRedirect($this->homeUrl);
     } else {
         // Login OK, log this action and find privileges
         $this->setSession('adminID', $data['id']);
         $this->setSession('adminName', $username);
         // admin 拥有所有的权限
         if (SUPER_ADMIN == $username) {
             $this->setSession('priv', 'ALL');
         } else {
             // 不是管理员, 记录其 roleID, 用于查找权限
             // 1: 取得登录的角色所拥有的权限
             $priv = $this->m_role->getPrivilegeByRoleID($data['id']);
             // 如果角色没有分配到任何权限, 提示, 并且退出, 有则 SESSION 记录其所有的权限,供进一步处理
             if (!$priv['privilege']) {
                 jsAlert('您还没有任何权限, 请联系管理员!');
                 jsRedirect($this->homeUrl);
             } else {
                 $this->setSession('priv', $priv);
             }
         }
     }
     // Privileges
     include APP_PATH . '/application/modules/Admin/menu.php';
     if (SUPER_ADMIN != $this->getSession('adminName')) {
         $priv = $this->getSession('priv');
         $priv = explode(',', $priv['privilege']);
         // 1: 与大菜单对比, 删除会员没有权限的菜单
         foreach ($menu as $k => $v) {
             foreach ($v as $kk => $vv) {
                 if (is_array($vv)) {
                     foreach ($vv as $kkk => $vvv) {
                         if (!in_array($kkk, $priv)) {
                             unset($menu[$k][$kk][$kkk]);
                         }
                     }
                 }
             }
         }
         // 2: 进一步处理: 删除没有子菜单的项
         foreach ($menu as $k => $v) {
             if (!$v['sub']) {
                 unset($menu[$k]);
             }
         }
     }
     $this->setSession('menu', $menu);
     jsRedirect('/admin/dashboard');
 }
开发者ID:ylh990835774,项目名称:YOF,代码行数:67,代码来源:Login.php

示例12: array

    } else {
        if (isset($_REQUEST['triggers'])) {
            $options = array('output' => API_OUTPUT_SHORTEN, 'acknowledged' => 0, 'triggerids' => $_REQUEST['triggers']);
            $_REQUEST['events'] = CEvent::get($options);
        }
    }
    $eventsData = array('eventids' => zbx_objectValues($_REQUEST['events'], 'eventid'), 'message' => $_REQUEST['message']);
    $result = CEvent::acknowledge($eventsData);
    show_messages($result, S_EVENT_ACKNOWLEDGED, S_CANNOT_ACKNOWLEDGE_EVENT);
    if ($result) {
        $event_acknowledged = true;
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, S_ACKNOWLEDGE_ADDED . ' [' . $bulk ? ' BULK ACKNOWLEDGE ' : expand_trigger_description_by_data($event_trigger) . ']' . ' [' . $_REQUEST['message'] . ']');
    }
    if (isset($_REQUEST['saveandreturn'])) {
        $url = new CUrl(urldecode($_REQUEST['backurl']));
        jsRedirect($url->getUrl());
        exit;
    }
}
$msg = $bulk ? ' BULK ACKNOWLEDGE ' : expand_trigger_description_by_data($event_trigger);
show_table_header(array(S_ALARM_ACKNOWLEDGES_BIG . ': ', $msg));
print SBR;
if ($bulk) {
    $title = S_ACKNOWLEDGE_ALARM_BY;
    $btn_txt2 = S_ACKNOWLEDGE . ' ' . S_AND_SYMB . ' ' . S_RETURN;
} else {
    $db_acks = get_acknowledges_by_eventid($_REQUEST['eventid']);
    if ($db_acks) {
        $table = new CTable(null, 'ack_msgs');
        $table->setAlign('center');
        while ($db_ack = DBfetch($db_acks)) {
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:acknow.php

示例13: text

 *		E D I T   N E W S   I T E M
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
$text = new text($_POST, array('body'), array('subject', 'bb', 'html', 'smiles', 'comments'));
$problems = array();
$baddata = false;
$USESKIN = skin_basic;
$ets_outter->main_title = $config->get('site_name') . ": " . $l['acp-editnews'];
$ets_outter->page_title = $l['acp-editnews'];
if (!isset($_GET['id'])) {
    // No news ID specified.
    jsRedirect("admincp.php?action=edit_list");
}
if (!empty($_POST)) {
    /**
     *		Check submited data
     */
    $text->validate();
    $text->makeClean('trim', 'slash_if_needed');
    $c = $text->clean;
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        /**
         * 		U P D A T E   I T E M
         */
        // deal with options.
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:edit_news.php

示例14: jsRedirect

<?php

/**
 * =======================================
 * 		E D I T   A R T I C L E
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
if (!isset($_GET['id'])) {
    jsRedirect('admincp.php?action=list_article');
}
$USESKIN = skin_basic;
$text = new text($_POST, array('subject', 'body'));
$text->validate();
$text->makeClean('slash_if_needed', 'trim');
$baddata = false;
$problems = array();
$ets->page_body = '';
$ets_outter->main_title = $config->get('site_name') . ": " . $l['title-art-edit'];
$ets_outter->page_title = $l['title-art-edit'];
if (!empty($_POST)) {
    // check data
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        $subject = $text->clean['subject'];
        $body = $text->clean['body'];
        badHtmlSecond($body);
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:edit_article.php

示例15: jsRedirect

<?php

/**
 * =======================================
 *		E D I T   U S E R
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
$ets->page_body = '';
$baddata = false;
if (!isset($_GET['id'])) {
    jsRedirect('admincp.php?action=edit_user');
} else {
    $USERID = $_GET['id'];
    $edituser = new nlb_user($db, $USERID);
}
$text = new text($_POST, array('username', 'email', 'blog_count', 'timezone', 'access'), array('bio', 'custom'));
$text->validate();
$text->makeClean('trim', 'slash_if_needed');
if (!empty($_POST)) {
    // check data
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        $c = $text->clean;
        $c['timezone'] -= 13;
        foreach ($c as $key => $value) {
            $edituser->set($key, $value);
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:edit_user_id.php


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