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


PHP eF_redirect函数代码示例

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


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

示例1: session_cache_limiter

session_cache_limiter('none');
session_start();
//print_r($_SESSION);
$path = "../libraries/";
/** The configuration file.*/
require_once $path . "configuration.php";
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
try {
    $currentUser = EfrontUser::checkUserAccess();
    $smarty->assign("T_CURRENT_USER", $currentUser);
} catch (Exception $e) {
    eF_redirect("index.php?ctg=expired");
    exit;
}
if (G_VERSIONTYPE != 'community') {
    #cpp#ifndef COMMUNITY
    if (isset($_GET['fb_authenticated']) && $_GET['fb_authenticated'] == 1) {
        if ($GLOBALS['configuration']['facebook_api_key'] && $GLOBALS['configuration']['facebook_secret']) {
            if (EfrontFacebook::userConnected()) {
                new EfrontFacebook();
            }
        }
    }
    if (isset($_SESSION['facebook_user'])) {
        EfrontFacebook::setEfUser($_SESSION['facebook_user'], $_SESSION['s_login'], $_SESSION['facebook_details']['name']);
    }
}
开发者ID:kaseya-university,项目名称:efront,代码行数:30,代码来源:professorpage.php

示例2: refreshLogin

    try {
        //$currentUser = EfrontUserFactory :: factory($_SESSION['s_login']);
        $currentUser = EfrontUser::checkUserAccess();
        refreshLogin();
        //$_SESSION['last_action_timestamp'] = time();		//Keep the last time something happened to the session
        if ($accounts = unserialize($currentUser->user['additional_accounts'])) {
            $result = eF_getTableData("users", "login, user_type", 'login in ("' . implode('","', array_values($accounts)) . '")');
            $smarty->assign("T_MAPPED_ACCOUNTS", $result);
        }
    } catch (Exception $e) {
    }
}
if (isset($_GET['ctg']) && is_numeric($_GET['ctg'])) {
    //cheking a possible issue with search engine robots that overloads server
    if (empty($customBlocks) || in_array($_GET['ctg'], array_keys($customBlocks)) !== true) {
        eF_redirect("HTTP/1.0 404 Not Found");
    }
}
if (isset($_SESSION['s_login']) && $_SESSION['s_login']) {
    //This way, logged in users that stay on index.php are not logged out
    $loadScripts[] = 'sidebar';
}
$smarty->assign("T_MESSAGE", $message);
$smarty->assign("T_MESSAGE_TYPE", $message_type);
if (isset($search_message)) {
    $smarty->assign("T_SEARCH_MESSAGE", $search_message);
}
if (!$smarty->is_cached('index.tpl', $cacheId) || !$GLOBALS['configuration']['smarty_caching']) {
    foreach (eF_loadAllModules(true, true) as $module) {
        $module->onIndexPageLoad();
    }
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:index.php

示例3: checkWebserverAuthentication

 public static function checkWebserverAuthentication()
 {
     try {
         eval('$usernameVar=' . $GLOBALS['configuration']['username_variable'] . ';');
         if (!$usernameVar) {
             eF_redirect(G_SERVERNAME . $GLOBALS['configuration']['error_page'], true, 'top', true);
             exit;
         } else {
             try {
                 $user = EfrontUserFactory::factory($usernameVar);
                 if (!$_SESSION['s_login'] || $usernameVar != $_SESSION['s_login']) {
                     $user->login($user->user['password'], true);
                 }
             } catch (EfrontUserException $e) {
                 if ($e->getCode() == EfrontUserException::USER_NOT_EXISTS && $GLOBALS['configuration']['webserver_registration']) {
                     try {
                         include $GLOBALS['configuration']['registration_file'];
                         $user = EfrontUserFactory::factory($usernameVar);
                         if (!$_SESSION['s_login'] || $usernameVar != $_SESSION['s_login']) {
                             $user->login($user->user['password'], true);
                         }
                     } catch (Exception $e) {
                         eF_redirect(G_SERVERNAME . $GLOBALS['configuration']['unauthorized_page'], true, 'top', true);
                         exit;
                     }
                 } else {
                     eF_redirect(G_SERVERNAME . $GLOBALS['configuration']['unauthorized_page'], true, 'top', true);
                     exit;
                 }
             }
         }
     } catch (Exception $e) {
         eF_redirect(G_SERVERNAME . $GLOBALS['configuration']['unauthorized_page'], true, 'top', true);
         //header("location:".G_SERVERNAME.$GLOBALS['configuration']['unauthorized_page']);
     }
     return $user;
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:37,代码来源:user.class-backup.php

示例4: eF_redirect

 if (isset($_GET['add_topic']) || isset($_GET['del_topic']) || isset($_GET['edit_topic'])) {
     /* Check permissions: only professors are allowed to manage topics */
     if ($currentUser->getType() != 'professor') {
         eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=personal&message=" . urlencode(_SORRYYOUDONOTHAVEPERMISSIONTOPERFORMTHISACTION) . "&message_type=failure");
         exit;
     }
     // ON DELETING A LESSONTIMELINE TOPIC
     if (isset($_GET['del_topic']) && eF_checkParameter($_GET['del_topic'], 'id')) {
         //The administrator asked to delete a skill
         //@todo: delete events too?
         //eF_deleteTableData("lessons_timeline_topics", "type = " . . "  AND lessons_ID = ". ." AND entity_ID = '".$_GET['del_topic']."'");
         eF_deleteTableData("lessons_timeline_topics_data", "topics_ID = '" . $_GET['del_topic'] . "'");
         eF_deleteTableData("lessons_timeline_topics", "id = '" . $_GET['del_topic'] . "'");
         $message = _LESSONTIMELINETOPICDELETED;
         $message_type = 'success';
         eF_redirect("" . $_SESSION['s_type'] . ".php?ctg=social&op=timeline&lessons_ID=" . $_GET['lessons_ID'] . "&all=1&message=" . $message . "&message_type=" . $message_type);
         exit;
         //ON INSERTING OR EDITING A LESSONTIMELINE TOPIC
     } else {
         if (isset($_GET['add_topic']) || isset($_GET['edit_topic'])) {
             if (isset($_GET['add_topic'])) {
                 $form = new HTML_QuickForm("topic_form", "post", $_SESSION['s_type'] . ".php?ctg=social&op=timeline&lessons_ID=" . $_SESSION['s_lessons_ID'] . "&add_topic=1", "", null, true);
             } elseif (eF_checkParameter($_GET['edit_topic'], 'id')) {
                 $form = new HTML_QuickForm("topic_form", "post", $_SESSION['s_type'] . ".php?ctg=social&op=timeline&lessons_ID=" . $_SESSION['s_lessons_ID'] . "&edit_topic=" . $_GET['edit_topic'], "", null, true);
                 $topic = eF_getTableData("lessons_timeline_topics", "title", "id ='" . $_GET['edit_topic'] . "'");
             }
             $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
             //Register this rule for checking user input with our function, eF_checkParameter
             $form->addElement('text', 'topic_description', _LESSONTIMELINETOPIC, 'id="topic_description" class = "inputText" tabindex="1"');
             $form->addRule('topic_description', _THEFIELD . ' ' . _LESSONTIMELINETOPIC . ' ' . _ISMANDATORY, 'required', null, 'client');
             // Hidden for maintaining the previous_url value
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:social.php

示例5: session_id

session_id($_COOKIE['parent_sid']);
session_start();
$path = "../../libraries/";
/** Configuration file.*/
include_once $path . "configuration.php";
//Access is not allowed to users that are not logged in
if (isset($_SESSION['s_login']) && $_SESSION['s_password']) {
    try {
        $currentUser = EfrontUserFactory::factory($_SESSION['s_login']);
    } catch (EfrontException $e) {
        $message = $e->getMessage() . ' (' . $e->getCode() . ')';
        eF_redirect("index.php?message=" . urlencode($message) . "&message_type=failure");
        exit;
    }
} else {
    eF_redirect("index.php?message=" . urlencode(_YOUCANNOTACCESSTHISPAGE) . "&message_type=failure");
    exit;
}
try {
    //There are 2 legal modes: 'lessons' and 'external'. In the first case, we read the legitimate directory from the session. In the second case, we take it from global constant
    if ($_GET['mode'] == 'lesson') {
        $currentLesson = new EfrontLesson($_SESSION['s_lessons_ID']);
        $rootDir = new EfrontDirectory($currentLesson->getDirectory());
        $filesBaseUrl = $currentLesson->getDirectoryUrl();
    } elseif ($_GET['mode'] == 'external') {
        $rootDir = new EfrontDirectory(G_EXTERNALPATH);
        $filesBaseUrl = G_EXTERNALURL;
    } elseif ($_GET['mode'] == 'upload') {
        $rootDir = new EfrontDirectory(G_UPLOADPATH . $_SESSION['s_login']);
        $filesBaseUrl = G_UPLOADPATH . $_SESSION['s_login'];
    } else {
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:browse.php

示例6: eF_redirect

                         if ($trackActivityInfo['success_status'] == 'failed') {
                             $iterator->current()->offsetset('failed', true);
                         }
                     }
                 }
                 if ($_student_) {
                     if ($iterator->current()->offsetGet('completed')) {
                         $currentUser->setSeenUnit($iterator->current(), $currentLesson, true);
                     } else {
                         $currentUser->setSeenUnit($iterator->current(), $currentLesson, false);
                     }
                 }
             }
             $scormState = $scoContent->checkControlsValidy();
             if ($navigation->end_sequencing_session == 'true') {
                 eF_redirect("" . basename($_SERVER['PHP_SELF']) . '?ctg=content&');
             }
             if (in_array($currentUnit['scorm_version'], EfrontContentTreeSCORM::$scorm2004Versions)) {
                 $scormVersion = '1.3';
             } else {
                 $scormVersion = '1.2';
             }
         } catch (Exception $e) {
             //pr($e);
             unset($_GET['view_unit']);
             $smarty->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
             $message = $e->getMessage() . ' (' . $e->getCode() . ') &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
             $message_type = 'failure';
         }
     }
 }
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:common_content.php

示例7: array

* @package eFront
* @version 3.6.0
*/
//This file cannot be called directly, only included.
if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) {
    exit;
}
$redirectPage = $GLOBALS['configuration']['login_redirect_page'];
//$centerLinkInfo = $module -> getCenterLinkInfo();
if (array_key_exists($GLOBALS['configuration']['login_redirect_page'], $loadedModules)) {
    //in case module is inactive
    $InnertableHTML = $loadedModules[$redirectPage]->getLandingPageModule();
    $InnertableHTML === true ? $module_smarty_file = $loadedModules[$redirectPage]->getLandingPageSmartyTpl() : ($module_smarty_file = false);
    // If the module has a lesson innertable
    if ($InnertableHTML) {
        // Get module html - two ways: pure HTML or PHP+smarty
        // If no smarty file is defined then false will be returned
        if ($module_smarty_file) {
            // Execute the php code -> The code has already been executed by above (**HERE**)
            // Let smarty know to include the module smarty file
            $innertable_module[$redirectPage] = array('smarty_file' => $module_smarty_file);
        } else {
            // Present the pure HTML cod
            $innertable_module[$redirectPage] = array('html_code' => $InnertableHTML);
        }
    }
    //pr($innertable_module);
    $smarty->assign("T_INNERTABLE_MODULE", $innertable_module);
} else {
    eF_redirect($_SESSION['s_type'] . ".php");
}
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:landing_page.php

