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


PHP phorum_redirect_by_url函数代码示例

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


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

示例1: phorum_return_to_list

/**
 * just returns to the list and exits the program
 */
function phorum_return_to_list()
{
    $PHORUM=$GLOBALS["PHORUM"];
    if(!empty($PHORUM["forum_id"])){
        phorum_redirect_by_url(phorum_get_url(PHORUM_LIST_URL));
    }else{
        phorum_redirect_by_url(phorum_get_url(PHORUM_INDEX_URL));
    }
    exit();
}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:13,代码来源:moderation_functions.php

示例2: phorum_redirect_by_url

//   phorum.org) or the Phorum License that was distributed with this file    //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   You should have received a copy of the Phorum License                    //
//   along with this program.                                                 //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_CONTROL_CENTER")) {
    return;
}
require_once "./include/api/base.php";
require_once "./include/api/file_storage.php";
if (!$PHORUM["DATA"]["MESSAGE_MODERATOR"]) {
    phorum_redirect_by_url(phorum_get_url(PHORUM_CONTROLCENTER_URL));
    exit;
}
// the number of days to show
if (isset($_POST['moddays']) && is_numeric($_POST['moddays'])) {
    $moddays = (int) $_POST['moddays'];
} elseif (isset($PHORUM['args']['moddays']) && !empty($PHORUM["args"]['moddays']) && is_numeric($PHORUM["args"]['moddays'])) {
    $moddays = (int) $PHORUM['args']['moddays'];
} else {
    $moddays = phorum_api_user_get_setting("cc_messages_moddays");
}
if ($moddays === NULL) {
    $moddays = 2;
}
if (isset($_POST['onlyunapproved']) && is_numeric($_POST['onlyunapproved'])) {
    $showwaiting = (int) $_POST['onlyunapproved'];
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:messages.php

示例3: elseif

                // we have now set this folder as vroot
                } elseif($setvroot && ($oldfolder['vroot']==0 || $oldfolder['vroot'] != $cur_folder_id)) {    
                    if(!phorum_admin_set_vroot($cur_folder_id)) {
                        $error="Database error while setting virtual-root info.";
                    }            
                    
                } // is there an else?
                
            } else {
                $error="Database error while adding/updating folder.";
            }
        }

        if(empty($error)) {
            phorum_redirect_by_url($_SERVER['PHP_SELF']);
            exit();
        }

        foreach($_POST as $key=>$value){
            $$key=$value;
        }

    } elseif(defined("PHORUM_EDIT_FOLDER")) {

        $forum_settings = phorum_db_get_forums($_REQUEST["forum_id"]);
        extract($forum_settings[$_REQUEST["forum_id"]]);

    }

    if($error){
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:newfolder.php

示例4: list

    // dst is time + 1 hour
    if (isset($_POST['tz_offset']) && $_POST['tz_offset'] != -99) {
        if ($_POST['tz_offset'] && isset($_POST['is_dst']) && $_POST['is_dst']) {
            $_POST['tz_offset'] = ++$_POST['tz_offset'] . "";
        }
    }
    // unsetting dst if not checked
    if (!isset($_POST['is_dst'])) {
        $_POST['is_dst'] = 0;
    }
    $oldtemplate = $PHORUM["user"]["user_template"];
    list($error, $okmsg) = phorum_controlcenter_user_save($panel);
    // No error and the template changed? The reload the page to
    // reflect the new template.
    if (empty($error) && !empty($_POST["user_template"]) && $oldtemplate != $_POST["user_template"]) {
        phorum_redirect_by_url($PHORUM['DATA']['URL']['CC6']);
        exit;
    }
}
if (isset($PHORUM["user_time_zone"])) {
    $PHORUM['DATA']['PROFILE']['TZSELECTION'] = $PHORUM["user_time_zone"];
}
// compute the tz-array
if (!isset($PHORUM['DATA']['PROFILE']['tz_offset']) || $PHORUM['DATA']['PROFILE']['tz_offset'] == -99) {
    $defsel = " selected=\"selected\"";
} else {
    $defsel = "";
}
// remove dst from tz_offset
if (isset($PHORUM['DATA']['PROFILE']['is_dst']) && $PHORUM['DATA']['PROFILE']['is_dst']) {
    $PHORUM['DATA']['PROFILE']['tz_offset'] = --$PHORUM['DATA']['PROFILE']['tz_offset'];
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:forum.php

示例5: phorum_redirect_by_url

<?php

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//   Copyright (C) 2006  Phorum Development Team                              //
//   http://www.phorum.org                                                    //
//                                                                            //
//   This program is free software. You can redistribute it and/or modify     //
//   it under the terms of either the current Phorum License (viewable at     //
//   phorum.org) or the Phorum License that was distributed with this file    //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   You should have received a copy of the Phorum License                    //
//   along with this program.                                                 //
////////////////////////////////////////////////////////////////////////////////

    if(!defined("PHORUM_ADMIN")) return;
    
    phorum_redirect_by_url(phorum_get_url(PHORUM_INDEX_URL));
    exit();

?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:25,代码来源:index.php

示例6: trim

//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   You should have received a copy of the Phorum License                    //
//   along with this program.                                                 //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_CONTROL_CENTER")) {
    return;
}
if (count($_POST)) {
    $old_password = trim($_POST["password_old"]);
    $new_password = trim($_POST['password_new']);
    // attempt to authenticate the user
    if (empty($old_password) || !phorum_api_user_authenticate(PHORUM_FORUM_SESSION, $PHORUM['user']['username'], $old_password)) {
        $error = $PHORUM["DATA"]["LANG"]["ErrOriginalPassword"];
    } elseif (empty($new_password) || empty($_POST['password_new2']) || $_POST['password_new'] !== $_POST['password_new2']) {
        $error = $PHORUM["DATA"]["LANG"]["ErrPassword"];
    } else {
        // everything's good, save
        $_POST['password_temp'] = $_POST['password'] = $new_password;
        list($error, $okmsg) = phorum_controlcenter_user_save($panel);
        // Redirect to the password page, to make sure that the
        // CSRF token is refreshed. This token is partly based on the
        // session id and this session id changed along with the password.
        phorum_redirect_by_url(phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_PASSWORD, "okmsg=" . urlencode($okmsg)));
    }
}
$PHORUM["DATA"]["HEADING"] = $PHORUM["DATA"]["LANG"]["ChangePassword"];
$PHORUM['DATA']['PROFILE']['CHANGEPASSWORD'] = 1;
$template = "cc_usersettings";
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:password.php

