本文整理汇总了PHP中page_close函数的典型用法代码示例。如果您正苦于以下问题:PHP page_close函数的具体用法?PHP page_close怎么用?PHP page_close使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了page_close函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startpage_redirect
function startpage_redirect($page_code)
{
switch ($page_code) {
case 1:
case 2:
$jump_page = "dispatch.php/my_courses";
break;
case 3:
$jump_page = "dispatch.php/calendar/schedule";
break;
case 4:
$jump_page = "dispatch.php/contact";
break;
case 5:
$jump_page = "dispatch.php/calendar/single";
break;
case 6:
// redirect to global blubberstream
// or no redirection if blubber isn't active
if (PluginEngine::getPlugin("Blubber")) {
$jump_page = "plugins.php/blubber/streams/global";
}
break;
}
page_close();
header("location: {$jump_page}");
exit;
}
示例2: before_filter
function before_filter(&$action, &$args)
{
if (Request::option('auswahl')) {
Request::set('cid', Request::option('auswahl'));
}
parent::before_filter($action, $args);
checkObject();
$this->institute = Institute::findCurrent();
if (!$this->institute) {
throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
}
$this->institute_id = $this->institute->id;
//set visitdate for institute, when coming from meine_seminare
if (Request::option('auswahl')) {
object_set_visit($this->institute_id, "inst");
}
//gibt es eine Anweisung zur Umleitung?
if (Request::get('redirect_to')) {
$query_parts = explode('&', stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to'));
list(, $where_to) = explode('=', array_shift($query_parts));
$new_query = $where_to . '?' . join('&', $query_parts);
page_close();
$new_query = preg_replace('/[^:0-9a-z+_\\-.#?&=\\/]/i', '', $new_query);
header('Location: ' . URLHelper::getURL($new_query, array('cid' => $this->institute_id)));
die;
}
PageLayout::setHelpKeyword("Basis.Einrichtungen");
PageLayout::setTitle($this->institute->getFullName() . " - " . _("Kurzinfo"));
Navigation::activateItem('/course/main/info');
}
示例3: print_error
function print_error($errstr, $predef)
{
$exp_error['predef'] = $predef;
$exp_error['errorstr'] = $errstr;
display_directory($exp_error);
page_close();
exit;
}
示例4: redirect
public function redirect($url, $shutdown = TRUE)
{
$url = str_replace('&', '&', $url);
header('HTTP/1.1 302 Moved Temporarily');
header('Location:' . $url);
if ($shutdown) {
page_close();
exit;
}
}
示例5: doit
function doit()
{
global $sess, $HTTP_POST_VARS, $mytrail, $auth;
if ($HTTP_POST_VARS['field_subject'] == "") {
form(true);
page_close();
exit;
}
if (!defined("TALK_INC")) {
include "messages/talk.inc";
}
talk($auth->auth['uname'], $mytrail['userid'], $HTTP_POST_VARS['field_subject'], $HTTP_POST_VARS['field_message'], $mytrail['id']);
header("Location: " . $sess->url($mytrail['path']));
}
示例6: display_done
function display_done()
{
global $kat, $auth, $uid, $perm, $sess;
if (!defined("COMMON_PERMISSIONS_INC")) {
include "commonapi/common_permissions.inc";
}
/*
auth_preauth() will authenticatge the user since logon_now_as is registered and set to true
*/
page_close();
page_open(array("sess" => "Linktrail_Session", "auth" => "Linktrail_Auth", "perm" => "Linktrail_Perm"));
$caps = get_caps($perm, '/');
if (!defined("LAY_MYPAGE_INC")) {
include "layout/lay_mypage.inc";
}
if (!defined("LAY_DIRECTORY_INC")) {
include "layout/lay_directory.inc";
}
$pl = build_pathlist($kat, false);
$plf = build_pathlist($kat, true);
$restriction_list = build_restriction_list($kat);
//$username = $auth->auth['uname'];
$in_login = false;
include "template.inc";
include "commonheader2.html";
$tpl = new Template(APPLICATION_HOME . "/templates/login", "keep");
$tpl->set_file(array("main" => "regdone.html"));
//$tpl->set_var("IWANTTO", print_mypage_iwantto($caps, $auth->auth['uname']));
$tpl->set_var("USERNAME", $auth->auth['uname']);
$tpl->set_var("MYPAGEURL", $sess->url(build_good_url("/Experts/" . $auth->auth['uname'])));
$tpl->set_var("SETTINGSURL", $sess->url(build_good_url("/Experts/" . $auth->auth['uname'] . '/Settings')));
$tpl->set_var("TOURURL", $sess->url("/Tour/"));
$tpl->set_var("IWANTTO", print_iwantto('/', $caps));
$tpl->set_var("HOME_URL", $sess->url("/"));
$tpl->parse("main", "main");
$tpl->p("main");
include "commonfooter2.html";
page_close();
exit;
}
示例7: check_edit_perms
function check_edit_perms()
{
global $sess, $auth;
$ok = false;
if ($_ENV["edit_requires"]) {
foreach (explode(",", $_ENV["edit_requires"]) as $need) {
if ($sess->have_perm($need)) {
$ok = true;
}
}
} else {
$ok = true;
}
$_ENV["show_edit"] = $ok;
if (!$ok) {
if ($auth) {
$usrnm = $auth->auth["uname"];
$p = $auth->auth["perm"];
}
echo "<h3>Permission Denied</h1>\n";
echo "<p class=error>User {$usrnm} does not have sufficient access privileges for this {$cmd} {$submit} operation on this page</p>\n";
echo "<p>{$usrnm} has {$p} rights</p>";
page_close();
exit;
}
}
示例8: start
function start()
{
global $smarty, $lang_str, $lang_set, $page_attributes, $config, $sess;
global $sess_page_controler_domain_id;
/* check if admin have perms to manage user */
if ($this->check_perms_to_user) {
if (!$this->check_perms_to_user()) {
page_close();
die("You haven't permissions to manage user '" . $this->user_id->get_username() . "@" . $this->user_id->get_realm() . "'");
}
}
/* check if admin have perms to manage domain */
if ($this->check_perms_to_domain) {
if (!$this->check_perms_to_domain()) {
page_close();
die("You haven't permissions to manage domain with id:'" . $this->domain_id . "'");
}
}
/* do not allow change parameters of default domain */
if ($this->domain_id == '0') {
$sess_page_controler_domain_id = null;
page_close();
die("Change parameters of default domain is not possible");
}
/* make code portable - if magic_quotes_gpc is set to on, strip slashes */
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value)
{
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
/* translate chars '<', '>', etc. to < > etc.. */
if ($this->perform_hack_protect) {
$this->hack_protection();
}
/* propagate user_id and reference to this to all application units */
foreach ($this->apu_objects as $key => $val) {
$this->apu_objects[$key]->user_id = $this->user_id;
$this->apu_objects[$key]->domain_id = $this->domain_id;
$this->apu_objects[$key]->controler =& $this;
}
/* run all init methods */
foreach ($this->apu_objects as $key => $val) {
$this->apu_objects[$key]->init();
}
if (!empty($this->post_init)) {
call_user_func_array($this->post_init, array(&$this));
}
/* determine actions of all application units
and check if some APU needs validate form or send header 'location'
*/
$this->_determine_actions();
/* call post_determine_action methods for each APU */
$this->_post_determine_actions();
/* create html form by all application units */
$this->_create_html_form();
/* validate html form */
$form_valid = $this->_validate_html_form();
/* if form(s) valid, execute actions of all application units */
if ($form_valid) {
$this->_execute_actions();
} else {
$this->_form_invalid();
$this->_form_load_defaults();
}
/** get messages **/
$this->_get_messages();
/** assign values and form(s) to smarty **/
$this->_smarty_assign();
$smarty->assign_by_ref('parameters', $page_attributes);
$smarty->assign_by_ref('lang_str', $lang_str);
$smarty->assign_by_ref('lang_set', $lang_set);
$smarty->assign_by_ref('come_from_admin_interface', $this->come_from_admin_interface);
if (is_object($this->user_id)) {
$smarty->assign_by_ref('user_auth', $this->user_id->to_smarty());
}
$cfg = new stdclass();
$cfg->img_src_path = $config->img_src_path;
$cfg->js_src_path = $config->js_src_path;
$cfg->style_src_path = $config->style_src_path;
$cfg->user_pages_path = $config->user_pages_path;
$cfg->admin_pages_path = $config->admin_pages_path;
$cfg->domains_path = $config->domains_path;
$smarty->assign_by_ref("cfg", $cfg);
//page atributes - get user real name
$page_attributes['errors'] =& $this->errors;
$page_attributes['message'] =& $this->messages;
/* obtain list of required javascripts */
foreach ($this->apu_objects as $val) {
$this->required_javascript = array_merge($this->required_javascript, $val->get_required_javascript());
}
$this->required_javascript = array_unique($this->required_javascript);
/* ----------------------- HTML begin ---------------------- */
if (!isset($page_attributes['required_javascript']) or !is_array($page_attributes['required_javascript'])) {
$page_attributes['required_javascript'] = array();
//.........这里部分代码省略.........
示例9: first_decision
function first_decision($userid) {
$vis_cmd = Request::option('vis_cmd');
$vis_state = Request::option('vis_state');
$user_language = getUserLanguagePath($userid);
if ($vis_cmd == "apply" && ($vis_state == "global" || $vis_state == "yes" || $vis_state == "no")) {
$query = "UPDATE auth_user_md5 SET visible = ? WHERE user_id = ?";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($vis_state, $userid));
return;
}
$query = "SELECT visible FROM auth_user_md5 WHERE user_id = ?";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($userid));
$visiblity = $statement->fetchColumn();
if ($visiblity != 'unknown') {
return;
}
PageLayout::setTitle(_('Bitte wählen Sie Ihren Sichtbarkeitsstatus aus!'));
PageLayout::setTabNavigation(NULL);
// avoid recursion when loading the header
$GLOBALS['USER_VISIBILITY_CHECK'] = false;
$template = $GLOBALS['template_factory']->open("../locale/$user_language/LC_HELP/visibility_decision.php");
$template->set_layout('layouts/base_without_infobox');
echo $template->render();
page_close();
die;
}
示例10: simple_send
function simple_send($userdata)
{
global $HTTP_POST_VARS, $auth;
if ($HTTP_POST_VARS['field_subject'] == "" and $HTTP_POST_VARS['field_message'] == "") {
display_form(false, "", true);
page_close();
exit;
//there is a header(Location: mypage) after this funtion so don't exit this one!
} else {
if (!defined("TALK_INC")) {
include "messages/talk.inc";
}
talk($auth->auth['uname'], $userdata['User_ID'], $HTTP_POST_VARS['field_subject'], $HTTP_POST_VARS['field_message']);
}
}
示例11: auth_loginform
/**
*
*/
function auth_loginform()
{
if (Request::isXhr()) {
if (Request::isDialog()) {
header('X-Location: ' . URLHelper::getURL($_SERVER['REQUEST_URI']));
page_close();
die;
}
throw new AccessDeniedException();
}
// first of all init I18N because seminar_open is not called here...
global $_language_path;
// set up dummy user environment
if ($GLOBALS['user']->id !== 'nobody') {
$GLOBALS['user'] = new Seminar_User('nobody');
$GLOBALS['perm'] = new Seminar_Perm();
$GLOBALS['auth'] = $this;
}
if (!$_SESSION['_language']) {
$_SESSION['_language'] = get_accepted_languages();
}
if (!$_SESSION['_language']) {
$_SESSION['_language'] = $GLOBALS['DEFAULT_LANGUAGE'];
}
// init of output via I18N
$_language_path = init_i18n($_SESSION['_language']);
include 'config.inc.php';
// load the default set of plugins
PluginEngine::loadPlugins();
if (Request::get('loginname') && !$_COOKIE[get_class($GLOBALS['sess'])]) {
$login_template = $GLOBALS['template_factory']->open('nocookies');
} else {
if (isset($this->need_email_activation)) {
$this->unauth();
header('Location: ' . URLHelper::getURL('activate_email.php?cancel_login=1&key=&uid=' . $this->need_email_activation));
page_close();
die;
} else {
unset($_SESSION['semi_logged_in']);
// used by email activation
$login_template = $GLOBALS['template_factory']->open('loginform');
$login_template->set_attribute('loginerror', isset($this->auth["uname"]) && $this->error_msg);
$login_template->set_attribute('error_msg', $this->error_msg);
$login_template->set_attribute('uname', isset($this->auth["uname"]) ? $this->auth["uname"] : Request::username('loginname'));
$login_template->set_attribute('self_registration_activated', $GLOBALS['ENABLE_SELF_REGISTRATION']);
}
}
PageLayout::setHelpKeyword('Basis.AnmeldungLogin');
$header_template = $GLOBALS['template_factory']->open('header');
$header_template->current_page = _('Login');
$header_template->link_params = array('cancel_login' => 1);
include 'lib/include/html_head.inc.php';
echo $header_template->render();
echo $login_template->render();
include 'lib/include/html_end.inc.php';
page_close();
}
示例12: printError
/**
*
*/
function printError () {
page_close();
exit;
}
示例13: selectSem
/**
* This function "selects" a Veranstaltung to work with it
*
* The following variables will bet set:
* $SessionSeminar Veranstaltung id<br>
* $SessSemName[0] Veranstaltung name<br>
* $SessSemName[1] Veranstaltung id<br>
* $SessSemName[2] Veranstaltung ort (room)<br>
* $SessSemName[3] Veranstaltung Untertitel (subtitle)<br>
* $SessSemName[4] Veranstaltung start_time (the Semester start_time)<br>
* $SessSemName[5] Veranstaltung institut_id (the home-intitute)<br>
* $SessSemName["art"] Veranstaltung type in alphanumeric form<br>
* $SessSemName["art_num"] Veranstaltung type in numeric form<br>
* $SessSemName["art_generic"] Veranstaltung generic type in alhanumeric form (self description)<br>
* $SessSemName["class"] Veranstaltung class (sem or inst, in this function always sem)<br>
* $SessSemName["header_line"] the header-line to use on every page of the Veranstaltung<br>
*
* @param string $sem_id the id of the Veranstaltung
*
* @return boolean true if successful
*
*/
function selectSem($sem_id)
{
global $perm, $SEM_TYPE, $SEM_TYPE_MISC_NAME, $SessionSeminar, $SessSemName, $SemUserStatus, $rechte, $auth;
closeObject();
$SessionSeminar = $sem_id;
$course = Course::findCurrent();
if ($course) {
$rechte = $perm->have_studip_perm("tutor", $course["Seminar_id"]);
if (!($SemUserStatus = $perm->get_studip_perm($course["Seminar_id"]))) {
$SemUserStatus = "nobody";
if ($course['lesezugriff'] > 0 || !get_config('ENABLE_FREE_ACCESS')) {
// redirect to login page if user is not logged in
$auth->login_if($auth->auth["uid"] == "nobody");
throw new AccessDeniedException();
}
}
$SessionSeminar = $course["Seminar_id"];
$SessSemName[0] = $course["Name"];
$SessSemName[1] = $course["Seminar_id"];
$SessSemName[3] = $course["Untertitel"];
$SessSemName[4] = $course["start_time"];
$SessSemName[5] = $course["Institut_id"];
$SessSemName["art_generic"] = _("Veranstaltung");
$SessSemName["class"] = "sem";
$SessSemName["art_num"] = $course["status"];
if ($SEM_TYPE[$row["status"]]["name"] == $SEM_TYPE_MISC_NAME) {
$SessSemName["art"] = _("Veranstaltung");
} else {
$SessSemName["art"] = $SEM_TYPE[$row["status"]]["name"];
}
$SessSemName["header_line"] = $course->getFullname();
$_SESSION['SessionSeminar'] =& $SessionSeminar;
$_SESSION['SessSemName'] =& $SessSemName;
URLHelper::addLinkParam('cid', $SessionSeminar);
// if the aux data is forced for this seminar forward all user that havent made an input to this site
if ($course["aux_lock_rule_forced"] && !$perm->have_studip_perm('tutor', $course["Seminar_id"]) && !in_array($_SERVER['PATH_INFO'], array('/course/members/additional_input', '/course/change_view'))) {
$statement = DBManager::get()->prepare("SELECT 1 FROM datafields_entries WHERE range_id = ? AND sec_range_id = ? LIMIT 1");
$statement->execute(array($GLOBALS['user']->id, $course["Seminar_id"]));
if (!$statement->rowCount()) {
header('location: ' . URLHelper::getURL('dispatch.php/course/members/additional_input'));
page_close();
die;
}
}
return true;
} else {
$SessionSeminar = null;
return false;
}
}
示例14: DEPRECATED_sf_header_redirect
function DEPRECATED_sf_header_redirect($url_location, $shutdown = true)
{
global $area;
$url_location = str_replace('&', '&', $url_location);
header('HTTP/1.1 302 Moved Temporarily');
header('Location:' . $url_location);
if ($shutdown) {
if ($area != 'logout') {
page_close();
}
exit;
}
}
示例15: del
function del($id, $act_as_admin = false, $quick = false)
{
global $sess, $mytrail, $auth;
if (!defined("DIRECTORY_NOTIFICATION_INC")) {
}
include "messages/directory_notification.inc";
rm_object((int) $id, true);
if ($act_as_admin) {
send_admin_notification($mytrail, LTMSG_TRAILDEL);
}
//TODO: add reason
if (!$quick) {
page_close();
include "directory/edit/del-confirmation.html";
exit;
} else {
page_close();
Header("Location: " . $sess->url(build_good_url(parent_path($mytrail['path']))));
}
}