示例8: redirect

 public function redirect($url)
 {
     if ($this->in_fb_canvas()) {
         echo '<fb:redirect url="' . $url . '"/>';
     } else {
         if (preg_match('/^https?:\\/\\/([^\\/]*\\.)?facebook\\.com(:\\d+)?/i', $url)) {
             // make sure facebook.com url's load in the full frame so that we don't
             // get a frame within a frame.
             echo "<script type=\"text/javascript\">\ntop.location.href = \"{$url}\";\n</script>";
         } else {
             eF_redirect(' ' . $url);
         }
     }
     exit;
 }
开发者ID:bqq1986,项目名称:efront,代码行数:15,代码来源:facebook.php

示例9: EfrontBranch

                    //if supervisors can't see unassigned users, then attach this new user to the supervisor's firts branch and job
                    $branch = new EfrontBranch(current($currentEmployee->getSupervisedBranchesRecursive()));
                    $nospecific = false;
                    foreach ($branch->getJobDescriptions() as $value) {
                        if ($value['description'] == _NOSPECIFICJOB) {
                            $nospecific = $value['job_description_ID'];
                        }
                    }
                    if (!$nospecific) {
                        $nospecific = EfrontJob::createJob(array('description' => _NOSPECIFICJOB, 'branch_ID' => $branch->branch['branch_ID']));
                    }
                    $editedEmployee->addJob($editedUser, $nospecific, $branch->branch['branch_ID'], 0);
                }
            }
        }
        #cpp#endif
        if (isset($_SESSION['missing_fields'])) {
            unset($_SESSION['missing_fields']);
            loginRedirect($editedUser->user['user_type'], urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY . $ldapMessage), 'success');
        } else {
            if ($editedUser->user['user_type'] == 'administrator' || !isset($_GET['add_user'])) {
                eF_redirect($_SERVER['PHP_SELF'] . "?ctg=personal&user=" . $editedUser->user['login'] . "&op=profile&message=" . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY . $ldapMessage) . "&message_type=success");
            } else {
                eF_redirect($_SERVER['PHP_SELF'] . "?ctg=personal&user=" . $editedUser->user['login'] . "&op=user_courses&message=" . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY . $ldapMessage) . "&message_type=success");
            }
        }
    } catch (Exception $e) {
        handleNormalFlowExceptions($e);
    }
}
$smarty->assign("T_PROFILE_FORM", $form->toArray());
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:profile-backup-20140629.php

