/** * Replaces occurences of the form #filter:user_login-xxxxx# with a personal message link */ function smarty_outputfilter_eF_template_loginToMessageLink($compiled, &$smarty) { $access = false; if (!$GLOBALS['currentUser']->coreAccess['personal_messages'] || $GLOBALS['currentUser']->coreAccess['personal_messages'] == 'change') { $access = true; } if (!EfrontUser::isOptionVisible('messages_student') && $_SESSION['s_type'] == "student") { $access = false; } if (!EfrontUser::isOptionVisible('messages')) { $access = false; } if ($access) { $new = preg_replace("/#filter:user_login-(.*)#/U", "<span style = \"white-space:nowrap;font-weight:bold\"><a href = \"" . basename($_SERVER['PHP_SELF']) . "?ctg=messages&add=1&recipient=\$1&popup=1\" onclick = \"eF_js_showDivPopup(event, '" . _NEWMESSAGE . "', 2)\" title=\"\\1\" target = \"POPUP_FRAME\">#filter:login-\$1#</a></span>", $compiled); $new = preg_replace("/#filter:user_loginNoIcon-(.*)#/U", "<a href = \"" . basename($_SERVER['PHP_SELF']) . "?ctg=messages&add=1&recipient=\$1&popup=1\" onclick = \"eF_js_showDivPopup(event, '" . _NEWMESSAGE . "', 2)\" title=\"\\1\" target = \"POPUP_FRAME\">#filter:login-\\1#</a>", $new); $compiled = $new; } else { $new = preg_replace("/#filter:user_login-(.*)#/U", "<span style = \"white-space:nowrap\"><a href = \"javascript:void(0)\" title=\"\\1\">#filter:login-\$1#</a></span>", $compiled); $new = preg_replace("/#filter:user_loginNoIcon-(.*)#/U", "<a href = \"javascript:void(0)\" title=\"\\1\">\\1</a>", $new); $compiled = $new; } // $compiled = preg_replace_callback("/#filter:user_login-(.*)#/U", 'formatLogin', $compiled); // $compiled = preg_replace_callback("/#filter:user_loginNoIcon-(.*)#/U", 'formatLogin', $compiled); return $compiled; }
public function getFirstVisitableNode($iterator = false) { if (!$iterator) { if (EfrontUser::isOptionVisible('tests')) { $iterator = new EfrontVisitableAndEmptyFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($this->tree), RecursiveIteratorIterator::SELF_FIRST))); //Create a new iterator, so that the internal iterator pointer is not reset } else { $iterator = new EfrontVisitableAndEmptyFilterIterator(new EfrontNoTestsFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($this->tree), RecursiveIteratorIterator::SELF_FIRST)))); //Create a new iterator, so that the internal iterator pointer is not reset } } $iterator->rewind(); //Initialize iterator return $iterator->current(); }
/** * Get all events related with this lesson * * This function is used to acquire all events related for this lesson, * according to a topical timeline * * <br/>Example: * <code> * $lesson -> getEvents(); // Get all events of this lessons from the most recent to the oldest * </code> * * @param $topic_ID the id of the topic to which the return events for the timeline should belong * @param $returnObjects whether to return event objects or not * @param $avatarSize the normalization size for the avatar images * @param $limit maximum number of events to return * @return boolean true/false * @since 3.6.0 * @access public */ public function getEvents($topic_ID = false, $returnObjects = false, $avatarSize = 0, $limit = false) { if (!EfrontUser::isOptionVisible('lessons_timeline')) { return array(); } if ($topic_ID) { // only current lesson users $users = $this->getUsers(); $users_logins = array_keys($users); if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) { //this applies to supervisors only // don't mix with course events - with courses_ID = $this->lesson['id'] $related_events = eF_getTableData("events, module_hcd_employee_works_at_branch ewb", "events.*", "ewb.branch_ID= " . $_SESSION['s_current_branch'] . " and events.users_LOGIN=ewb.users_login and type = '" . EfrontEvent::NEW_POST_FOR_LESSON_TIMELINE_TOPIC . "' AND entity_ID = '" . $topic_ID . "' AND lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)", "timestamp desc", "", $limit ? $limit * 5 : null); } else { // don't mix with course events - with courses_ID = $this->lesson['id'] $related_events = eF_getTableData("events, module_hcd_employee_works_at_branch ewb", "events.*", "ewb.branch_ID= " . $_SESSION['s_current_branch'] . " and events.users_LOGIN=ewb.users_login and type = '" . EfrontEvent::NEW_POST_FOR_LESSON_TIMELINE_TOPIC . "' AND entity_ID = '" . $topic_ID . "' AND lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)", "timestamp desc", "", $limit ? $limit * 5 : null); } } else { // only current lesson users $users = $this->getUsers(); $users_logins = array_keys($users); // if ($limit) { // $related_events = eF_getTableData("events", "*", "lessons_ID = '". $this->lesson['id']."' AND users_LOGIN IN ('".implode("','", $users_logins)."')", "timestamp desc LIMIT " . $limit); // // } else { if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) { //this applies to supervisors only $related_events = eF_getTableData("events, module_hcd_employee_works_at_branch ewb", "events.*", "ewb.branch_ID= " . $_SESSION['s_current_branch'] . " and events.users_LOGIN=ewb.users_login and lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)\t", "timestamp desc", "", $limit ? $limit * 5 : null); } else { $related_events = eF_getTableData("events", "events.*", "lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)\t", "timestamp desc", "", $limit ? $limit * 5 : null); } // } } if (!isset($avatarSize) || $avatarSize <= 0) { $avatarSize = 25; } $prev_event = false; $count = 0; $filtered_related_events = array(); foreach ($related_events as $key => $event) { $user = $users[$event['users_LOGIN']]; $filtered_related_events[$key] = $event; try { $file = new EfrontFile($user['avatar']); $filtered_related_events[$key]['avatar'] = $user['avatar']; list($filtered_related_events[$key]['avatar_width'], $filtered_related_events[$key]['avatar_height']) = eF_getNormalizedDims($file['path'], $avatarSize, $avatarSize); } catch (EfrontfileException $e) { $filtered_related_events[$key]['avatar'] = G_SYSTEMAVATARSPATH . "unknown_small.png"; $filtered_related_events[$key]['avatar_width'] = $avatarSize; $filtered_related_events[$key]['avatar_height'] = $avatarSize; } // Logical combination of events if ($prev_event) { // since we have decreasing chronological order we now that $event['timestamp'] < $prev_event['timestamp'] if ($event['users_LOGIN'] == $prev_event['event']['users_LOGIN'] && $event['type'] == $prev_event['event']['type'] && $prev_event['event']['timestamp'] - $event['timestamp'] < EfrontEvent::SAME_USER_INTERVAL) { unset($filtered_related_events[$prev_event['key']]); $count--; } } $prev_event = array("key" => $key, "event" => $event); if ($limit && ++$count == $limit) { break; } } if ($returnObjects) { $eventObjects = array(); foreach ($filtered_related_events as $event) { $eventObjects[] = new EfrontEvent($event); } return $eventObjects; } else { return $filtered_related_events; } }
<?php //This file cannot be called directly, only included. if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) { exit; } $load_editor = true; if (!EfrontUser::isOptionVisible('news')) { eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); } //Create shorthands for user access rights, to avoid long variable names !isset($currentUser->coreAccess['news']) || $currentUser->coreAccess['news'] == 'change' ? $_change_ = 1 : ($_change_ = 0); if (isset($_GET['lessons_ID'])) { if ($currentUser->user['user_type'] != 'administrator') { $eligibleLessons = $currentUser->getEligibleLessons(); } if (in_array($_GET['lessons_ID'], array_keys($eligibleLessons)) || $currentUser->user['user_type'] == 'administrator') { $lessonId = $_GET['lessons_ID']; } else { $lessonId = array_keys($eligibleLessons); } } else { $lessonId = $currentLesson->lesson['id']; } if ($_admin_) { $news = news::getNews(0); } else { if ($_professor_ || $_student_) { $news = news::getNews(0, true); if ($_professor_) { $lessonNews = news::getNews($lessonId, false);
<?php //This file cannot be called directly, only included. if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) { exit; } if (!EfrontUser::isOptionVisible('backup')) { eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); } if (isset($currentUser->coreAccess['backup']) && $currentUser->coreAccess['backup'] == 'hidden') { eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); } $basedir = G_BACKUPPATH; if (isset($_GET['restore'])) { //ini_set("memory_limit", "-1"); try { $restoreFile = new EfrontFile($_GET['restore']); if (!EfrontSystem::restore($_GET['restore'], $_GET['force'] ? $_GET['force'] : false)) { $message = _ERRORRESTORINGFILE; $message_type = 'failure'; } else { $message = _SUCCESFULLYRESTOREDSYSTEM; $message_type = 'success'; } } catch (Exception $e) { handleNormalFlowExceptions($e); if ($e->getCode() == EfrontSystemException::INCOMPATIBLE_VERSIONS) { $message .= ' - <a href = "javascript:void(0)" onclick = "location=location+\'&force=1\'">Force restore</a>'; } } }
/** * * @param $text * @return unknown_type */ public static function applyGlossary($text, $lessonId) { if (EfrontUser::isOptionVisible('shared_glossary')) { $glossary_words = eF_getTableData("glossary", "name,info,lessons_ID", "lessons_ID=" . $lessonId . " OR lessons_ID=0", "CHAR_LENGTH(name) desc"); //Get all the glossary words of this lesson } else { $glossary_words = eF_getTableData("glossary", "name,info,lessons_ID", "lessons_ID=" . $lessonId, "CHAR_LENGTH(name) desc"); //Get all the glossary words of this lesson } //if a term is defined both for current lesson and all lessons, current lesson definition must be displayed $globalTerms = array(); foreach ($glossary_words as $key => $value) { if ($value['lessons_ID'] == 0) { $globalTerms[$key] = $value['name']; } } foreach ($glossary_words as $key => $value) { if ($value['lessons_ID'] && ($k = array_search($value['name'], $globalTerms))) { unset($glossary_words[$k]); } } $searchdata = array(); $searchdatanext = array(); $replacedata = array(); $returnValue = preg_match("/^\\p{L}.*\$/u", 'a'); foreach ($glossary_words as $key => $value) { $first_letter = mb_substr($value['name'], 0, 1); if ($first_letter != '<') { $value['name'] = preg_quote($value['name'], "/"); if ($returnValue === false) { $searchdata[] = "/(\\b)(" . $value['name'] . ")(\\b)/si"; } else { $searchdata[] = "/(\\P{L})(" . $value['name'] . ")(\\P{L})/usi"; } $searchdatanext[] = "/(yty656hgh" . $value['name'] . ")/usi"; //Added 'UTF-8' because of #1661 and ’ $replacedata[] = str_replace(array("\r\n", "\n"), '<br/>', rawurlencode(htmlentities(strip_tags($value['info']), ENT_QUOTES, "UTF-8"))); } } $text = self::highlightWords($text, $searchdata, $replacedata); $text = preg_replace("/encode\\*\\(\\)\\!768atyj/", "", $text); $text = preg_replace($searchdatanext, $replacedata, $text); return $text; }
$branches = array_unique($branches); $stats_filters[] = array("table" => "module_hcd_employee_works_at_branch as filter_eb", "joinField" => "filter_eb.users_LOGIN", "condition" => "(filter_eb.branch_ID in (" . implode(",", $branches) . ") AND filter_eb.assigned = 1)"); } } } } else { if ($currentEmployee->isSupervisor()) { $isProfessor = false; if (isset($_GET['sel_course']) && $currentUser->hasCourse($_GET['sel_course'])) { $roles = EfrontUser::getRoles(); if ($roles[$currentUser->getUserTypeInCourse($_GET['sel_course'])] == 'professor') { $isProfessor = true; } } else { if (isset($infoLesson) && $currentUser->hasLesson($infoLesson)) { $roles = EfrontUser::getRoles(); if ($roles[$currentUser->getUserTypeInLesson($infoLesson)] == 'professor') { $isProfessor = true; } } } if (!$isProfessor) { if (!$_GET['subbranches']) { $supervisedBranches = $currentEmployee->getSupervisedBranches(); } else { $supervisedBranches = $currentEmployee->getSupervisedBranchesRecursive(); } $branches = array(); foreach ($supervisedBranches as $value) { $branches[] = $value['branch_ID']; }
$options['account'] = array('image' => '16x16/user.png', 'title' => _ACCOUNT, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user='******'login'] . "&op=profile", 'selected' => isset($_GET['op']) && in_array($_GET['op'], $accountOperations) ? true : false); //administrators don't have a learning aspect if ($editedUser->user['user_type'] != 'administrator') { $options['learning'] = array('image' => '16x16/courses.png', 'title' => _LEARNING, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user='******'login'] . "&op=user_courses", 'selected' => isset($_GET['op']) && in_array($_GET['op'], $learningOperations) ? true : false); } if (G_VERSIONTYPE == 'enterprise') { #cpp#ifdef ENTERPRISE if ($currentUser->coreAccess['organization'] != 'hidden') { $options['organization'] = array('image' => '16x16/enterprise.png', 'title' => _MYROLE, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user='******'login'] . "&op=placements", 'selected' => isset($_GET['op']) && in_array($_GET['op'], $enterpriseOperations) ? true : false); } if ($currentUser->user['login'] == $editedUser->user['login'] || $currentUser->user['user_type'] == 'administrator' || $currentEmployee->supervisesEmployee($editedUser->user['login'])) { $options['files'] = array('image' => '16x16/folder.png', 'title' => _FILES, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user='******'login'] . "&op=files", 'selected' => isset($_GET['op']) && $_GET['op'] == 'files' ? true : false); } } #cpp#endif if (!isset($_GET['add_user']) && !$_GET['popup'] && (!isset($_SESSION['missing_fields']) || $currentUser->user['login'] != $editedUser->user['login'])) { //When inside a popup, we don't want the menu $smarty->assign("T_TABLE_OPTIONS", $options); } // Set facebook template variables if ($GLOBALS['configuration']['social_modules_activated'] & FB_FUNC_CONNECT) { if (isset($_SESSION['facebook_user']) && $_SESSION['facebook_user']) { $smarty->assign("T_OPEN_FACEBOOK_SESSION", 1); $smarty->assign("T_FACEBOOK_API_KEY", $GLOBALS['configuration']['facebook_api_key']); $smarty->assign("T_FACEBOOK_SHOULD_UPDATE_STATUS", $_SESSION['facebook_can_update']); } $smarty->assign("T_FACEBOOK_ENABLED", 1); } if (EfrontUser::isOptionVisible('func_userstatus')) { $smarty->assign("T_SHOW_USERSTATUS", 1); }
$avatarFile = new EfrontFile($infoUser->user['avatar']); } catch (Exception $e) { $avatarFile = new EfrontFile(G_SYSTEMAVATARSPATH . "unknown_small.png"); } $info = array(array(_USERNAME, $userInfo['general']['fullname']), array(_USERTYPE, $userInfo['general']['user_types_ID'] ? $userInfo['general']['user_types_ID'] : $roles[$userInfo['general']['user_type']]), array(_ACTIVE, $userInfo['general']['active'] ? _YES : _NO), array(_JOINED, $userInfo['general']['joined_str']), array(_TOTALLOGINTIME, $userInfo['general']['total_login_time']['time_string'])); $pdf->printInformationSection(_GENERALUSERINFO, $info, $avatarFile); $info = array(array(_FORUMPOSTS, sizeof($userInfo['communication']['forum_messages'])), array(_FORUMLASTMESSAGE, formatTimestamp($userInfo['communication']['last_message']['timestamp'])), array(_PERSONALMESSAGES, sizeof($userInfo['communication']['personal_messages'])), array(_MESSAGESFOLDERS, sizeof($userInfo['communication']['personal_folders'])), array(_FILES, sizeof($userInfo['communication']['files'])), array(_FOLDERS, sizeof($userInfo['communication']['folders'])), array(_TOTALSIZE, $userInfo['communication']['total_size'] . _KB), array(_COMMENTS, sizeof($userInfo['communication']['comments']))); if (!EfrontUser::isOptionVisible('forum')) { unset($info[_FORUMPOSTS]); unset($info[_FORUMLASTMESSAGE]); } if (!EfrontUser::isOptionVisible('messages')) { unset($info[_PERSONALMESSAGES]); unset($info[_MESSAGESFOLDERS]); } if (!EfrontUser::isOptionVisible('comments')) { unset($info[_COMMENTS]); } $pdf->printInformationSection(_USERCOMMUNICATIONINFO, $info); $meanDuration = $timesReport->formatTimeForReporting($userInfo['usage']['mean_duration'] * 60); $monthDuration = $timesReport->formatTimeForReporting($userInfo['usage']['month_mean_duration'] * 60); $weekDuration = $timesReport->formatTimeForReporting($userInfo['usage']['week_mean_duration'] * 60); $info = array(array(_LASTLOGIN, formatTimestamp($userInfo['usage']['last_login']['timestamp'])), array(_TOTALLOGINS, sizeof($userInfo['usage']['logins'])), array(_MONTHLOGINS, sizeof($userInfo['usage']['month_logins'])), array(_WEEKLOGINS, sizeof($userInfo['usage']['week_logins'])), array(_MEANDURATION, $meanDuration['time_string']), array(_MONTHMEANDURATION, $monthDuration['time_string']), array(_WEEKMEANDURATION, $weekDuration['time_string']), array(_LASTIPUSED, $userInfo['usage']['last_ip'])); $pdf->printInformationSection(_USERUSAGEINFO, $info); $coursesAvgScore = $lessonsAvgScore = $projectsAvgScore = $testsAvgScore = 0; $data = array(); $constraints = array('archive' => false); if (!$show_inactive) { $constraints['active'] = true; } $constraints['required_fields'] = array('has_instances', 'location', 'user_type', 'completed', 'score', 'has_course', 'num_lessons', 'to_timestamp');
private function printLessonLink($treeLesson, $options, $roleBasicType) { $treeString = ''; if (!$roleBasicType || $treeLesson->lesson['active_in_lesson']) { //active_in_lesson (equals from_timestamp in users_to_lessons) in user status means that the user's status in the lesson is not 'pending' $classNames = array(); $lessonLink = $options['lessons_link']; if ($roleBasicType == 'student' && ($treeLesson->lesson['from_timestamp'] && $treeLesson->lesson['from_timestamp'] > time() || $treeLesson->lesson['to_timestamp'] && $treeLesson->lesson['to_timestamp'] < time())) { //here, from_timestamp and to_timestamp refer to the lesson periods $lessonLink = false; $classNames[] = 'inactiveLink'; } if ($options['tooltip'] && (!isset($_SESSION['s_login']) || EfrontUser::isOptionVisible('tooltip'))) { $treeString .= '<a href = "' . ($lessonLink ? str_replace("#user_type#", $roleBasicType, $lessonLink) . $treeLesson->lesson['id'] : 'javascript:void(0)') . '" class = "info ' . implode(" ", $classNames) . '" url = "ask_information.php?lessons_ID=' . $treeLesson->lesson['id'] . '">' . $treeLesson->lesson['name'] . '</a>'; } else { $lessonLink ? $treeString .= '<a href = "' . str_replace("#user_type#", $roleBasicType, $lessonLink) . $treeLesson->lesson['id'] . '">' . $treeLesson->lesson['name'] . '</a>' : ($treeString .= '<a href = "javascript:void(0)' . '" class = "info ' . implode(" ", $classNames) . '">' . $treeLesson->lesson['name'] . '</a>'); } } else { $treeString .= '<a href = "javascript:void(0)" class = "inactiveLink" title = "' . _CONFIRMATIONPEDINGFROMADMIN . '">' . $treeLesson->lesson['name'] . '</a>'; } return $treeString; }
//array_unique, so it doesn't send duplicate entries if (preg_match("/compatible; MSIE 6/", $_SERVER['HTTP_USER_AGENT']) && !preg_match("/compatible; MSIE 7/", $_SERVER['HTTP_USER_AGENT'])) { $smarty->assign("globalImageExtension", "gif"); } else { $smarty->assign("globalImageExtension", "png"); } if (!(isset($GLOBALS['currentTheme']->options['images_displaying']) && $GLOBALS['currentTheme']->options['images_displaying'] != 0)) { $smarty->assign("T_SHOW_SIDEBAR_IMAGES", 1); } /**** FOR USER STATUS ****/ if (EfrontUser::isOptionVisible('func_userstatus')) { if ($currentUser->coreAccess['dashboard'] != 'hidden') { $smarty->assign("T_SHOW_USER_STATUS", 1); } } $smarty->assign("T_SIDEBARWIDTH", $sideframe_width); //$smarty -> assign("T_REALNAME", $realname); $smarty->assign("T_SB_CTG", isset($_GET['sbctg']) ? $_GET['sbctg'] : false); $smarty->assign("T_TYPE", $efront_type); $smarty->assign("T_SIMPLE_COMPLETE_MODE", EfrontUser::isOptionVisible('simple_complete')); $benchmark->set('script'); if (!isset($horizontal_inframe_version) || !$horizontal_inframe_version) { $smarty->assign("T_NO_HORIZONTAL_MENU", 1); $smarty->display('new_sidebar.tpl'); } $benchmark->set('smarty'); $benchmark->stop(); $output = $benchmark->display(); if (G_DEBUG) { //echo $output; //Don't display, it's annoying }
public static function addToDefaultGroup($user, $userType) { // Get the default eFront group if (!$default_group) { $default_group = eF_getTableData("groups", "*", "is_default = 1 AND active = 1"); if (sizeof($default_group)) { $default_group = $default_group[0]; } else { $default_group = true; return; } } try { $roles = EfrontUser::getRoles(); $group = new EfrontGroup($default_group); //Add user to group with group's default type or, if one is not set, the user's type $group->addUsers($user, $group->group['user_types_ID'] ? $group->group['user_types_ID'] : $userType); } catch (Exception $e) { /*otherwise no default group has been defined*/ } return true; }
/** * The main functionality * * (non-PHPdoc) * @see libraries/EfrontModule#getModule() */ public function getModule() { $currentUser = $this->getCurrentUser(); $currentCourse = $this->getCurrentCourse(); $currentLesson = $this->getCurrentLesson(); $currentUnit = $this->getCurrentUnit(); /* $str = "Current User: <br />"; $str .= "id: " . $currentUser->user['id'] . "<br />"; $str .= "login: "******"<br />"; $str .= "password: "******"<br />"; $str .= "email: " . $currentUser->user['email'] . "<br />"; $str .= "languages_NAME: " . $currentUser->user['languages_NAME'] . "<br />"; $str .= "timezone: " . $currentUser->user['timezone'] . "<br />"; $str .= "name: " . $currentUser->user['name'] . "<br />"; $str .= "surname: " . $currentUser->user['surname'] . "<br />"; $str .= "active: " . $currentUser->user['active'] . "<br />"; $str .= "comments: " . $currentUser->user['comments'] . "<br />"; $str .= "user_type: " . $currentUser->user['user_type'] . "<br />"; $str .= "timestamp: " . $currentUser->user['timestamp'] . "<br />"; $str .= "active: " . $currentUser->user['active'] . "<br />"; $str .= "user_types_ID: " . $currentUser->user['user_types_ID'] . "<br />"; $str .= "type: " . $currentUser->user['user_type'] . "<br />"; $str .= "<br />"; */ $username = $currentUser->user['login']; $userTypesID = $currentUser->user['user_types_ID']; // echo "<br> \$userTypesID is $userTypesID"; $rolesPlain = EfrontUser::getRoles(true); $roleTypeName = $rolesPlain[$userTypesID]; $vLabGranted = array('FIU' => true, 'Employee' => true, 'KaseyaScholar' => true, 'KCA' => true, 'KCT' => true, 'Professor' => true, 'KaseyaTester' => true, 'LabSuspend' => false, 'KaseyaPublic' => false, 'Instructors' => false, 'DemoFree' => false, 'KaseyaQuickStart' => false, 'Sales' => false, 'Trial' => false, 'Administrator' => false, 'Student' => false); $baseURL = $this->moduleBaseLink; // $baseURL = "http://localhost/moodle19/"; // $baseURL = "http://ita-portal.cis.fiu.edu/"; // $moodleURL = "http://localhost/moodle19/"; $moodleURL = "http://ita-portal.cis.fiu.edu/"; $hours = 3; $minutes = 0; // echo "\$vLabGranted[$roleTypeName] is $vLabGranted[$roleTypeName]"; if ($vLabGranted[$roleTypeName]) { $vLabURL = $moodleURL . "mod/deva/view-embedded.php?id=10582&username={$username}&hours={$hours}&minutes={$minutes}"; } else { $vLabURL = $baseURL . "KU-poweredby-ITS-NotAvailable.html"; } /* $password = "******"; $hashed_password = $currentUser->user['password']; $email = $currentUser->user['email']; $firstname = $currentUser->user['name']; $lastname = $currentUser->user['surname']; $timezone = $currentUser->user['timezone']; */ /* $str .= "http://localhost/moodle19/mod/deva/embedded/auto-login.php?embedded=1&efront=1&username=$username"; $str1 = "http://localhost/moodle19/mod/deva/embedded/auto-login.php?embedded=1&efront=1&username=$username"; $payload = file_get_contents($str1); $str .= $payload; // src=\"http://localhost/moodle19/mod/deva/embedded/autologin.php?embedded=1&efront=1&username=$username&password=$password&hashed_password=$hashed_password&email=$email&firstname=$firstname&lastname=$lastname&timezone=$timezone\" */ $str = "\n\t\t\t<div align=\"center\">\n\t\t\t\t<iframe \n\t\t\t\t\tsrc=\"{$vLabURL}\"\n\t\t\t\t\talign=\"middle\" \n \t\t\t\theight=1000\n \t\t\t\twidth=100%\n \t\t\t\tmarginwidth=0\n \t\t\t\tmarginheight=0 >\n\t\t\t\t</iframe>\n\t\t\t</div>"; return $str; /* $username = "******"; $password = "******"; $domain = "fiu"; $hostName = "vc7.cis.fiu.edu"; $hostPort = array( "dc" => 36646, "ws1" => 36647, "ws2" => 36648, "reception" => 36649, "laptop_ceo" => 36650); $frame = array( "width" => 1200, "height" => 480, "align" => "middle", "marginwidth" => 0, "marginheight" => 0, "bpp" => 16); $smarty = $this -> getSmartyVar(); $smarty -> assign("T_MODULE_BASEDIR" , $this -> moduleBaseDir); $smarty -> assign("T_MODULE_BASELINK" , $this -> moduleBaseLink); $smarty -> assign("T_MODULE_BASEURL" , $this -> moduleBaseUrl); $smarty -> assign("NetworkDiagramImage", "fiu-network-diagram.png"); $smarty -> assign("frame", $frame); $smarty -> assign("T_DATA_SHEET", $this -> moduleBaseLink . "DataSheet.php"); $smarty -> assign("T_CONNECTION_INFO", $this -> moduleBaseLink . "ConnectionInfo.php"); $smarty -> assign("T_DC", $this -> moduleBaseLink . "webRDP.php?" . "hostName=" . $hostName . "&" . "hostPort=" . $hostPort["dc"] . "&" . "username="******"&" . "password="******"&" . "domain=" . $domain . "&" . "frameWidth=" . $frame["width"] . "&" . "frameHeight=" . $frame["height"] . "&" . "frameBpp=" . $frame["bpp"]); $smarty -> assign("T_WS1", $this -> moduleBaseLink . "webRDP.php?" . "hostName=" . $hostName . "&" . "hostPort=" . $hostPort["ws1"] . "&" . "username="******"&" . "password="******"&" . "domain=" . $domain . "&" . "frameWidth=" . $frame["width"] . "&" . "frameHeight=" . $frame["height"] . "&" . "frameBpp=" . $frame["bpp"]); $smarty -> assign("T_WS2", $this -> moduleBaseLink . "webRDP.php?" . "hostName=" . $hostName . "&" . "hostPort=" . $hostPort["ws2"] . "&" . "username="******"&" . "password="******"&" . "domain=" . $domain . "&" . "frameWidth=" . $frame["width"] . "&" . "frameHeight=" . $frame["height"] . "&" . "frameBpp=" . $frame["bpp"]); $smarty -> assign("T_RECEPTION", $this -> moduleBaseLink . "webRDP.php?" . "hostName=" . $hostName . "&" . "hostPort=" . $hostPort["reception"] . "&" . "username="******"&" . "password="******"&" . "domain=" . $domain . "&" . "frameWidth=" . $frame["width"] . "&" . "frameHeight=" . $frame["height"] . "&" . "frameBpp=" . $frame["bpp"]); $smarty -> assign("T_LAPTOP_CEO", $this -> moduleBaseLink . "webRDP.php?" . "hostName=" . $hostName . "&" . "hostPort=" . $hostPort["laptop_ceo"] . "&" . "username="******"&" . "password="******"&" . "domain=" . $domain . "&" . "frameWidth=" . $frame["width"] . "&" . "frameHeight=" . $frame["height"] . "&" . "frameBpp=" . $frame["bpp"]); return true; */ }
} if (isset($selectedAvatar)) { $selectedAvatar = $avatarsFileSystemTree->seekNode(G_SYSTEMAVATARSPATH . $selectedAvatar); $newList = FileSystemTree::importFiles($selectedAvatar['path']); //Import the file to the database, so we can access it with view_file $editedUser->user['avatar'] = key($newList); } } EfrontEvent::triggerEvent(array("type" => EfrontEvent::AVATAR_CHANGE, "users_LOGIN" => $editedUser->user['login'], "users_name" => $editedUser->user['name'], "users_surname" => $editedUser->user['surname'], "lessons_ID" => 0, "lessons_name" => "", "entity_ID" => $editedUser->user['avatar'])); } $editedUser->persist(); if (G_VERSIONTYPE == 'enterprise') { #cpp#ifdef ENTERPRISE if (isset($_GET['add_user'])) { $editedEmployee = EfrontHcdUser::createUser(array('users_login' => $editedUser->user['login'])); if ($currentEmployee->isSupervisor() && !EfrontUser::isOptionVisible('show_unassigned_users_to_supervisors')) { //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); } } }
$jsonValues['entity_id'] = current($entity); if ($newTime && is_numeric($newTime)) { $result = eF_executeNew("insert into users_to_content (users_LOGIN, content_ID, lessons_ID) values('" . $_SESSION['s_login'] . "', " . key($entity) . ", " . $_SESSION['s_lessons_ID'] . ") on duplicate key update total_time={$newTime}"); $jsonValues['time_in_unit'] = EfrontTimes::formatTimeForReporting($newTime); } else { $jsonValues['old_time_in_unit'] = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInUnit($_SESSION['s_login'], key($entity))); $jsonValues['old_time_in_lesson'] = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInLesson($_SESSION['s_login'], $_SESSION['s_lessons_ID'])); } } if (empty($_SESSION['last_periodic_check']) || time() - $_SESSION['last_periodic_check'] >= ceil($GLOBALS['configuration']['updater_period'] / 1000)) { $result = eF_executeNew("update user_times set time=time+(" . time() . "-timestamp_now),timestamp_now=" . time() . "\r\n\t\t\t\t\t\twhere session_expired = 0 and session_custom_identifier = '" . $_SESSION['s_custom_identifier'] . "' and users_LOGIN = '******'s_login'] . "'\r\n\t\t\t\t\t\tand entity = '" . current($entity) . "' and entity_id = '" . key($entity) . "'"); $_SESSION['last_periodic_check'] = time(); if ($currentTheme->options['sidebar_interface'] == 0) { if (empty($_SESSION['last_periodic_check_users']) || time() - $_SESSION['last_periodic_check_users'] >= 300) { $_SESSION['last_periodic_check_users'] = $_SESSION['last_periodic_check']; $online = EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60); $_SESSION['online_users'] = $online; if ($currentTheme->options['sidebar_interface'] == 0) { $jsonValues['online'] = $online; } } else { if ($currentTheme->options['sidebar_interface'] == 0) { $jsonValues['online'] = $_SESSION['online_users']; } } } //$messages = eF_getTableData("f_personal_messages pm, f_folders ff", "count(*)", "pm.users_LOGIN='******'s_login']."' and viewed='no' and f_folders_ID=ff.id and ff.name='Incoming'"); //$jsonValues['messages'] = $messages[0]['count(*)']; $jsonValues['status'] = 1; echo json_encode($jsonValues); } else {
//$categoryPath = str_replace("&rarr", "»", $categoryPath); $smarty->assign("T_CURRENT_CATEGORY_PATH", $categoryPath); if ($currentLesson->lesson['course_only'] == 1 && $_SESSION['s_courses_ID']) { $currentCourse = new EfrontCourse($_SESSION['s_courses_ID']); $smarty->assign("T_CURRENT_COURSE_NAME", htmlspecialchars($currentCourse->course['name'], ENT_QUOTES)); $smarty->assign("T_CURRENT_COURSE_ID", $currentCourse->course['id']); } } if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if ($GLOBALS['configuration']['facebook_api_key'] && $GLOBALS['configuration']['facebook_secret']) { $smarty->assign("T_FACEBOOK_USER", EfrontFacebook::userConnected()); } } #cpp#endif if ((!isset($currentUser->coreAccess['personal_messages']) || $currentUser->coreAccess['personal_messages'] != 'hidden') && EfrontUser::isOptionVisible('messages')) { $messages = eF_getTableData("f_personal_messages pm, f_folders ff", "count(*)", "pm.users_LOGIN='******'s_login'] . "' and viewed='no' and f_folders_ID=ff.id and ff.name='Incoming'"); $smarty->assign("T_NUM_MESSAGES", $messages[0]['count(*)']); } //$smarty -> assign("T_SIMPLE_COMPLETE_MODE", EfrontUser::isOptionVisible('simple_complete')); $smarty->load_filter('output', 'eF_template_formatTimestamp'); $smarty->load_filter('output', 'eF_template_formatLogins'); $smarty->load_filter('output', 'eF_template_setInnerLinks'); $smarty->load_filter('output', 'eF_template_setEditorOffset'); $benchmark->set('script'); $smarty->display('student.tpl'); $benchmark->set('smarty'); $benchmark->stop(); $output = $benchmark->display(); if (G_DEBUG) { echo $output;
$my_timeline_options = array(array('text' => _GOTOCOMPLETESYSTEMTIMELINE, 'image' => "16x16/go_into.png", 'href' => $_SESSION['s_type'] . ".php?ctg=social&op=timeline")); $smarty->assign("T_MY_TIMELINE_OPTIONS", $my_timeline_options); $smarty->assign("T_EVENTS", $events); } /********************* SHOW PROFILE POPUP ******************/ } else { if ($_GET['op'] == "show_profile") { if (isset($_GET['user'])) { $shownUser = EfrontUserFactory::factory($_GET['user']); try { $avatarfile = new EfrontFile($shownUser->user['avatar']); } catch (EfrontFileException $ex) { $shownUser->user['avatar'] = G_SYSTEMAVATARSPATH . "unknown_small.png"; } $smarty->assign("T_PROFILE_TO_SHOW", $shownUser->user); if (EfrontUser::isOptionVisible('func_comments')) { $smarty->assign("T_COMMENTS_ENABLED", 1); } $comments = $shownUser->getProfileComments(); if (sizeof($comments) > 0) { foreach ($comments as $id => $comment) { try { $file = new EfrontFile($comment['avatar']); list($comments[$id]['avatar_width'], $comments[$id]['avatar_height']) = eF_getNormalizedDims($file['path'], 25, 25); } catch (EfrontFileException $e) { $comments[$id]['avatar'] = G_SYSTEMAVATARSPATH . "unknown_small.png"; $comments[$id]['avatar_width'] = 25; $comments[$id]['avatar_height'] = 25; } $comments[$id]['time_ago'] = eF_convertIntervalToTime(time() - $comment['timestamp'], true) . ' ' . _AGO; }
/** * Lock system * * This function locks down system, so that no users can login (for example when upgrading) * If $logoutUsers is set, it logs out connected users as well * <br/>Example: * <code> * EfrontSystem::lockSystem('The system is locked due to maintenance', 1); * </code> * * @param string $message The message to display on the index page * @param boolean $logoutUsers Whether to disconnect connected users * @since 3.6.0 * @access public * @static */ public static function lockSystem($message, $logoutUsers) { EfrontConfiguration::setValue('lock_message', $message); EfrontConfiguration::setValue('lock_down', 1); if ($logoutUsers) { $onlineUsers = EfrontUser::getUsersOnline(); foreach ($onlineUsers as $value) { if ($value['login'] != $_SESSION['s_login']) { $user = EfrontUserFactory::factory($value['login']); $user->logout(); } } } }
protected function importData($line, $type, $data) { //pr($line);exit; try { switch ($type) { case "users": $newUser = EfrontUser::createUser($data); $this->log["success"][] = _LINE . " {$line}: " . _IMPORTEDUSER . " " . $newUser->login; break; case "users_to_courses": //Check if a user exists and whether it has the same case $userFound = false; if (!in_array($data['users_login'], $this->allUserLogins)) { //For case-insensitive matches foreach ($this->allUserLogins as $login) { if (mb_strtolower($data['users_login']) == mb_strtolower($login)) { $data['users_login'] = $login; $userFound = true; } } } else { $userFound = true; } if ($userFound) { $courses_name = trim($data['course_name']); $courses_ID = $this->getCourseByName($courses_name); unset($data['course_name']); if ($courses_ID) { foreach ($courses_ID as $course_ID) { $data['courses_ID'] = $course_ID; $course = new EfrontCourse($course_ID); if (is_null($this->course_users[$course_ID])) { $result = eF_getTableDataFlat("users_to_courses", "users_LOGIN", "courses_ID={$course_ID} AND archive=0"); $this->course_users[$course_ID] = array_combine($result['users_LOGIN'], $result['users_LOGIN']); } if (isset($this->course_users[$course_ID][$data['users_login']])) { throw new Exception("User is already assigned to the course", self::USER_TO_COURSE_EXISTS); } //$course -> addUsers($data['users_login'], (isset($data['user_type']) && $data['user_type']?$data['user_type']:"student")); $course->addUsers($data['users_login'], isset($data['user_type']) ? $data['user_type'] : "student"); $where = "users_login = '******'users_login'] . "' AND courses_ID = " . $data['courses_ID']; $data['completed'] ? $data['completed'] = 1 : ($data['completed'] = 0); EfrontCourse::persistCourseUsers($data, $where, $data['courses_ID'], $data['users_login']); if ($data['active']) { $course->confirm($data['users_login']); } else { $course->unconfirm($data['users_login']); } $this->course_users[$course_ID][$data['users_login']] = $data['users_login']; $this->log["success"][] = _LINE . " {$line}: " . _NEWCOURSEASSIGNMENT . " " . $courses_name . " - " . $data['users_login']; } } else { if ($courses_name != "") { $course = EfrontCourse::createCourse(array("name" => $courses_name)); $this->log["success"][] = _LINE . " {$line}: " . _NEWCOURSE . " " . $courses_name; $course->addUsers($data['users_login'], isset($data['user_type']) ? $data['user_type'] : "student"); $courses_ID = $course->course['id']; $this->courseNamesToIds[$courses_name] = array($courses_ID); $where = "users_login = '******'users_login'] . "' AND courses_ID = " . $courses_ID; EfrontCourse::persistCourseUsers($data, $where, $courses_ID, $data['users_login']); if ($data['active']) { $course->confirm($data['users_login']); } else { $course->unconfirm($data['users_login']); } $this->log["success"][] = _LINE . " {$line}: " . _NEWCOURSEASSIGNMENT . " " . $courses_name . " - " . $data['users_login']; } else { $this->log["failure"][] = _LINE . " {$line}: " . _COULDNOTFINDCOURSE . " " . $courses_name; } } } else { $this->log["failure"][] = _LINE . " {$line}: " . _USERDOESNOTEXIST . ": " . $data['users_login']; } break; case "users_to_lessons": //Check if a user exists and whether it has the same case $userFound = false; if (!in_array($data['users_login'], $this->allUserLogins)) { //For case-insensitive matches foreach ($this->allUserLogins as $login) { if (mb_strtolower($data['users_login']) == mb_strtolower($login)) { $data['users_login'] = $login; $userFound = true; } } } else { $userFound = true; } if ($userFound) { $lessons_name = trim($data['lesson_name']); $lessons_ID = $this->getLessonByName($lessons_name); unset($data['lesson_name']); if ($lessons_ID) { foreach ($lessons_ID as $lesson_ID) { $data['lessons_ID'] = $lesson_ID; $lesson = new EfrontLesson($lesson_ID); if (is_null($this->lesson_users[$lesson_ID])) { $result = eF_getTableDataFlat("users_to_lessons", "users_LOGIN", "lessons_ID={$lesson_ID} AND archive=0"); $this->lesson_users[$lesson_ID] = array_combine($result['users_LOGIN'], $result['users_LOGIN']); } if (isset($this->lesson_users[$lesson_ID][$data['users_login']])) { throw new Exception("User is already assigned to the lesson", self::USER_TO_LESSON_EXISTS); } if (!$lesson->lesson['course_only']) { $lesson->addUsers($data['users_login'], isset($data['user_type']) ? $data['user_type'] : "student"); } $data['completed'] ? $data['completed'] = 1 : ($data['completed'] = 0); eF_updateTableData("users_to_lessons", $data, "users_login = '******'users_login'] . "' AND lessons_ID = " . $data['lessons_ID']); if (!$lesson->lesson['course_only']) { if ($data['active']) { $lesson->confirm($data['users_login']); } else { $lesson->unconfirm($data['users_login']); } } $this->log["success"][] = _LINE . " {$line}: " . _NEWLESSONASSIGNMENT . " " . $lessons_name . " - " . $data['users_login']; } } else { if ($lessons_name != "") { $lesson = EfrontLesson::createLesson(array("name" => $lessons_name, 'course_only' => false)); $this->log["success"][] = _LINE . " {$line}: " . _NEWLESSON . " " . $lessons_name; $lesson->addUsers($data['users_login'], isset($data['user_type']) ? $data['user_type'] : "student"); $lessons_ID = $lesson->lesson['id']; $this->lessonNamesToIds[$lessons_name] = array($lessons_ID); eF_updateTableData("users_to_lessons", $data, "users_login = '******'users_login'] . "' AND lessons_ID = " . $lessons_ID); if ($data['active']) { $lesson->confirm($data['users_login']); } else { $lesson->unconfirm($data['users_login']); } $this->log["success"][] = _LINE . " {$line}: " . _NEWLESSONASSIGNMENT . " " . $lessons_name . " - " . $data['users_login']; } else { $this->log["failure"][] = _LINE . " {$line}: " . _COULDNOTFINDLESSON . " " . $lessons_name; } } } else { $this->log["failure"][] = _LINE . " {$line}: " . _USERDOESNOTEXIST . ": " . $data['users_login']; } break; case "users_to_groups": //debug(); $groups_ID = $this->getGroupByName($data['groups.name']); $group_name = $data['groups.name']; unset($data['groups.name']); foreach ($groups_ID as $group_ID) { $data['groups_ID'] = $group_ID; $group = new EfrontGroup($group_ID); $group->addUsers(array($data['users_login'])); $this->log["success"][] = _LINE . " {$line}: " . _NEWGROUPASSIGNMENT . " " . $group_name . " - " . $data['users_login']; } break; //debug(false); #cpp#ifdef ENTERPRISE //debug(false); #cpp#ifdef ENTERPRISE case "employees": $this->cleanUpEmptyValues($data); // a bit customized here, based on the fact that employees are always created together AFTER users (so the object should exist) eF_updateTableData("module_hcd_employees", $data, "users_login='******'users_login'] . "'"); break; case "branches": // If no father defined - root, else we may need to create the father first $data['father_branch_ID'] = $this->getFatherBranchId($data['father_branch_name']); $father_name = $data['father_branch_name']; $branch_ID = $this->getBranchByName($data['name']); $branch_name = $data['name']; if (sizeof($branch_ID) > 0 && $data['name'] != $data['father_branch_name']) { //TODO unset($data['father_branch_name']); $data['branch_ID'] = $branch_ID[0]; throw new EfrontBranchException(_BRANCHALREADYEXISTS, EfrontBranchException::BRANCH_EXISTS); } else { unset($data['father_branch_name']); $data['url'] = EfrontBranch::getBranchUrl($data['name']); $branch = EfrontBranch::createBranch($data); $this->setBranchByName($branch_name, $branch->branch['branch_ID']); } $this->log["success"][] = _LINE . " {$line}: " . _NEWBRANCH . " " . $branch_name; break; case "job_descriptions": if ($data['branch_name'] == "") { $data['branch_ID'] = "all"; // this denotes to the createJob class to put the job in all branches } else { $data['branch_ID'] = $this->getBranchByName($data['branch_name']); if (sizeof($data['branch_ID']) > 0) { //TODO: maybe different handling when multiple branches are found $data['branch_ID'] = $data['branch_ID'][0]; } else { throw new EfrontJobException(_BRANCHDESIGNATEDFORTHISJOBDESCRIPTIONDOESNOTEXIST, EfrontJobException::BRANCH_NOT_EXISTS); } } unset($data['branch_name']); if ($data['description'] != "") { $job_ID = $this->getJobByName($data['description']); if (sizeof($job_ID) > 0) { $data['job_description_ID'] = $job_ID[0]; throw new EfrontJobException(_JOBDESCRIPTIONEXISTSALREADY, EfrontJobException::JOB_ALREADY_EXISTS); } else { EfrontJob::createJob($data); $this->log["success"][] = _LINE . " {$line}: " . _NEWJOB . " " . $data['description']; } } else { $this->log["failure"][] = _LINE . " {$line}: " . _NOTITLEPROVIDEDFORNEWJOB; } break; case "skills": if ($data['skill_category'] == "") { throw new EfrontSkillException(_MISSINGSKILLCATEGORY, EfrontSkillException::INVALID_SKILL_CATEGORY); } else { $data['categories_ID'] = $this->getSkillCategoryByName($data['skill_category']); if ($data['categories_ID'][0] != "") { $data['categories_ID'] = $data['categories_ID'][0]; } else { // create skill category $data['categories_ID'] = eF_insertTableData("module_hcd_skill_categories", array('description' => $data['skill_category'])); $this->setSkillCategoryByName($data['skill_category'], $data['categories_ID']); } } unset($data['skill_category']); $skill_ID = $this->getSkillByName($data['description']); if ($skill_ID) { //TODO: another double issue $data['skill_ID'] = $skill_ID[0]; throw new EfrontSkillException(_SKILLALREADYEXISTS, EfrontSkillException::SKILL_EXISTS); } else { EfrontSkill::createSkill($data); $this->log["success"][] = _LINE . " {$line}: " . _NEWSKILL . " " . $data['description']; } break; case "users_to_jobs": // Get user $user = EfrontUserFactory::factory($data["users_login"]); // Get branch id $branch_ID = $this->getBranchByName($data['branch_name']); $branch_name = $data['branch_name']; if ($branch_ID[0] != "") { if (sizeof($branch_ID) == 1) { $branch_ID = $branch_ID[0]; } else { throw new EfrontBranchException(_BRANCHNAMEAMBIGUOUS, EfrontBranchException::BRANCH_AMBIGUOUS); } } else { throw new EfrontBranchException(_BRANCHDOESNOTEXIST, EfrontBranchException::BRANCH_NOT_EXISTS); } // Get job id $job_name = $data['description']; if ($job_name != "") { $new_job_description_ID = eF_getJobDescriptionId($job_name, $branch_ID); } else { throw new EfrontJobException(_MISSING_JOB_DESCRIPTION, EfrontJobException::MISSING_JOB_DESCRIPTION); } // Get hcd employee object if ($data['supervisor']) { $employee = new EfrontSupervisor(array("users_login" => $data["users_login"])); $position = 1; } else { $employee = new EfrontEmployee(array("users_login" => $data["users_login"])); $position = 0; } // Assign job try { $employee->addJob($user, $new_job_description_ID, $branch_ID, $position); $this->log["success"][] = _LINE . " {$line}: " . _NEWJOBASSIGNMENT . " " . $data["users_login"] . " - (" . $branch_name . " - " . $job_name . ") "; } catch (Exception $e) { if ($this->options['replace_existing']) { $employee->removeJob($new_job_description_ID); $employee->addJob($user, $new_job_description_ID, $branch_ID, $position); $this->log["success"][] = _LINE . " {$line}: " . _NEWJOBASSIGNMENT . " " . $data["users_login"] . " - (" . $branch_name . " - " . $job_name . ") "; } } break; case "users_to_skills": $skill_ID = $this->getSkillByName($data['description']); $skill_name = $data['description']; if ($skill_ID[0] != "") { if (sizeof($skill_ID) == 1) { $skill_ID = $skill_ID[0]; } else { throw new EfrontSkillException(_SKILLNAMEAMBIGUOUS, EfrontSkillException::SKILL_AMBIGUOUS); } } else { throw new EfrontSkillException(_SKILLDOESNOTEXIST, EfrontSkillException::SKILL_NOT_EXISTS); } $skill = new EfrontSkill($skill_ID); $skill->assignToEmployee($data['users_login'], $data['specification']); $this->log["success"][] = _LINE . " {$line}: " . _NEWSKILLASSIGNMENT . " " . $data["users_login"] . " - " . $skill_name; break; case "courses_to_branches": $branchId = $this->getBranchByName($data['branch_name']); if (!$branchId[0]) { $fields = array('name' => $data['branch_name'], 'url' => EfrontBranch::getBranchUrl($data['branch_name'])); $branch = EfrontBranch::createBranch($fields); } else { $branch = new EfrontBranch($branchId[0]); } $courseId = $this->getCourseByName($data['course_name']); if ($courseId[0]) { $branch->addCoursesToBranch($courseId[0]); } $this->log["success"][] = _LINE . " {$line}: " . _NEWCOURSETOBRANCHASSIGNMENT . " " . $data['course_name'] . " - " . $data['branch_name']; break; #cpp#endif } } catch (Exception $e) { if ($this->options['replace_existing']) { if ($this->isAlreadyExistsException($e->getCode(), $type)) { $this->updateExistingData($line, $type, $data); } else { $this->log["failure"][] = _LINE . " {$line}: " . $e->getMessage(); // ." ". str_replace("\n", "<BR>", $e->getTraceAsString()); } } else { $this->log["failure"][] = _LINE . " {$line}: " . $e->getMessage(); // ." ". str_replace("\n", "<BR>", $e->getTraceAsString()); } } }
private function handlePostAjaxRequestForUsersRemoveAll() { $constraints = array('archive' => false, 'active' => true, 'condition' => 'uc.courses_ID is not null'); $users = $this->getCourseUsersIncludingUnassigned($constraints); $users = EfrontUser::convertUserObjectsToArrays($users); isset($_GET['filter']) ? $users = eF_filterData($users, $_GET['filter']) : null; $this->archiveCourseUsers(array_keys($users)); }
echo "<xml>"; echo "<status>error</status>"; echo "<message>Incomplete arguments</message>"; echo "</xml>"; } } else { echo "<xml>"; echo "<status>error</status>"; echo "<message>Invalid token</message>"; echo "</xml>"; } break; case 'update_user': if (isset($_GET['token']) && checkToken($_GET['token'])) { if (isset($_GET['login']) && isset($_GET['password']) && isset($_GET['email']) && isset($_GET['name']) && isset($_GET['surname'])) { $fields['password'] = EfrontUser::createPassword($_GET['password']); $fields['email'] = $_GET['email']; $fields['name'] = $_GET['name']; $fields['surname'] = $_GET['surname']; if (eF_updateTableData("users", $fields, "login='******'login'] . "'")) { echo "<xml>"; echo "<status>ok</status>"; echo "</xml>"; } else { echo "<xml>"; echo "<status>error</status>"; echo "<message>User exists</message>"; echo "</xml>"; } } else { echo "<xml>";
<?php //This file cannot be called directly, only included. if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) { exit; } $loadScripts[] = 'scriptaculous/controls'; $loadScripts[] = 'includes/lessons'; if (!EfrontUser::isOptionVisible('professor_courses') || $_SESSION['s_type'] != 'professor' || $currentUser->coreAccess['professor_courses'] == 'hidden') { eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); } if (isset($_GET['delete_lesson']) && eF_checkParameter($_GET['delete_lesson'], 'id')) { //The administrator asked to delete a lesson if (isset($currentUser->coreAccess['lessons']) && $currentUser->coreAccess['lessons'] != 'change') { eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); exit; } try { $lesson = new EfrontLesson($_GET['delete_lesson']); if ($lesson->lesson['creator_LOGIN'] != $_SESSION['s_login']) { throw new Exception(_UNAUTHORIZEDACCESS); } $lesson->delete(); } catch (Exception $e) { $message = _SOMEPROBLEMEMERGED . ': ' . $e->getMessage() . ' (' . $e->getCode() . ')'; header("HTTP/1.0 500 "); echo rawurlencode($e->getMessage()) . ' (' . $e->getCode() . ')'; } exit; } elseif (isset($_GET['archive_lesson']) && eF_checkParameter($_GET['archive_lesson'], 'login')) { //The administrator asked to delete a lesson
<?php /** * Show avatars * * This file is the page which shows the avatars list * @package eFront * @version 1.0 */ session_cache_limiter('none'); session_start(); $path = "../libraries/"; /** Configuration file.*/ include_once $path . "configuration.php"; try { $currentUser = EfrontUser::checkUserAccess(); } catch (Exception $e) { echo "<script>parent.location = 'index.php?logout=true&message=" . urlencode($e->getMessage() . ' (' . $e->getCode() . ')') . "&message_type=failure'</script>"; //This way the frameset will revert back to single frame, and the annoying effect of 2 index.php, one in each frame, will not happen exit; } $current_dir = getcwd(); chdir(G_SYSTEMAVATARSPATH); $avatar_files = eF_getDirContents(false, 'png'); chdir($current_dir); $smarty->assign("T_SYSTEM_AVATARS", $avatar_files); if ($GLOBALS['configuration']['social_modules_activated'] > 0) { $smarty->assign("T_SOCIAL_INTERFACE", 1); } $smarty->display("show_avatars.tpl");
<?php //pr($currentUser -> coreAccess); if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) { exit; } if (!EfrontUser::isOptionVisible('themes')) { eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); } !isset($currentUser->coreAccess['themes']) || $currentUser->coreAccess['themes'] == 'change' ? $_change_ = 1 : ($_change_ = 0); $smarty->assign("_change_", $_change_); $loadScripts[] = 'scriptaculous/dragdrop'; $loadScripts[] = 'includes/themes'; $loadScripts[] = 'includes/entity'; $themeSettingsTools = array(array('text' => _APPEARANCE, 'image' => "16x16/layout.png", 'href' => basename($_SERVER['PHP_SELF']) . '?ctg=system_config&op=appearance')); $smarty->assign("T_APPEARANCE_LINK", $themeSettingsTools); try { try { $currentSetTheme = new themes($GLOBALS['configuration']['theme']); } catch (Exception $e) { //EfrontConfiguration :: setValue('theme', 1); $currentSetTheme = new themes('default'); } !isset($currentUser->coreAccess['themes']) || $currentUser->coreAccess['themes'] == 'change' ? $_change_ = 1 : ($_change_ = 0); $smarty->assign("_change_", $_change_); $themes = themes::getAll("themes"); $allBrowsers = themes::$browsers; $usedBrowsers = array(); foreach ($themes as $value) { $themeNames[] = $value->themes['name']; }
$mainScripts = getMainScripts(); $smarty->assign("T_HEADER_MAIN_SCRIPTS", implode(",", $mainScripts)); //Operation/file specific scripts $loadScripts = array_diff($loadScripts, $mainScripts); //Clear out duplicates $smarty->assign("T_HEADER_LOAD_SCRIPTS", implode(",", array_unique($loadScripts))); //array_unique, so it doesn't send duplicate entries if (in_array('news', array_merge($positions['leftList'], $positions['rightList'], $positions['centerList']))) { $smarty->assign("T_NEWS", news::getNews(0, true)); } if (G_VERSIONTYPE == 'enterprise') { #cpp#ifdef ENTERPRISE require_once "../libraries/module_hcd_tools.php"; } #cpp#endif if (EfrontUser::isOptionVisible('online_users') && in_array('online', array_merge($positions['leftList'], $positions['rightList'], $positions['centerList']))) { $smarty->assign("T_ONLINE_USERS_LIST", EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60)); } $smarty->assign("T_CURRENT_USER", $currentUser); $smarty->load_filter('output', 'eF_template_setEditorOffset'); $smarty->display('index.tpl'); } else { $smarty->load_filter('output', 'eF_template_setEditorOffset'); $smarty->display('index.tpl'); } $benchmark->set('smarty'); $benchmark->stop(); $output = $benchmark->display(); if (G_DEBUG) { echo $output; }
if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) { exit; } if (!$currentUser->coreAccess['forum'] || $currentUser->coreAccess['forum'] == 'change') { $_change_ = 1; } try { if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) { //this applies to supervisors only $currentBranch = new EfrontBranch($_SESSION['s_current_branch']); } if (!EfrontUser::isOptionVisible('forum')) { eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); } $loadScripts[] = 'includes/forum'; $roles = EfrontUser::getRoles(true); $smarty->assign("T_USERROLES", $roles); $forums = f_forums::getAll("f_forums"); foreach ($forums as $value) { $forums_to_lessons[$value['lessons_ID']] = $value['id']; } $lessons = EFrontLesson::getLessons(false, true); $res = eF_getTableData("lessons", "id,options"); foreach ($res as $value) { $options = unserialize($value['options']); if (!empty($options) && !$options['forum']) { unset($forums[$forums_to_lessons[$value['id']]]); } } //pr($forums); if (!$_admin_) {
/** * Assign courses to user. * * This function can be used to assign a course to the current user. If $userTypes * is specified, then the user is assigned to the course using the specified type. * By default, the user asic type is used. * <br/>Example: * <code> * $user = EfrontUserFactory :: factory('jdoe'); * $user -> addCourses(23); //Add a signle course with id 23 * $user -> addCourses(23, 'professor'); //Add a signle course with id 23 and set the user type to 'professor' * $user -> addCourses(array(23,24,25)); //Add multiple courses using an array * $user -> addCourses(array(23,24,25), array('professor', 'student', 'professor')); //Add multiple courses using an array for course ids and another for corresponding user types * </code> * * @param mixed $courseIds Either a single course id, or an array if ids * @param mixed $userTypes The corresponding user types for the specified courses * @param boolean $activeate Courses will be set as active or not * @return mixed The array of course ids or false if the course already exists. * @since 3.5.0 * @access public * @todo auto_projects */ public function addCourses($courses, $roles = 'student', $confirmed = true) { $courses = $this->verifyCoursesList($courses); $roles = EfrontUser::verifyRolesList($roles, sizeof($courses)); if (sizeof($courses) > 0) { $courses = eF_getTableData("courses", "*", "id in (" . implode(",", $courses) . ")"); foreach ($courses as $key => $course) { $course = new EfrontCourse($course); $course->addUsers($this->user['login'], $roles[$key], $confirmed); } $this->courses = false; //Reset courses information } return $this->getUserCourses(); }
private function getLessonSettings() { $currentUser = $this->getCurrentUser(); $lessonSettings['theory'] = array('text' => _THEORY, 'image' => "32x32/theory.png", 'onClick' => 'activate(this, \'theory\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); $lessonSettings['examples'] = array('text' => _EXAMPLES, 'image' => "32x32/examples.png", 'onClick' => 'activate(this, \'examples\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); if (EfrontUser::isOptionVisible('projects')) { $lessonSettings['projects'] = array('text' => _PROJECTS, 'image' => "32x32/projects.png", 'onClick' => 'activate(this, \'projects\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } if (EfrontUser::isOptionVisible('tests')) { $lessonSettings['tests'] = array('text' => _TESTS, 'image' => "32x32/tests.png", 'onClick' => 'activate(this, \'tests\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if (EfrontUser::isOptionVisible('surveys')) { $lessonSettings['survey'] = array('text' => _SURVEY, 'image' => "32x32/surveys.png", 'onClick' => 'activate(this, \'survey\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } } #cpp#endif if (EfrontUser::isOptionVisible('feedback')) { $lessonSettings['feedback'] = array('text' => _FEEDBACK, 'image' => "32x32/feedback.png", 'onClick' => 'activate(this, \'feedback\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } $lessonSettings['rules'] = array('text' => _ACCESSRULES, 'image' => "32x32/rules.png", 'onClick' => 'activate(this, \'rules\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); if (EfrontUser::isOptionVisible('forum')) { $lessonSettings['forum'] = array('text' => _FORUM, 'image' => "32x32/forum.png", 'onClick' => 'activate(this, \'forum\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } if (EfrontUser::isOptionVisible('comments')) { $lessonSettings['comments'] = array('text' => _COMMENTS, 'image' => "32x32/note.png", 'onClick' => 'activate(this, \'comments\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } if (EfrontUser::isOptionVisible('news')) { $lessonSettings['news'] = array('text' => _ANNOUNCEMENTS, 'image' => "32x32/announcements.png", 'onClick' => 'activate(this, \'news\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if (EfrontUser::isOptionVisible('lessons_timeline')) { $lessonSettings['lessons_timeline'] = array('text' => _LESSONSTIMELINE, 'image' => "32x32/user_timeline.png", 'onClick' => 'activate(this, \'lessons_timeline\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } } #cpp#endif $lessonSettings['scorm'] = array('text' => _SCORM, 'image' => "32x32/scorm.png", 'onClick' => 'activate(this, \'scorm\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); $lessonSettings['ims'] = array('text' => _IMS, 'image' => "32x32/autocomplete.png", 'onClick' => 'activate(this, \'ims\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); $lessonSettings['digital_library'] = array('text' => _SHAREDFILES, 'image' => "32x32/file_explorer.png", 'onClick' => 'activate(this, \'digital_library\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); if (EfrontUser::isOptionVisible('calendar')) { $lessonSettings['calendar'] = array('text' => _CALENDAR, 'image' => "32x32/calendar.png", 'onClick' => 'activate(this, \'calendar\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } if (EfrontUser::isOptionVisible('glossary')) { $lessonSettings['glossary'] = array('text' => _GLOSSARY, 'image' => "32x32/glossary.png", 'onClick' => 'activate(this, \'glossary\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); } $lessonSettings['auto_complete'] = array('text' => _AUTOCOMPLETE, 'image' => "32x32/autocomplete.png", 'onClick' => 'activate(this, \'auto_complete\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['content_tree'] = array('text' => _CONTENTTREEFIRSTPAGE, 'image' => "32x32/content_tree.png", 'onClick' => 'activate(this, \'content_tree\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['lesson_info'] = array('text' => _LESSONINFORMATION, 'image' => "32x32/information.png", 'onClick' => 'activate(this, \'lesson_info\')', 'title' => _CLICKTOTOGGLE, 'group' => 2, 'class' => 'inactiveImage'); if (EfrontUser::isOptionVisible('bookmarks')) { $lessonSettings['bookmarking'] = array('text' => _BOOKMARKS, 'image' => "32x32/bookmark.png", 'onClick' => 'activate(this, \'bookmarking\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); } $lessonSettings['reports'] = array('text' => _STATISTICS, 'image' => "32x32/reports.png", 'onClick' => 'activate(this, \'reports\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['content_report'] = array('text' => _CONTENTREPORT, 'image' => "32x32/warning.png", 'onClick' => 'activate(this, \'content_report\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['print_content'] = array('text' => _PRINTCONTENT, 'image' => "32x32/printer.png", 'onClick' => 'activate(this, \'print_content\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['start_resume'] = array('text' => _STARTRESUME, 'image' => "32x32/continue.png", 'onClick' => 'activate(this, \'start_resume\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['show_percentage'] = array('text' => _COMPLETIONPERCENTAGEBLOCK, 'image' => "32x32/percent.png", 'onClick' => 'activate(this, \'show_percentage\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['show_content_tools'] = array('text' => _UNITOPTIONSBLOCK, 'image' => "32x32/options.png", 'onClick' => 'activate(this, \'show_content_tools\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['show_right_bar'] = array('text' => _RIGHTBAR, 'image' => "32x32/hide_right.png", 'onClick' => 'activate(this, \'show_right_bar\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['show_left_bar'] = array('text' => _LEFTBAR, 'image' => "32x32/hide_left.png", 'onClick' => 'activate(this, \'show_left_bar\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['show_student_cpanel'] = array('text' => _STUDENTCPANEL, 'image' => "32x32/options.png", 'onClick' => 'activate(this, \'show_student_cpanel\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); $lessonSettings['show_dashboard'] = array('text' => _DASHBOARD, 'image' => "32x32/generic.png", 'onClick' => 'activate(this, \'show_dashboard\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); if ($GLOBALS['currentTheme']->options['sidebar_interface'] == 1 || $GLOBALS['currentTheme']->options['sidebar_interface'] == 2) { $lessonSettings['show_horizontal_bar'] = array('text' => _SHOWHORIZONTALBAR, 'image' => "32x32/export.png", 'onClick' => 'activate(this, \'show_horizontal_bar\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); } if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if (G_VERSIONTYPE != 'standard') { #cpp#ifndef STANDARD $lessonSettings['timers'] = array('text' => _TIMERS, 'image' => "32x32/clock.png", 'onClick' => 'activate(this, \'timers\')', 'title' => _CLICKTOTOGGLE, 'group' => 1, 'class' => 'inactiveImage'); } #cpp#endif } #cpp#endif foreach (eF_loadAllModules(true) as $module) { if ($module->isLessonModule()) { // The $setLanguage variable is defined in globals.php if (!in_array("administrator", $module->getPermittedRoles())) { $mod_lang_file = $module->getLanguageFile($setLanguage); if (is_file($mod_lang_file)) { require_once $mod_lang_file; } } // The $setLanguage variable is defined in globals.php if (!in_array("administrator", $module->getPermittedRoles())) { $mod_lang_file = $module->getLanguageFile($setLanguage); if (is_file($mod_lang_file)) { require_once $mod_lang_file; } } $lessonSettings[$module->className] = array('text' => $module->getName(), 'image' => "32x32/addons.png", 'onClick' => 'activate(this, \'' . $module->className . '\')', 'title' => _CLICKTOTOGGLE, 'group' => 3, 'class' => 'inactiveImage'); } } $lessonSettings[$key]['onClick'] = 'activate(this, \'' . $key . '\')'; $lessonSettings[$key]['style'] = 'color:inherit'; return $lessonSettings; }
} } #cpp#endif if ((!isset($currentUser->coreAccess['personal_messages']) || $currentUser->coreAccess['personal_messages'] != 'hidden') && EfrontUser::isOptionVisible('messages')) { $myCoursesOptions[] = array('text' => _MESSAGES, 'image' => "32x32/mail.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=messages"); } if (EfrontUser::isOptionVisible('statistics')) { $myCoursesOptions[] = array('text' => _STATISTICS, 'image' => "32x32/reports.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=statistics"); } if (EfrontUser::isOptionVisible('forum')) { $myCoursesOptions[] = array('text' => _FORUM, 'image' => "32x32/forum.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=forum"); } if (EfrontUser::isOptionVisible('calendar')) { $myCoursesOptions[] = array('text' => _CALENDAR, 'image' => "32x32/calendar.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=calendar"); } if (EfrontUser::isOptionVisible('professor_courses') && ($_SESSION['s_type'] == 'professor' || $currentUser->user['user_type'] == 'professor')) { if ($currentUser->coreAccess['professor_courses'] != 'hidden') { $myCoursesOptions[] = array('text' => _COURSES, 'image' => "32x32/courses.png", 'href' => "professor.php?ctg=courses"); $myCoursesOptions[] = array('text' => _LESSONS, 'image' => "32x32/lessons.png", 'href' => "professor.php?ctg=professor_lessons"); } } foreach ($loadedModules as $module) { if ($linkInfo = $module->getToolsLinkInfo()) { $myCoursesOptions[] = array('text' => $linkInfo['title'], 'image' => eF_getRelativeModuleImagePath($linkInfo['image']), 'href' => $linkInfo['link']); } } $smarty->assign("T_LAYOUT_CLASS", $currentTheme->options['toolbar_position'] == "left" ? "hideRight" : "hideLeft"); //Whether to show the sidemenu on the left or on the right $smarty->assign("T_COURSES_LIST_OPTIONS", $myCoursesOptions); } } catch (Exception $e) {
$pdfId = explode("=", $matches[0]); if (isset($pdfId[1])) { $options[] = array('text' => _VIEWPDFINIOS, 'image' => "others/ios.png", 'href' => "javascript:void(0)", 'onclick' => "window.open('view_file.php?file=" . $pdfId[1] . "')"); } else { preg_match("#content/lessons/.*\\.pdf#", $currentUnit['data'], $matches); $options[] = array('text' => _VIEWPDFINIOS, 'image' => "others/ios.png", 'href' => "javascript:void(0)", 'onclick' => "window.open('view_file.php?file=" . $matches[0] . "')"); //pr($matches); } } if ($_student_ && $currentLesson->options['content_report'] && $ruleCheck) { $options[] = array('text' => _CONTENTREPORT, 'image' => "16x16/warning.png", 'href' => "content_report.php?" . http_build_query($_GET), 'onclick' => "eF_js_showDivPopup(event, '" . _CONTENTREPORT . "', 1)", "target" => "POPUP_FRAME"); } if ($currentLesson->options['bookmarking'] && EfrontUser::isOptionVisible('bookmarks') && $ruleCheck) { $options[] = array('text' => _ADDTHISPAGETOYOURBOOKMARKS, 'image' => "16x16/bookmark_add.png", 'onclick' => "addBookmark(this)"); } if (EfrontUser::isOptionVisible('comments') && $ruleCheck) { $options[] = array('text' => _ADDCOMMENT, 'image' => "16x16/comment_add.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=comments&view_unit=" . $_GET['view_unit'] . "&add=1&popup=1", 'onclick' => "eF_js_showDivPopup(event, '" . _ADDCOMMENT . "', 1)", "target" => "POPUP_FRAME"); } //$options[] = array('text' => "open window", 'image' => "16x16/add.png", 'href' => basename($_SERVER['PHP_SELF'])."?ctg=content&view_unit=".$_GET['view_unit']."&bare=1&popup=1", 'onclick' => "window.open('about:blank', 'testme', 'width=800, height=600')", "target" => "testme"); if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if (G_VERSIONTYPE != 'standard') { #cpp#ifndef STANDARD $scorm2004 = in_array($currentUnit['scorm_version'], EfrontContentTreeSCORM::$scorm2004Versions); if ($scorm2004) { //This means that the content will not start automatically, so a handle must appear to prompt for user selection if ($scormState['start'] == 'disabled') { $smarty->assign("T_NO_START", true); unset($treeOptions['selectedNode']); //$treeOptions['expand'] = true; $treeOptions['show_hide'] = false;