本文整理汇总了PHP中redirect_to_home_page函数的典型用法代码示例。如果您正苦于以下问题:PHP redirect_to_home_page函数的具体用法?PHP redirect_to_home_page怎么用?PHP redirect_to_home_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了redirect_to_home_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_edit_form
function show_edit_form($id, $sid, $assign)
{
global $m, $langGradeOk, $tool_content, $course_code;
$sub = Database::get()->querySingle("SELECT * FROM assignment_submit WHERE id = ?d", $sid);
if (count($sub) > 0) {
$uid_2_name = display_user($sub->uid);
if (!empty($sub->group_id)) {
$group_submission = "({$m['groupsubmit']} " . "<a href='../group/group_space.php?course={$course_code}&group_id={$sub->group_id}'>" . "{$m['ofgroup']} " . gid_to_name($sub->group_id) . "</a>)";
} else {
$group_submission = '';
}
$tool_content .= "\n <form method='post' action='index.php?course={$course_code}'>\n <input type='hidden' name='assignment' value='{$id}'>\n <input type='hidden' name='submission' value='{$sid}'>\n <fieldset>\n <legend>{$m['addgradecomments']}</legend>\n <table width='99%' class='tbl'>\n <tr>\n <th class='left' width='180'>{$m['username']}:</th>\n <td>{$uid_2_name} " . q($group_submission) . "</td>\n </tr>\n <tr>\n <th class='left'>{$m['sub_date']}:</th>\n <td>" . q($sub->submission_date) . "</td></tr>\n <tr>\n <th class='left'>{$m['filename']}:</th>\n <td><a href='index.php?course={$course_code}&get={$sub->id}'>" . q($sub->file_name) . "</a></td>\n </tr>\n <tr>\n <th class='left'>{$m['grade']}:</th>\n <td><input type='text' name='grade' maxlength='3' size='3' value='" . q($sub->grade) . "'></td></tr>\n <tr>\n <th class='left'>{$m['gradecomments']}:</th>\n <td><textarea cols='60' rows='3' name='comments'>" . q($sub->grade_comments) . "</textarea></td>\n </tr>\n <tr>\n <th><label for='email_button'>{$m['email_users']}:</label></th>\n <td><input type='checkbox' value='1' id='email_button' name='email'></td>\n </tr>\n <tr>\n <th class='left'> </th>\n <td><input class='btn btn-primary' type='submit' name='grade_comments' value='{$langGradeOk}'></td>\n </tr>\n </table>\n </fieldset>\n </form><br>";
} else {
Session::Messages($m['WorkNoSubmission'], 'alert-danger');
redirect_to_home_page('modules/work/index.php?course=' . $course_code . '&id=' . $id);
}
}
示例2: elseif
}
}
$auth_user_info['email'] = $_SESSION['shib_email'];
$uname = $_SESSION['shib_uname'];
$is_valid = true;
} elseif ($is_submit or $auth == 7 and !$submit) {
unset($_SESSION['was_validated']);
if ($auth != 7 and $auth != 6 and ($uname === '' or $passwd === '')) {
$tool_content .= "<div class='alert alert-danger'>{$ldapempty} {$errormessage}</div>";
draw($tool_content, 0);
exit;
} else {
// try to authenticate user
$auth_method_settings = get_auth_settings($auth);
if ($auth == 6) {
redirect_to_home_page('secure/index_reg.php' . ($prof ? '?p=1' : ''));
}
$is_valid = auth_user_login($auth, $uname, $passwd, $auth_method_settings);
}
if ($auth == 7) {
if (phpCAS::checkAuthentication()) {
$uname = phpCAS::getUser();
$cas = get_auth_settings($auth);
// store CAS released attributes in $GLOBALS['auth_user_info']
get_cas_attrs(phpCAS::getAttributes(), $cas);
if (!empty($uname)) {
$is_valid = true;
}
}
}
}
示例3: redirect_to_home_page
}, $auth_settings, $auth_instructions, $auth_title, $auth);
if ($result) {
if ($result->affectedRows == 1) {
$tool_content .= "<div class='alert alert-success'>$langHasActivate</div>";
} else {
$tool_content .= "<div class='alert alert-warning'>$langAlreadyActiv</div>";
}
}
}
}
} else {
// handle reloads on auth_process.php after authentication check
// also handles requests with empty $auth
// without this, a form with just username/password is displayed
if (!$auth) {
redirect_to_home_page('modules/admin/auth.php');
}
$pageName = get_auth_info($auth);
// get authentication settings
if ($auth != 6) {
$auth_data = get_auth_settings($auth);
}
// display form
$tool_content .= "<div class='form-wrapper'>
<form class='form-horizontal' name='authmenu' method='post' action='$_SERVER[SCRIPT_NAME]'>
<fieldset>
<input type='hidden' name='auth' value='" . intval($auth) . "'>";
if (!empty($_SESSION['cas_warn']) && $_SESSION['cas_do']) {
示例4: redirect_to_home_page
}
}
// Visibility commands
if (isset($_GET['mkVisibl']) || isset($_GET['mkInvisibl'])) {
if (isset($_GET['mkVisibl'])) {
$newVisibilityStatus = 1;
$visibilityPath = $_GET['mkVisibl'];
} else {
$newVisibilityStatus = 0;
$visibilityPath = $_GET['mkInvisibl'];
}
Database::get()->query("UPDATE document SET visible=?d\n WHERE {$group_sql} AND\n path = ?s", $newVisibilityStatus, $visibilityPath);
$r = Database::get()->querySingle("SELECT id FROM document WHERE {$group_sql} AND path = ?s", $visibilityPath);
Indexer::queueAsync(Indexer::REQUEST_STORE, Indexer::RESOURCE_DOCUMENT, $r->id);
Session::Messages($langViMod, 'alert-success');
redirect_to_home_page("modules/document/index.php?course={$course_code}");
}
// Public accessibility commands
if (isset($_GET['public']) || isset($_GET['limited'])) {
$new_public_status = intval(isset($_GET['public']));
$path = isset($_GET['public']) ? $_GET['public'] : $_GET['limited'];
Database::get()->query("UPDATE document SET public = ?d\n WHERE {$group_sql} AND\n path = ?s", $new_public_status, $path);
$r = Database::get()->querySingle("SELECT id FROM document WHERE {$group_sql} AND path = ?s", $path);
Indexer::queueAsync(Indexer::REQUEST_STORE, Indexer::RESOURCE_DOCUMENT, $r->id);
$action_message = "<div class='alert alert-success'>{$langViMod}</div>";
}
}
// teacher only
// Common for teachers and students
// define current directory
// Check if $var is set and return it - if $is_file, then return only dirname part
示例5: intval
start_date = ?t,
finish_date = ?t,
keywords = '',
created = " . DBHelper::timeAfter() . ",
glossary_expand = 0,
glossary_index = 1,
description = ?s",
$code, $language, $title, $_POST['formvisible'],
intval($course_license), $prof_names, $code, $doc_quota * 1024 * 1024,
$video_quota * 1024 * 1024, $group_quota * 1024 * 1024,
$dropbox_quota * 1024 * 1024, $password, $view_type,
$_POST['start_date'], $_POST['finish_date'], $description);
$new_course_id = $result->lastInsertID;
if (!$new_course_id) {
Session::Messages($langGeneralError);
redirect_to_home_page('modules/create_course/create_course.php');
}
//===================course format and start and finish date===============
if ($view_type == "weekly") {
//get the last inserted id as the course id
$course_id = $new_course_id;
$begin = new DateTime($_POST['start_date']);
//check if there is no end date
if ($_POST['finish_date'] == "" || $_POST['finish_date'] == '0000-00-00') {
$end = new DateTime($begin->format("Y-m-d"));
$end->add(new DateInterval('P26W'));
} else {
示例6: foreach
// indexing was previously on, but now set to off, need to empty it
if (get_config('enable_indexing') && !$enable_indexing) {
require_once 'modules/search/indexer.class.php';
Indexer::deleteAll();
}
// update table `config`
foreach ($config_vars as $varname => $what) {
set_config($varname, $GLOBALS[$varname]);
}
// Display result message
Session::flash('scheduleIndexing', $scheduleIndexing);
Session::Messages($langFileUpdatedSuccess, 'alert-success');
redirect_to_home_page('modules/admin/eclassconf.php');
} // end of if($submit)
else {
// Display config.php edit form
$head_content .= "
<script>
$(function() {
$('body').scrollspy({ target: '#affixedSideNav' });
});
</script>
";
// Display link to index.php
$tool_content .= action_bar(array(
array('title' => $langBack,
'url' => "index.php",
示例7: redirect_to_home_page
}
}
if (isset($require_departmentmanage_user) && $require_departmentmanage_user) {
if (!($is_admin or $is_departmentmanage_user)) {
$toolContent_ErrorExists = $langCheckDepartmentManageUser;
}
}
if (!isset($guest_allowed) || $guest_allowed != true) {
if (check_guest()) {
$toolContent_ErrorExists = $langCheckGuest;
}
}
if (isset($_SESSION['mail_verification_required']) && !isset($mail_ver_excluded)) {
// don't redirect to mail verification on logout
if (!isset($_GET['logout'])) {
redirect_to_home_page('modules/auth/mail_verify_change.php');
}
}
// Restore saved old_dbname function
function restore_dbname_override($do_unset = false)
{
if (defined('old_dbname')) {
$_SESSION['dbname'] = old_dbname;
} elseif ($do_unset) {
unset($_SESSION['dbname']);
}
}
// Temporary dbname override
if (isset($_GET['course'])) {
if (isset($_SESSION['dbname'])) {
define('old_dbname', $_SESSION['dbname']);
示例8: add_event
}
$ev = add_event($event_title, $content, $startdate, $duration, $recursion);
foreach($ev['event'] as $id) {
$agdx->store($id);
}
}
Session::Messages($langStoredOK, 'alert-success');
redirect_to_home_page("modules/agenda/index.php?course=$course_code");
} elseif (isset($_GET['delete']) && $_GET['delete'] == 'yes') {
$resp = (isset($_GET['rep']) && $_GET['rep'] == 'yes')? delete_recursive_event($id):delete_event($id);
$agdx->remove($id);
$msgresp = ($resp['success'])? $langDeleteOK : $langDeleteError.": ".$resp['message'];
$alerttype = ($resp['success'])? 'alert-success' : 'alert-error';
Session::Messages($msgresp, $alerttype);
redirect_to_home_page("modules/agenda/index.php?course=$course_code");
}
$is_recursive_event = false;
if (isset($_GET['addEvent']) or isset($_GET['edit'])) {
$pageName = $langAddEvent;
$tool_content .= action_bar(array(
array('title' => $langBack,
'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code",
'icon' => 'fa-reply',
'level' => 'primary-label',
'show' => $is_editor)));
$navigation[] = array("url" => $_SERVER['SCRIPT_NAME'] . "?course=$course_code", "name" => $langAgenda);
$applytogroup = '';
if (isset($id) && $id) {
$myrow = Database::get()->querySingle("SELECT * FROM agenda WHERE course_id = ?d AND id = ?d", $course_id, $id);
示例9: redirect_to_home_page
redirect_to_home_page("modules/exercise/question_pool.php?course={$course_code}" . (isset($fromExercise) ? "&fromExercise={$fromExercise}" : "") . "&exerciseId={$exerciseId}");
} elseif (isset($_GET['recup']) && isset($fromExercise)) {
$recup = intval($_GET['recup']);
// construction of the Question object
$objQuestionTmp = new Question();
// if the question exists
if ($objQuestionTmp->read($recup)) {
// adds the exercise ID into the list of exercises for the current question
$objQuestionTmp->addToList($fromExercise);
}
// destruction of the Question object
unset($objQuestionTmp);
// adds the question ID into the list of questions for the current exercise
$objExercise->addToList($recup);
Session::Messages($langQuestionReused, 'alert-success');
redirect_to_home_page("modules/exercise/question_pool.php?course={$course_code}" . (isset($fromExercise) ? "&fromExercise={$fromExercise}" : "") . "&exerciseId={$exerciseId}");
}
if (isset($fromExercise)) {
$action_bar_options[] = array('title' => $langGoBackToEx, 'url' => "admin.php?course={$course_code}&exerciseId={$fromExercise}", 'icon' => 'fa-reply', 'level' => 'primary-label');
} else {
$action_bar_options = array(array('title' => $langNewQu, 'url' => "admin.php?course={$course_code}&newQuestion=yes", 'icon' => 'fa-plus-circle', 'level' => 'primary-label', 'button-class' => 'btn-success'), array('title' => $langImportQTI, 'url' => "admin.php?course={$course_code}&importIMSQTI=yes", 'icon' => 'fa-download', 'level' => 'primary-label', 'button-class' => 'btn-success'), array('title' => $langExportQTI, 'url' => "question_pool.php?" . $_SERVER['QUERY_STRING'] . "&exportIMSQTI=yes", 'icon' => 'fa-upload', 'level' => 'primary-label', 'button-class' => 'btn-success'));
}
$tool_content .= action_bar($action_bar_options);
if (isset($fromExercise)) {
$result = Database::get()->queryArray("SELECT id, title FROM `exercise` WHERE course_id = ?d AND id <> ?d ORDER BY id", $course_id, $fromExercise);
} else {
$result = Database::get()->queryArray("SELECT id, title FROM `exercise` WHERE course_id = ?d ORDER BY id", $course_id);
}
$exercise_options = "<option value = '0'>-- {$langAllExercises} --</option>\n\n <option value = '-1' " . (isset($exerciseId) && $exerciseId == -1 ? "selected='selected'" : "") . ">-- {$langOrphanQuestions} --</option>\n";
foreach ($result as $row) {
$exercise_options .= "\n <option value='" . $row->id . "' " . (isset($exerciseId) && $exerciseId == $row->id ? "selected='selected'" : "") . ">{$row->title}</option>\n";
示例10: deleteUser
// for real uids not equal to admin
if ($u !== false && $u > 1) {
// full deletion
$success = deleteUser($u, true);
// progress report
if ($success === true) {
Session::Messages("{$langUserWithId} {$line} {$langWasDeleted}", 'alert-success');
redirect_to_home_page('modules/admin/multideluser.php');
} else {
Session::Messages("{$langErrorDelete}: {$line}", 'alert-danger');
redirect_to_home_page('modules/admin/multideluser.php');
}
}
}
}
redirect_to_home_page('modules/admin/multideluser.php');
} else {
$usernames = '';
if (isset($_POST['dellall_submit'])) {
// get the incoming values
$search = isset($_POST['search']) ? $_POST['search'] : '';
$c = isset($_POST['c']) ? intval($_POST['c']) : '';
$lname = isset($_POST['lname']) ? $_POST['lname'] : '';
$fname = isset($_POST['fname']) ? $_POST['fname'] : '';
$uname = isset($_POST['uname']) ? canonicalize_whitespace($_POST['uname']) : '';
$am = isset($_POST['am']) ? $_POST['am'] : '';
$verified_mail = isset($_POST['verified_mail']) ? intval($_POST['verified_mail']) : 3;
$user_type = isset($_POST['user_type']) ? $_POST['user_type'] : '';
$auth_type = isset($_POST['auth_type']) ? $_POST['auth_type'] : '';
$email = isset($_POST['email']) ? mb_strtolower(trim($_POST['email'])) : '';
$reg_flag = isset($_POST['reg_flag']) ? intval($_POST['reg_flag']) : '';
示例11: array
</div>
</form>
</div>";
} else {
if (isset($_SESSION['uid']) and $_GET['u'] == $_SESSION['uid']) {
$q = Database::get()->query("DELETE from course_user
WHERE course_id = ?d
AND user_id = ?d", $cid, $_GET['u']);
if ($q->affectedRows > 0) {
Log::record($cid, MODULE_ID_USERS, LOG_DELETE, array('uid' => $_GET['u'],
'right' => 0));
$code = course_id_to_code($cid);
// clear session access to lesson
unset($_SESSION['dbname']);
unset($_SESSION['cid_tmp']);
unset($_SESSION['courses'][$code]);
Session::Messages($langCoursDelSuccess, 'alert-success');
redirect_to_home_page('main/portfolio.php');
} else {
$tool_content .= "<div class='alert alert-danger'>$langCoursError</div>";
}
}
$tool_content .= "<br><br><div align=right><a href='../index.php' class=mainpage>$langBack</a></div>";
}
if (isset($_SESSION['uid'])) {
draw($tool_content, 1);
} else {
draw($tool_content, 0);
}
示例12: catch
} catch (Exception $ex) {
require_once 'include/not_installed.php';
}
if (isset($language)) {
// Old-style config.php, redirect to upgrade
$language = langname_to_code($language);
if (isset($_SESSION['langswitch'])) {
$_SESSION['langswitch'] = langname_to_code($_SESSION['langswitch']);
}
$session = new Session();
$uid = $session->user_id;
if (!isset($active_ui_languages)) {
$active_ui_languages = array('el');
}
if (!defined('UPGRADE')) {
redirect_to_home_page('upgrade/');
}
} else {
// Global configuration
$siteName = get_config('site_name');
$Institution = get_config('institution');
$InstitutionUrl = get_config('institution_url');
$urlServer = get_config('base_url');
$urlSecure = get_config('secure_url');
if (empty($urlSecure)) {
$urlSecure = $urlServer;
}
$session = new Session();
$uid = $session->user_id;
$language = $session->language;
}
示例13: commenting_add_js
if ($comments_enabled) {
if ($post->getCommenting() == 1) {
commenting_add_js(); //add js files needed for comments
$comm = new Commenting('blogpost', $post->getId());
if ($blog_type == 'course_blog') {
$tool_content .= $comm->put($course_code, $is_editor, $uid, true);
} elseif ($blog_type == 'perso_blog') {
$tool_content .= $comm->put(NULL, $is_blog_editor, $uid, true);
}
}
}
} else {
Session::Messages($langBlogPostNotFound);
redirect_to_home_page("modules/blog/index.php?$url_params");
}
}
//show all blog posts
if ($action == "showBlog") {
if ($blog_type == 'course_blog') {
$allow_to_create = $blog->permCreate($is_editor, $stud_allow_create, $uid);
} elseif ($blog_type == 'perso_blog') {
$allow_to_create = $is_blog_editor;
}
$tool_content .= action_bar(array(
array('title' => $langBlogAddPost,
'url' => "$_SERVER[SCRIPT_NAME]?$url_params&action=createPost",
'icon' => 'fa-plus-circle',
示例14: urlencode
<div class='col-sm-offset-3 col-sm-9'>
<input class='btn btn-primary' type='submit' name='changePass' value='$langModify'>
<a class='btn btn-default' href='{$urlServer}modules/admin/edituser.php?u=" . urlencode($_REQUEST['userid']) . "'>$langCancel</a>
</div>
</fieldset>
". generate_csrf_token_form_field() ."
</form>
</div>";
} else {
$userid = intval($_POST['userid']);
if (!isset($_POST['token']) || !validate_csrf_token($_POST['token'])) csrf_token_error();
if (empty($_POST['password_form']) || empty($_POST['password_form1'])) {
Session::Messages($langFieldsMissing);
redirect_to_home_page("modules/admin/password.php?userid=" . urlencode($userid));
}
if ($_POST['password_form1'] !== $_POST['password_form']) {
Session::Messages($langPassTwo);
redirect_to_home_page("modules/admin/password.php?userid=" . urlencode($userid));
}
// All checks ok. Change password!
$hasher = new PasswordHash(8, false);
$new_pass = $hasher->HashPassword($_POST['password_form']);
Database::get()->query("UPDATE `user` SET `password` = ?s WHERE `id` = ?d", $new_pass, $userid);
Session::Messages($langPassChanged);
redirect_to_home_page("modules/admin/edituser.php?u=" . urlencode($userid));
}
draw($tool_content, 3, null, $head_content);
示例15: foreach
foreach ($hits2 as $hit2) {
if (in_array($hit2->pkid, $subscribed)) {
$hits3[] = $hit2;
}
}
$hits = array_merge($hits1, $hits3);
// eponymous user can also search for his subscribed courses
}
} else {
$hits = $hits1;
// anonymous can only access with visible 1 or 2
}
// exit if not results
if (count($hits) <= 0) {
Session::Messages($langNoResult);
redirect_to_home_page('modules/search/search.php');
}
//////// PRINT RESULTS ////////
$tool_content .= action_bar(array(array('title' => $langNewSearch, 'url' => "search.php", 'icon' => 'fa-plus-circle', 'level' => 'primary-label', 'button-class' => 'btn-success')));
$tool_content .= "\n <div class='alert alert-info'>{$langDoSearch}: <label>" . count($hits) . " {$langResults2}</label></div>\n <table class='table-default'>\n <tr> \n <th class='text-left'>" . $langCourse . " ({$langCode})</th>\n <th class='text-left'>{$langTeacher}</th>\n <th class='text-left'>{$langKeywords}</th>\n </tr>";
foreach ($hits as $hit) {
$course = Database::get()->querySingle("SELECT code, title, public_code, prof_names, keywords FROM course WHERE id = ?d", $hit->pkid);
// search in-course: Commented out @ 2014-11-24 because too costly to run 11 index sub-queries for each hit result
$urlParam = '';
//if (isset($_POST['search_terms']) && search_in_course($_POST['search_terms'], $hit->pkid, $anonymous)) {
// $urlParam = '?from_search=' . urlencode($_POST['search_terms']);
//}
$tool_content .= "<tr><td>\n <a href='../../courses/" . q($course->code) . "/" . $urlParam . "'>" . q($course->title) . "\n </a> (" . q($course->public_code) . ")</td>\n <td>" . q($course->prof_names) . "</td>\n <td>" . q($course->keywords) . "</td></tr>";
}
$tool_content .= "</table>";
draw($tool_content, 0);