示例10: getModule


//.........这里部分代码省略.........
             $form->addElement('submit', 'submit_recheck', _MODULE_SECURITY_RECHECKFILES, 'class = "flatButton" ');
             $form->addElement('submit', 'reset_ignore_list', _MODULE_SECURITY_RESETIGNORELIST, 'class = "flatButton" ');
             $form->addElement('submit', 'ignore_changed_all', _MODULE_SECURITY_IGNOREALL, 'class = "flatButton" ');
             break;
         case 'new_files':
             list($changed_files, $new_files) = $this->checksumCheck();
             if (isset($_GET['download']) && in_array($_GET['download'], array_keys($new_files)) && $_GET['download'] != 'libraries/configuration.php') {
                 try {
                     $file = new EfrontFile(G_ROOTPATH . $_GET['download']);
                     $file->sendFile(true);
                     exit;
                 } catch (Exception $e) {
                     $this->setMessageVar(_MODULE_SECURITY_FILECOULDNOTBEDELETED, 'failure');
                 }
             } else {
                 if (isset($_GET['ignore']) && in_array($_GET['ignore'], array_keys($new_files))) {
                     $this->addToIgnoreList($_GET['ignore']);
                 } else {
                     if (isset($_GET['delete']) && in_array($_GET['delete'], array_keys($new_files))) {
                         try {
                             $file = new EfrontFile(G_ROOTPATH . $_GET['delete']);
                             $file->delete();
                         } catch (Exception $e) {
                         }
                         $file = new EfrontFile($this->getLocalListName());
                         $file->delete();
                         list($changed_files, $new_files) = $this->checksumCheck();
                     }
                 }
             }
             $smarty->assign("T_NEW_FILES", $new_files);
             $form->addElement('submit', 'submit_recheck', _MODULE_SECURITY_RECHECKFILES, 'class = "flatButton" ');
             $form->addElement('submit', 'reset_ignore_list', _MODULE_SECURITY_RESETIGNORELIST, 'class = "flatButton" ');
             $form->addElement('submit', 'ignore_new_all', _MODULE_SECURITY_IGNOREALL, 'class = "flatButton" ');
             break;
         default:
             $smarty->assign("T_SECURITY_FEEDS", $this->getRssFeeds());
             try {
                 $smarty->assign("T_LOCAL_ISSUES", $this->checkLocalIssues());
             } catch (Exception $e) {
                 $this->setMessageVar($e->getMessage(), 'failure');
             }
             break;
     }
     if ($form->isSubmitted() && $form->validate()) {
         try {
             $values = $form->exportValues();
             if ($values['submit_recheck']) {
                 $file = new EfrontFile($this->getLocalListName());
                 $file->delete();
                 eF_redirect($this->moduleBaseUrl . '&type=' . $_GET['type'] . '&message=' . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . '&message_type=success');
             } else {
                 if ($values['submit_delete_install']) {
                     file_get_contents(G_SERVERNAME . 'index.php?delete_install=1');
                     eF_redirect($this->moduleBaseUrl . '&type=' . $_GET['type'] . '&message=' . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . '&message_type=success');
                 } else {
                     if ($values['submit_deactivate']) {
                         $result = eF_updateTableData("users", array('active' => 0), "(login = 'student' and password = '04aed36b7da8d1b5d8c892cf91486cdb') or (login = 'professor' and password = 'da18be534843cf9f9edd60c89de6a8e7')");
                         eF_redirect($this->moduleBaseUrl . '&message=' . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . '&message_type=success');
                     } else {
                         if ($values['reset_ignore_list']) {
                             try {
                                 $file = new EfrontFile($this->getIgnoreListName());
                                 $file->delete();
                                 eF_redirect($this->moduleBaseUrl . '&type=' . $_GET['type'] . '&message=' . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . '&message_type=success');
                             } catch (Exception $e) {
                                 $this->setMessageVar(_MODULE_SECURITY_THELISTISEMTPY, 'failure');
                             }
                         } else {
                             if ($values['ignore_new_all']) {
                                 list($changed_files, $new_files) = $this->checksumCheck();
                                 foreach ($new_files as $key => $value) {
                                     $this->addToIgnoreList($key);
                                 }
                                 eF_redirect($this->moduleBaseUrl . '&type=new_files&message=' . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . '&message_type=success');
                             } else {
                                 if ($values['ignore_changed_all']) {
                                     list($changed_files, $new_files) = $this->checksumCheck();
                                     foreach ($changed_files as $key => $value) {
                                         $this->addToIgnoreList($key);
                                     }
                                     eF_redirect($this->moduleBaseUrl . '&type=changed_files&message=' . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . '&message_type=success');
                                 }
                             }
                         }
                     }
                 }
             }
         } catch (Exception $e) {
             $smarty->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
             $message = $e->getMessage() . ' (' . $e->getCode() . ') &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
             $this->setMessageVar($message, 'failure');
         }
     }
     $renderer = prepareFormRenderer($form);
     $smarty->assign('T_SECURITY_FORM', $renderer->toArray());
     //$feeds = $this->getRssFeeds(true, false);
     //$smarty->assign("T_SECURITY_FEEDS", $feeds);
     return true;
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:101,代码来源:module_security.class.php