示例7: phorum_get_url

// somehow we got to a folder
if($PHORUM["folder_flag"] || empty($PHORUM["forum_id"])){
    $dest_url = phorum_get_url(PHORUM_INDEX_URL, $PHORUM["forum_id"]);
    phorum_redirect_by_url($dest_url);
    exit();
}

if(isset($PHORUM["args"][1])){
    $thread=$PHORUM["args"][1];
} elseif(isset($_POST["thread"])){
    $thread=$_POST["thread"];
}

if(empty($thread)) {
    phorum_redirect_by_url(phorum_get_url(PHORUM_LIST_URL));
    exit();
}

$message=phorum_db_get_message($thread);

if(isset($PHORUM["args"]["remove"])){
    // we are removing a message from the follow list
    phorum_user_unsubscribe( $PHORUM['user']['user_id'], $thread );
    $PHORUM["DATA"]["MESSAGE"]=$PHORUM["DATA"]["LANG"]["RemoveFollowed"];
    $PHORUM["DATA"]["URL"]["REDIRECT"]=phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $thread);
    $PHORUM["DATA"]["BACKMSG"]=$PHORUM["DATA"]["LANG"]["BackToThread"];
    $template="message";
} elseif(isset($PHORUM["args"]["noemail"])){
    // we are stopping emails for this thread
    phorum_user_unsubscribe( $PHORUM['user']['user_id'], $thread );
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:follow.php

示例8: phorum_db_update_settings

<?php

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//   Copyright (C) 2007  Phorum Development Team                              //
//   http://www.phorum.org                                                    //
//                                                                            //
//   This program is free software. You can redistribute it and/or modify     //
//   it under the terms of either the current Phorum License (viewable at     //
//   phorum.org) or the Phorum License that was distributed with this file    //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   You should have received a copy of the Phorum License                    //
//   along with this program.                                                 //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_ADMIN")) {
    return;
}
phorum_db_update_settings(array("status" => $_POST["status"]));
phorum_redirect_by_url($PHORUM["admin_http_path"]);
exit;
开发者ID:sheldon,项目名称:dejavu,代码行数:24,代码来源:status.php

示例9: phorum_require_login

phorum_require_login();

include_once("./include/email_functions.php");
include_once("./include/format_functions.php");

define("PHORUM_CONTROL_CENTER", 1);

// A user has to be logged in to use his control-center.
if (!$PHORUM["DATA"]["LOGGEDIN"]) {
    phorum_redirect_by_url(phorum_get_url(PHORUM_LIST_URL));
    exit();
}

// If the user is not fully logged in, send him to the login page.
if(!$PHORUM["DATA"]["FULLY_LOGGEDIN"]){
    phorum_redirect_by_url(phorum_get_url(PHORUM_LOGIN_URL, "redir=".PHORUM_CONTROLCENTER_URL));
    exit();
}

$error_msg = false;

// Generating the panel id of the page to use.
$panel = (!isset($PHORUM['args']['panel']) || empty($PHORUM["args"]['panel']))
       ? PHORUM_CC_SUMMARY : $PHORUM["args"]['panel'];

// Sometimes we set the panel id from a post-form.
if (isset($_POST['panel'])) {
    $panel = $_POST['panel'];
}

// Set all our URLs.
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:control.php

示例10: phorum_get_url

        $addcode = "";
        if (isset($_POST['moddays']) && is_numeric($_POST['moddays'])) {
            $addcode .= "moddays=" . $_POST['moddays'];
        }
        if (isset($_POST['onlyunapproved']) && is_numeric($_POST['onlyunapproved'])) {
            if (!empty($addcode)) {
                $addcode .= ",";
            }
            $addcode .= "onlyunapproved=" . $_POST['onlyunapproved'];
        }
        $url = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_UNAPPROVED, $addcode);
    } else {
        $message = phorum_db_get_message($msgthd_id);
        $url = phorum_get_url(PHORUM_READ_URL, $message["thread"], $message["message_id"]);
    }
    phorum_redirect_by_url($url);
    exit;
}
$template = "message";
// set all our URL's
phorum_build_common_urls();
// make it possible to override this var in a hook
$is_admin_user = $PHORUM["user"]["admin"];
/*
 * [hook]
 *     moderation
 *
 * [description]
 *     This hook can be used for logging moderator actions. You can
 *     use the <literal>$PHORUM</literal> array to retrieve additional info
 *     like the moderating user's id and similar.<sbr/>
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:moderation.php

示例11: phorum_admin_set_vroot

                 // just default root ...
                 phorum_admin_set_vroot($cur_folder_id, 0, $cur_folder_id);
             }
             // we have now set this folder as vroot
         } elseif ($setvroot && ($oldfolder['vroot'] == 0 || $oldfolder['vroot'] != $cur_folder_id)) {
             if (!phorum_admin_set_vroot($cur_folder_id)) {
                 $error = "Database error while setting virtual-root info.";
             }
         }
         // is there an else?
     } else {
         $error = "Database error while adding/updating folder.";
     }
 }
 if (empty($error)) {
     phorum_redirect_by_url("{$PHORUM["admin_http_path"]}?parent_id={$cur_folder["parent_id"]}");
     exit;
 }
 foreach ($_POST as $key => $value) {
     ${$key} = $value;
 }
 $forum_settings = $_POST;
 if ($setvroot) {
     $vroot = $_POST["forum_id"];
 } else {
     if ($_POST["forum_id"] != $oldfolder["vroot"]) {
         $vroot = $oldfolder["vroot"];
     } else {
         $vroot = 0;
     }
 }
开发者ID:sheldon,项目名称:dejavu,代码行数:31,代码来源:newfolder.php

示例12: phorum_user_access_allowed

$PHORUM["DATA"]["MODERATOR"] = phorum_user_access_allowed(PHORUM_USER_ALLOW_MODERATE_MESSAGES);

$msgthd_id = (isset($_POST["thread"])) ? (int)$_POST["thread"] : (int)$PHORUM['args'][2];

$mod_step = (isset($_POST["mod_step"])) ? (int)$_POST["mod_step"] : (int)$PHORUM['args'][1];

if(empty($msgthd_id) || !phorum_user_access_allowed(PHORUM_USER_ALLOW_MODERATE_MESSAGES)) {
   phorum_return_to_list();
}

// If the user is not fully logged in, send him to the login page.
// because moderation action can vary so much, the only safe bet is to send them
// to the referrer if they are not fully logged in
if(!$PHORUM["DATA"]["FULLY_LOGGEDIN"]){
    phorum_redirect_by_url(phorum_get_url(PHORUM_LOGIN_URL, "redir=".$_SERVER["HTTP_REFERER"]));
    exit();
}


$template="message";
// set all our URL's
phorum_build_common_urls();

// make it possible to override this var in a hook
$is_admin_user=$PHORUM["user"]["admin"];

// a hook for doing stuff in moderation, i.e. logging moderator-actions
phorum_hook("moderation",$mod_step);

开发者ID:nistormihai,项目名称:Newscoop,代码行数:28,代码来源:moderation.php

示例13: phorum_require_login

/**
 * A common function to check that a user is logged in
 */