示例11: eF_redirect

     $loadScripts[] = 'includes/personal';
     $editedUser = EfrontUserFactory::factory($_GET['sel_user']);
     $editedEmployee = $editedUser->aspects['hcd'];
     include 'personal/user_form.php';
     //exit;
 }
 if ($currentUser->user['user_type'] != 'administrator' && $isSupervisor) {
     if ($currentUser->aspects['hcd']->supervisesEmployee($_GET['sel_user'])) {
         $validUsers[] = $_GET['sel_user'];
         $supervisesUser = 1;
     }
 }
 if (eF_local_canAccessUser()) {
     $infoUser = EfrontUserFactory::factory($_GET['sel_user']);
 } else {
     eF_redirect(basename($_SERVER['PHP_SELF']) . '?ctg=statistics&option=user&message=' . urlencode(_USERISNOTVALIDORYOUCANNOTSEEUSER . ": " . $_GET['sel_user']));
     exit;
 }
 if ($isSupervisor || $currentUser->user['user_type'] == 'administrator') {
     $smarty->assign("T_EDIT_USER_LINK", array(array('text' => _EDITUSER, 'image' => "16x16/edit.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=personal&user=" . $_GET['sel_user'])));
 }
 $directionsTree = new EfrontDirectionsTree();
 $directionsTreePaths = $directionsTree->toPathString();
 $smarty->assign("T_USER_LOGIN", $infoUser->user['login']);
 $smarty->assign("T_REPORTS_USER", $infoUser);
 if ($_GET['specific_lesson_info'] && $_GET['lesson']) {
     $lessons = $infoUser->getUserStatusInLessons($_GET['lesson']);
     $smarty->assign("T_USER_STATUS_IN_LESSON", $lessons[$_GET['lesson']]);
     $status = EfrontStats::getUsersLessonStatus($_GET['lesson'], $infoUser->user['login']);
     $doneTests = EfrontStats::getStudentsDoneTests($_GET['lesson'], $infoUser->user['login']);
     $feedbacks = eF_getTableDataFlat("tests t, content c", "t.id, t.content_ID", "c.id=t.content_ID and c.ctg_type='feedback'");
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:users_stats.php

示例12: getModule

 public function getModule()
 {
     $currentLesson = $this->getCurrentLesson();
     $smarty = $this->getSmartyVar();
     $smarty->assign("T_LESSON_ID", $currentLesson->lesson['id']);
     if (isset($_GET['delete_link']) && eF_checkParameter($_GET['delete_link'], 'id')) {
         eF_deleteTableData("module_links", "id=" . $_GET['delete_link']);
         $this->setMessageVar(_LINKS_SUCCESFULLYDELETEDLINK, 'success');
         eF_redirect("" . $this->moduleBaseUrl . "&message=" . urlencode($message) . "&message_type={$message_type}");
     } else {
         if (isset($_GET['add_link']) || isset($_GET['edit_link']) && eF_checkParameter($_GET['edit_link'], 'id')) {
             $form = new HTML_QuickForm("link_entry_form", "POST", $_SERVER['REQUEST_URI'], "");
             $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
             //Register this rule for checking user input with our function, eF_checkParameter
             $form->addElement('text', 'display', null);
             $form->addElement('text', 'link', null);
             $form->addElement('textarea', 'description', null);
             $form->addElement('submit', 'submit_link', _SUBMIT, 'class = "flatButton"');
             $element =& $form->getElement('display');
             $element->setSize(50);
             $element =& $form->getElement('link');
             $element->setSize(50);
             $element =& $form->getElement('description');
             $element->setCols(50);
             if (isset($_GET['edit_link'])) {
                 $link_entry = eF_getTableData("module_links", "*", "id=" . $_GET['edit_link']);
                 $form->setDefaults(array('display' => $link_entry[0]['display'], 'link' => $link_entry[0]['link'], 'description' => $link_entry[0]['description']));
             } else {
                 $form->setDefaults(array('link' => "http://"));
             }
             if ($form->isSubmitted() && $form->validate()) {
                 $fields = array('lessons_ID' => $_SESSION['s_lessons_ID'], 'display' => $form->exportValue('display'), 'link' => $form->exportValue('link'), 'description' => $form->exportValue('description'));
                 if (isset($_GET['edit_link'])) {
                     if (eF_updateTableData("module_links", $fields, "id=" . $_GET['edit_link'])) {
                         $message = _LINKS_SUCCESFULLYUPDATEDLINKENTRY;
                         $message_type = 'success';
                         eF_redirect("" . $_SERVER['PHP_SELF'] . "?ctg=module&op=module_links&message=" . urlencode($message) . "&message_type={$message_type}");
                     } else {
                         $message = _LINKS_PROBLEMUPDATINGLINKENTRY;
                         $message_type = 'failure';
                         eF_redirect("" . $_SERVER['PHP_SELF'] . "?ctg=module&op=module_links&message=" . urlencode($message) . "&message_type={$message_type}");
                     }
                 } else {
                     if (eF_insertTableData("module_links", $fields)) {
                         $message = _LINKS_SUCCESFULLYINSERTEDLINKENTRY;
                         $message_type = 'success';
                         eF_redirect("" . $_SERVER['PHP_SELF'] . "?ctg=module&op=module_links&message=" . urlencode($message) . "&message_type={$message_type}");
                     } else {
                         $message = _LINKS_PROBLEMINSERTINGLINKENTRY;
                         $message_type = 'failure';
                         eF_redirect("" . $_SERVER['PHP_SELF'] . "?ctg=module&op=module_links&message=" . urlencode($message) . "&message_type={$message_type}");
                     }
                 }
             }
             $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty);
             $form->accept($renderer);
             $smarty->assign('T_LINKS_FORM', $renderer->toArray());
         } else {
             $links = eF_getTableDataFlat("module_links", "*", "lessons_ID = " . $_SESSION['s_lessons_ID']);
             $smarty->assign("T_LINKS", $links);
         }
     }
     return true;
 }