function phorum_require_login()
{
    $PHORUM = $GLOBALS['PHORUM'];
    if ( !$PHORUM["user"]["user_id"] ) {
        $url = phorum_get_url( PHORUM_LOGIN_URL, "redir=" . urlencode( $PHORUM["http_path"] . "/" . basename( $_SERVER["PHP_SELF"] ) . "?" . $_SERVER["QUERY_STRING"] ) );
        phorum_redirect_by_url( $url );
        exit();
    }
}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:12,代码来源:common.php

示例14: phorum_require_login

/**
 * Require that the user is logged in.
 *
 * A check is done to see if the user is logged in.
 * If not, then the user is redirected to the login page.
 */
function phorum_require_login()
{
    $PHORUM = $GLOBALS['PHORUM'];
    if (!$PHORUM["user"]["user_id"]) {
        $url = phorum_get_url(PHORUM_LOGIN_URL, "redir=" . phorum_get_current_url());
        phorum_redirect_by_url($url);
        exit;
    }
}
开发者ID:sleepy909,项目名称:cpassman,代码行数:15,代码来源:common.php

示例15: elseif

            // Redirecting to the registration or login page is a little weird,
            // so we just go to the list page if we came from one of those.
            elseif (isset($PHORUM['use_cookies']) && $PHORUM["use_cookies"] && !strstr($_POST["redir"], "register." . PHORUM_FILE_EXTENSION) && !strstr($_POST["redir"], "login." . PHORUM_FILE_EXTENSION)) {
                $redir = $_POST["redir"];

            // By default, we redirect to the list page.
            } else {
                $redir = phorum_get_url( PHORUM_LIST_URL );
            }

            // The hook "after_login" can be used by module writers to
            // set a custom redirect URL.
            $redir =phorum_hook( "after_login", $redir );

            phorum_redirect_by_url($redir);
            exit();
        }

        // Login failed.
        else {
            $error = $PHORUM["DATA"]["LANG"]["InvalidLogin"];
        }
    }
}

// No data posted, so this is the first request. Here we set
// a temporary cookie, so we can check if the user's browser
// supports cookies.
elseif($PHORUM["use_cookies"]) {
    setcookie( "phorum_tmp_cookie", "this will be destroyed once logged in", 0, $PHORUM["session_path"], $PHORUM["session_domain"] );
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:login.php


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