开发者ID:bqq1986,项目名称:efront,代码行数:64,代码来源:module_links.class.php

示例13: elseif

}
//Create shorthands for user type, to avoid long variable names
//Create shorthands for user access rights, to avoid long variable names
$_change_ = 0;
if (!isset($currentUser->coreAccess['content']) || $currentUser->coreAccess['content'] == 'change') {
    $_change_ = 1;
} elseif (isset($currentUser->coreAccess['content']) && $currentUser->coreAccess['content'] == 'hidden') {
    eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
}
if (!isset($GLOBALS['currentLesson'])) {
    if (isset($_GET['lesson_info'])) {
        $currentLesson = new EfrontLesson($_GET['lesson_info']);
        $currentContent = new EfrontContentTree($currentLesson);
        $smarty->assign("T_CURRENT_LESSON", $currentLesson);
    } else {
        eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . rawurlencode(_INVALIDID) . "&message_type=failure");
    }
}
if ($_GET['edit_info'] && $_change_ && !$_student_) {
    $form = new HTML_QuickForm("empty_form", "post", null, null, null, true);
    try {
        $lessonInformation = unserialize($currentLesson->lesson['info']);
        $information = new LearningObjectInformation($lessonInformation);
        if (!isset($currentUser->coreAccess['content']) || $currentUser->coreAccess['content'] == 'change') {
            $smarty->assign("T_LESSON_INFO_HTML", $information->toHTML($form, false));
        } else {
            $smarty->assign("T_LESSON_INFO_HTML", $information->toHTML($form, false, false));
        }
        $lessonMetadata = unserialize($currentLesson->lesson['metadata']);
        $metadata = new DublinCoreMetadata($lessonMetadata);
        if (!isset($currentUser->coreAccess['content']) || $currentUser->coreAccess['content'] == 'change') {
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:lesson_information.php

示例14: elseif

     /***/
     require_once "ims.php";
 } elseif ($ctg == 'tincan') {
     $_SESSION['s_lessons_ID'] or eF_redirect(basename($_SERVER['PHP_SELF']));
     /***/
     require_once "tincan.php";
 } elseif ($ctg == 'lesson_information') {
     $_SESSION['s_lessons_ID'] or eF_redirect(basename($_SERVER['PHP_SELF']));
     /***/
     require_once "lesson_information.php";
 } elseif ($ctg == 'news') {
     //$_SESSION['s_lessons_ID'] OR eF_redirect(basename($_SERVER['PHP_SELF']));		//Commented out so that dashboard news links are working
     /***/
     include "news.php";
 } elseif ($ctg == 'progress') {
     $_SESSION['s_lessons_ID'] or eF_redirect(basename($_SERVER['PHP_SELF']));
     /***/
     require_once "progress.php";
 } elseif ($ctg == 'module_hcd') {
     include "module_hcd.php";
 } elseif ($ctg == "emails") {
     include "emails.php";
 } elseif ($ctg == 'users') {
     $_GET['op'] = "employees";
     include "module_hcd.php";
 } elseif ($ctg == 'evaluations') {
     /**This part is used to display the evaluations that have been written for the employee*/
     // Administrators and supervisors will see all evaluations for the employee while employee-professors will see only their own
     if (eF_checkParameter($_GET['user'], 'login')) {
         if ($_SESSION['s_type'] == "administrator" || $_SESSION['employee_type'] == _SUPERVISOR) {
             $evaluations = eF_getTableData("module_hcd_events", "*", "users_login = '" . $_GET['user'] . "' AND event_code >=10", "timestamp");
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:professor.php

示例15: eF_getTableData

     $form->addElement('submit', 'submit_poll', _VOTE, 'class = "flatButton"');
     if ($form->isSubmitted() && $form->validate()) {
         $values = $form->exportValues();
         //pr($values);
         //debug();
         $res = eF_getTableData("f_users_to_polls", "*", "f_poll_ID=" . $values['options']['vote'] . " and users_LOGIN='" . $currentUser->user['login'] . "'");
         //debug(false);
         if (sizeof($res) > 0) {
             $message = _YOUHAVEALREADYVOTED;
             $message_type = 'failure';
         } else {
             $fields = array('f_poll_ID' => $_GET['poll'], 'users_LOGIN' => $_SESSION['s_login'], 'vote' => $values['options']['vote'], 'timestamp' => time());
             if (eF_insertTableData("f_users_to_polls", $fields)) {
                 $message = _SUCCESFULLYVOTED;
                 $message_type = 'success';
                 eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=forum&poll=" . $_GET['poll']);
             } else {
                 $message = _SOMEPROBLEMEMERGED;
                 $message_type = 'failure';
             }
         }
     }
     $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty);
     //Create a smarty renderer
     $form->accept($renderer);
     //Assign this form to the renderer, so that corresponding template code is created
     $smarty->assign('T_POLL_FORM', $renderer->toArray());
     //Assign the form to the template
     $smarty->assign("T_POLL", $poll_data[0]);
 } else {
     if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) {
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:forum.php


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