/** * Get configuration values * * This function is used to retrieve configuration values. * Furthermore, it compares the keys of the $defaultOptions array with * The name/value pairs stored in the database. If a default name/value * pair is not present in the database, it is created using its default * value (unless the whole table is empty, in which case nothing is done) * <br>Example: * <code> * $defaultConfig = EfrontConfiguration :: getValues(); * </code> * * @return array The configuration options in name/value pairs * @access public * @since 3.0 * @static */ public static function getValues() { $options = EfrontCache::getInstance()->getCache('configuration'); if (!$options) { $options = eF_getTableDataFlat("configuration", "*"); sizeof($options) > 0 ? $options = array_combine($options['name'], $options['value']) : ($options = array()); EfrontCache::getInstance()->setCache('configuration', $options); } foreach (EfrontConfiguration::$defaultOptions as $key => $value) { if (!isset($options[$key])) { EfrontConfiguration::setValue($key, $value); $options[$key] = $value; } } return $options; }
parse_str($_POST['firstlist']); parse_str($_POST['secondlist']); parse_str($_POST['visibility']); mb_internal_encoding('utf-8'); //This must be put here due to PHP bug #48697 if ($visibility) { $positions = serialize(array('first' => array_unique($firstlist), 'second' => array_unique($secondlist), 'visibility' => $visibility)); } else { $positions = serialize(array('first' => array_unique($firstlist), 'second' => array_unique($secondlist))); } //Dashboard positions if ($_POST['dashboard']) { eF_updateTableData("users", array('dashboard_positions' => $positions), "login='******'login'] . "'"); } else { if ($currentUser->user['user_type'] == 'administrator' && !isset($_POST['lessons_ID'])) { EfrontConfiguration::setValue($currentUser->user['login'] . "_positions", $positions); } else { if (isset($_POST['set_default']) && ($currentUser->user['user_type'] == 'administrator' || $roles[$currentLesson->getRole($currentUser->user['login'])] == 'professor')) { $currentLesson->setOptions(array("default_positions" => $positions)); $positions = serialize(array('first' => array_unique($firstlist), 'second' => array_unique($secondlist), 'visibility' => $visibility, 'update' => true)); $lessonStudents = $currentLesson->getUsers('student'); if (sizeof($lessonStudents) > 0) { $users = implode("','", array_keys($lessonStudents)); eF_updateTableData("users_to_lessons", array('positions' => $positions), "users_LOGIN in ('" . $users . "') and lessons_ID=" . $currentLesson->lesson['id']); } } else { if (!$visibility) { $result = eF_getTableData("users_to_lessons", "positions", "lessons_ID=" . $currentLesson->lesson['id'] . " AND users_LOGIN='******'login'] . "'"); $result = unserialize($result[0]['positions']); $visibility = $result['visibility']; if (isset($result['visibility'])) {
/** * Delete version key * * This function deletes the currently stored version key, thus setting the version to * "unregistered". * <br/>Example: * <code> * EfrontSystem :: deleteVersionKey(); * </code> * * @since 3.6.0 * @access public * @static */ public static function deleteVersionKey() { EfrontConfiguration::setValue('version_key', ''); EfrontConfiguration::setValue('version_users', ''); EfrontConfiguration::setValue('version_serial', ''); EfrontConfiguration::setValue('version_type', ''); //EfrontConfiguration :: setValue('version_paypal', ''); //EfrontConfiguration :: setValue('version_hcd', ''); }
} } echo json_encode(array('status' => 1, 'browser' => $_GET['browser'], 'url' => $url)); } catch (Exception $e) { handleAjaxExceptions($e); } exit; } if (isset($_GET['set_theme']) && in_array($_GET['set_theme'], $legalValues) && eF_checkParameter($_GET['set_theme'], 'id')) { try { unset($_SESSION['s_theme']); $cacheTree = new FileSystemTree(G_THEMECACHE, true); foreach (new EfrontDirectoryOnlyFilterIterator($cacheTree->tree) as $value) { $value->delete(); } EfrontConfiguration::setValue('theme', $_GET['set_theme']); foreach ($themes as $key => $value) { //$value = new themes($value['id']); unset($value->options['browsers']); $value->persist(); } $theme = new themes($_GET['set_theme']); if ($theme->options['sidebar_interface'] > 0) { echo json_encode(array('success' => true, 'data' => array('url' => basename($_SERVER['PHP_SELF']) . '?ctg=themes&tab=set_theme'))); } else { echo json_encode(array('success' => true, 'data' => array('url' => basename($_SERVER['PHP_SELF'], '.php') . 'page.php?ctg=themes&tab=set_theme'))); } if (!isset($_GET['ajax'])) { eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=themes"); } } catch (Exception $e) {
// HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past $path = "../libraries/"; $loadLanguage = false; define("NO_OUTPUT_BUFFERING", true); /** Configuration file.*/ require_once $path . "configuration.php"; if (empty($_SESSION['s_login']) || !eF_checkParameter($_SESSION['s_login'], 'login')) { echo json_encode(array('status' => 0, 'code' => -1)); exit; } try { if ($GLOBALS['configuration']['last_reset_certificate'] + 24 * 60 * 60 < time()) { EfrontCourse::checkCertificateExpire(); EfrontConfiguration::setValue('last_reset_certificate', time()); } $currentTheme = new themes($_SESSION['s_theme']); $newTime = ''; $jsonValues = array(); if ($_SESSION['s_login']) { $entity = getUserTimeTarget($_GET['HTTP_REFERER']); //Update times for this entity if ($_SESSION['s_lesson_user_type'] == 'student' && isset($_POST['user_total_time_in_unit']) && current($entity) == 'unit' && eF_checkParameter(key($entity), 'id')) { $newTime = $_POST['user_total_time_in_unit']; $jsonValues['entity'] = current($entity); $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 {
public function getControlPanelModule() { $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("T_MODULE_OPTIONS", array(array('text' => _MODULE_SECURITY_PAGE, 'image' => "{$this->moduleBaseLink}img/go_into.png", 'href' => $this->moduleBaseUrl))); $feeds = $this->getRssFeeds(); $smarty->assign("T_SECURITY_FEEDS", $feeds); try { if ($GLOBALS['configuration']['module_security_last_check'] < time() - 2 * 86400) { //check every 2 days EfrontConfiguration::setValue('module_security_last_check', time()); $file = new EfrontFile($this->getLocalListName()); $file->delete(); } $localIssues = $this->checkLocalIssues(); $smarty->assign("T_LOCAL_ISSUES", $localIssues); } catch (Exception $e) { } //Do nothing in the control panel in case of an exception return true; }
public static function getSamlAttributes() { $values = EfrontConfiguration::getValues(); return array('saml_enabled' => $values['saml_enabled'], 'saml_integration_type' => $values['saml_integration_type'], 'saml_provider' => $values['saml_provider'], 'saml_fingerprint' => $values['saml_fingerprint'], 'saml_sign_in' => $values['saml_sign_in'], 'saml_sign_out' => $values['saml_sign_out'], 'saml_targeted_id' => $values['saml_targeted_id'], 'saml_first_name' => $values['saml_first_name'], 'saml_last_name' => $values['saml_last_name'], 'saml_email' => $values['saml_email'], 'saml_bool_redirect_validate' => $values['saml_bool_redirect_validate'] ? true : false, 'saml_bool_redirect_sign' => $values['saml_bool_redirect_sign'] ? true : false); }
public function getModule() { $currentUser = $this->getCurrentUser(); // Get smarty global variable $smarty = $this->getSmartyVar(); $userRole = $currentUser->getRole($this->getCurrentLesson()); // If user is admin if ($currentUser->getType() == "administrator") { // Create form $form = new HTML_QuickForm("BBB_server_entry_form", "post", $_SERVER['REQUEST_URI'], "", null, true); $form->registerRule('checkParameter', 'callback', 'eF_checkParameter'); //Register this rule for checking user input with our function, eF_checkParameter $form->addElement('text', 'server', null, 'class = "inputText" id="server_input"'); $form->addRule('server', _BBBTHEFIELDNAMEISMANDATORY, 'required', null, 'client'); $form->addElement('text', 'salt', null, 'class = "inputText" id="salt_input"'); $form->addElement('text', 'logout_url', null, 'class = "inputText" id="logout_url_input"'); $form->addElement('checkbox', 'serverVersion', null); $form->addElement('submit', 'submit_BBB_server', _SUBMIT, 'class = "flatButton"'); // if form isSubmitted if ($form->isSubmitted() && $form->validate()) { $server_name = $form->exportValue('server'); $salt_string = $form->exportValue('salt'); $version_choice = $form->exportValue('serverVersion'); $logout_url = $form->exportValue('logout_url'); if ($server_name[strlen($server_name) - 1] == "/") { $server_name = substr($server_name, 0, strlen($server_name) - 1); } // register BBB configuration values EfrontConfiguration::setValue("module_BBB_server", $server_name); EfrontConfiguration::setValue("module_BBB_salt", $salt_string); EfrontConfiguration::setValue("module_BBB_server_version", $version_choice); EfrontConfiguration::setValue("module_BBB_logout_url", $logout_url); $this->setMessageVar(_BBB_SUCCESFULLYCHANGEDSERVER, "success"); } $form->setDefaults(array('server' => $this->getBBBServer())); $form->setDefaults(array('salt' => $this->getBBBSalt())); $form->setDefaults(array('serverVersion' => $this->getBBBServerVer())); $form->setDefaults(array('logout_url' => $this->getBBBLogoutUrl())); //echo 'My server version is 0.7+: '.$this -> getBBBServerVer(); $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty); $form->accept($renderer); $smarty->assign('T_BBB_FORM', $renderer->toArray()); } /*** Ajax Methods - Add/remove skills/jobs***/ if (isset($_GET['postAjaxRequest'])) { /** Post skill - Ajax skill **/ if (eF_checkParameter($_GET['edit_BBB'], 'id') === false) { header("HTTP/1.0 500 "); echo _UNPRIVILEGEDATTEMPT; exit; } if ($_GET['insert'] == "true") { // Adding a user to a conference eF_insertTableData("module_BBB_users_to_meeting", array('users_LOGIN' => $_GET['user'], 'meeting_ID' => $_GET['edit_BBB'])); } else { if ($_GET['insert'] == "false") { // Removing a user from a conference eF_deleteTableData("module_BBB_users_to_meeting", "users_LOGIN = '******'user'] . "' AND meeting_ID = '" . $_GET['edit_BBB'] . "'"); } else { if (isset($_GET['addAll'])) { // Add all users to a conference $users = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN LEFT OUTER JOIN module_BBB_users_to_meeting ON users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login, users.name, users.surname, meeting_ID", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND (meeting_ID <> '" . $_GET['edit_BBB'] . "' OR meeting_ID IS NULL)"); $users_attending = eF_getTableDataFlat("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN LEFT OUTER JOIN module_BBB_users_to_meeting ON users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND meeting_ID = '" . $_GET['edit_BBB'] . "'"); isset($_GET['filter']) ? $users = eF_filterData($users, $_GET['filter']) : null; $users_attending = $users_attending['login']; foreach ($users as $user) { if (!in_array($user['login'], $users_attending)) { eF_insertTableData("module_BBB_users_to_meeting", array('users_LOGIN' => $user['login'], 'meeting_ID' => $_GET['edit_BBB'])); $users_attending[] = $user['login']; } } } else { if (isset($_GET['removeAll'])) { // Remove all users from a conference $users_attending = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN LEFT OUTER JOIN module_BBB_users_to_meeting ON users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND meeting_ID = '" . $_GET['edit_BBB'] . "'"); //$users_attending = $users_attending['login']; isset($_GET['filter']) ? $users_attending = eF_filterData($users_attending, $_GET['filter']) : null; $users_to_delete = array(); foreach ($users_attending as $user) { $users_to_delete[] = $user['login']; } eF_deleteTableData("module_BBB_users_to_meeting", "meeting_ID = '" . $_GET['edit_BBB'] . "' AND users_LOGIN IN ('" . implode("','", $users_to_delete) . "')"); } else { if (isset($_GET['mail_users']) && $_GET['mail_users'] == 1) { $currentLesson = $this->getCurrentLesson(); $meeting_users = eF_getTableData("module_BBB_users_to_meeting JOIN users ON module_BBB_users_to_meeting.users_LOGIN = users.login", "users.login, users.name, users.surname, users.email", "meeting_ID = " . $_GET['edit_BBB'] . " AND users.login <> '" . $currentUser->user['login'] . "'"); isset($_GET['filter']) ? $meeting_users = eF_filterData($meeting_users, $_GET['filter']) : null; $meeting_info = eF_getTableData("module_BBB", "*", "id = " . $_GET['edit_BBB']); $subject = _BBB_MEETING; $count = 0; foreach ($meeting_users as $user) { $body = _BBB_DEAR . " " . $user['name'] . ",\n\n" . _BBB_YOUHAVEBEENINVITEDBYPROFESSOR . " " . $currentUser->user['name'] . " " . $currentUser->user['surname'] . " " . _BBB_TOATTENDACONFERENCE . " \"" . $meeting_info[0]['name'] . "\" " . _BBB_FORLESSON . " \"" . $currentLesson->lesson['name'] . "\" " . _BBB_SCHEDULEDFOR . "\n\n" . date("D d.m.y, g:i a", $meeting_info[0]['timestamp']) . "\n\n" . _BBBYOUCANJOINTHEMEETINGDIRECTLYBYCLICKINGTHEFOLLOWINGLINKAFTERITSTARTS . ":\n\n"; $userObject = EfrontUserFactory::factory($user['login']); //$body .= $this -> createBBBUrl($userObject, $meeting_info[0], true); $body .= "\n\n" . _BBB_SINCERELY . ",\n" . $currentUser->user['name'] . " " . $currentUser->user['surname']; $my_email = $currentUser->user['email']; $user_mail = $user['email']; $header = array('From' => $GLOBALS['configuration']['system_email'], 'To' => $user_mail, 'Subject' => $subject, 'Content-type' => 'text/plain;charset="UTF-8"', 'Content-Transfer-Encoding' => '7bit'); $smtp = Mail::factory('smtp', array('auth' => $GLOBALS['configuration']['smtp_auth'] ? true : false, 'host' => $GLOBALS['configuration']['smtp_host'], 'password' => $GLOBALS['configuration']['smtp_pass'], 'port' => $GLOBALS['configuration']['smtp_port'], 'username' => $GLOBALS['configuration']['smtp_user'], 'timeout' => $GLOBALS['configuration']['smtp_timeout'])); if ($smtp->send($user_mail, $header, $body)) { $count++; } } echo $count; exit; } } } } } } // The form with all students clicked or not is posted //pr($_GET); if (isset($_GET['start_meeting']) && eF_checkParameter($_GET['start_meeting'], 'id')) { $BBB_server = $this->getBBBServer(); if ($BBB_server != "") { $BBB = eF_getTableData("module_BBB", "*", "id=" . $_GET['start_meeting']); if ($BBB[0]['status'] != 2) { $BBBUrl = $this->createBBBUrl($currentUser, $BBB[0]); $smarty->assign("T_BBB_CREATEMEETINGURL", $BBBurl); // TESTING if ($currentUser->getRole($this->getCurrentLesson()) == "professor" && $meeting_info['status'] == 0) { eF_updateTableData("module_BBB", array('status' => '1'), "id=" . $_GET['start_meeting']); } //echo $BBBUrl."<BR>"; header("location:" . $BBBUrl); } else { $this->setMessageVar(_BBBMEETINGHASFINISHED, "failure"); } } else { $this->setMessageVar(_BBB_NOBBBSERVERDEFINED, "failure"); } } if (isset($_GET['finished_meeting']) && eF_checkParameter($_GET['finished_meeting'], 'id')) { if ($userRole == "professor") { eF_updateTableData("module_BBB", array('status' => '2'), "id=" . $_GET['finished_meeting']); } $currentLesson = $this->getCurrentLesson(); $_SESSION['previousSideUrl'] = G_SERVERNAME . "new_sidebar.php?new_lesson_id=" . $currentLesson->lesson['id']; $_SESSION['previousMainUrl'] = G_SERVERNAME . $currentUser->getType() . ".php?ctg=control_panel"; header("location:" . $currentUser->getType() . "page.php"); } if (isset($_GET['delete_BBB']) && eF_checkParameter($_GET['delete_BBB'], 'id') && $userRole == "professor") { eF_deleteTableData("module_BBB", "id=" . $_GET['delete_BBB']); eF_deleteTableData("module_BBB_users_to_meeting", "meeting_ID=" . $_GET['delete_BBB']); header("location:" . $this->moduleBaseUrl . "&message=" . urlencode(_BBB_SUCCESFULLYDELETEDBBBENTRY) . "&message_type=success"); } else { if ($userRole == "professor" && (isset($_GET['add_BBB']) || isset($_GET['edit_BBB']) && eF_checkParameter($_GET['edit_BBB'], 'id'))) { // Create ajax enabled table for meeting attendants if (isset($_GET['edit_BBB'])) { if (isset($_GET['ajax']) && $_GET['ajax'] == 'BBBUsersTable') { isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE); if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) { $sort = $_GET['sort']; isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc'); } else { $sort = 'login'; } $users = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN\n JOIN module_BBB ON module_BBB.lessons_ID = users_to_lessons.lessons_ID\n LEFT OUTER JOIN module_BBB_users_to_meeting ON module_BBB.id = module_BBB_users_to_meeting.meeting_ID AND users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login, users.name, users.surname, users.email, meeting_ID", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND users.login <> '" . $currentUser->user['login'] . "' AND module_BBB.id = '" . $_GET['edit_BBB'] . "'"); $users = eF_multiSort($users, $_GET['sort'], $order); if (isset($_GET['filter'])) { $users = eF_filterData($users, $_GET['filter']); } $smarty->assign("T_USERS_SIZE", sizeof($users)); if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) { isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0); $users = array_slice($users, $offset, $limit); } $smarty->assign("T_USERS", $users); $smarty->display($this->getSmartyTpl()); exit; } else { $users = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN\n JOIN module_BBB ON module_BBB.lessons_ID = users_to_lessons.lessons_ID\n LEFT OUTER JOIN module_BBB_users_to_meeting ON module_BBB.id = module_BBB_users_to_meeting.meeting_ID AND users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login, users.name, users.surname, meeting_ID", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND users.login <> '" . $currentUser->user['login'] . "' AND module_BBB.id = '" . $_GET['edit_BBB'] . "'"); $smarty->assign("T_USERS", $users); } } $form = new HTML_QuickForm("BBB_entry_form", "post", $_SERVER['REQUEST_URI'] . "&tab=users", "", null, true); $form->registerRule('checkParameter', 'callback', 'eF_checkParameter'); //Register this rule for checking user input with our function, eF_checkParameter $form->addElement('text', 'name', null, 'class = "inputText"'); $form->addRule('name', _BBBTHEFIELDNAMEISMANDATORY, 'required', null, 'client'); // Dates $days = array(); for ($i = 1; $i < 32; $i++) { $days[$i] = $i; } $months = array(); for ($i = 1; $i <= 12; $i++) { $months[$i] = $i; } $years = array(); for ($i = 2008; $i < 2015; $i++) { $years[$i] = $i; } $hours = array(); for ($i = 0; $i <= 9; $i++) { $hours[$i] = "0" . $i; } for ($i = 10; $i <= 23; $i++) { $hours[$i] = $i; } $minutes = array(); $minutes[0] = "00"; for ($i = 15; $i < 60; $i += 15) { $minutes[$i] = $i; } $duration_hours = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5); $form->addElement('select', 'day', null, $days, 'id="day"'); $form->addElement('select', 'month', null, $months, 'id="month"'); $form->addElement('select', 'year', null, $years, 'id="year"'); $form->addElement('select', 'hour', null, $hours, 'id="hour"'); $form->addElement('select', 'minute', null, $minutes, 'id="minute"'); $form->addElement('select', 'duration_hours', null, $duration_hours, 'id="duration_hours"'); $form->addElement('select', 'duration_minutes', null, $minutes, 'id="duration_minute"'); $form->addElement('select', 'lobby', _BBBUSELOBBYROOM, array("0" => _YES, "1" => _NO), 'id="lobbyId"'); $form->addElement('select', 'presenterAV', _BBBPRESENTERAV, array("0" => _BBBAUDIOVIDEO, "1" => _BBBAUDIOONLY), 'id="presenterAvID"'); $currentLesson = $this->getCurrentLesson(); $students = eF_getTableData("users_to_lessons", "count(users_LOGIN) as total_students", "lessons_ID = '" . $currentLesson->lesson['id'] . "'"); $total_students = $students[0]['total_students']; $students_count = array(); for ($i = 1; $i <= $total_students; $i++) { $students_count[$i] = $i; } $form->addElement('select', 'maxParticipants', _BBBMAXPARTICIPANTS, $students_count, ''); $form->addElement('select', 'maxMics', _BBBMAXMICS, $students_count, ''); $form->addElement('submit', 'submit_BBB', _SUBMIT, 'class = "flatButton"'); if (isset($_GET['edit_BBB'])) { $BBB_entry = eF_getTableData("module_BBB", "*", "id=" . $_GET['edit_BBB']); $timestamp_info = getdate($BBB_entry[0]['timestamp']); $form->setDefaults(array('name' => $BBB_entry[0]['name'], 'presenterAV' => $BBB_entry[0]['confType'], 'maxParticipants' => $BBB_entry[0]['maxParticipants'], 'maxMics' => $BBB_entry[0]['maxMics'], 'lobby' => $BBB_entry[0]['lobby'], 'lessons_ID' => $BBB_entry[0]['lessons_ID'])); } else { $timestamp_info = getdate(time()); $timestamp_info['minutes'] = $timestamp_info['minutes'] - $timestamp_info['minutes'] % 15; } $form->setDefaults(array('day' => $timestamp_info['mday'], 'month' => $timestamp_info['mon'], 'year' => $timestamp_info['year'], 'hour' => $timestamp_info['hours'], 'minute' => $timestamp_info['minutes'], 'maxParticipants' => $BBB_entry[0]['maxParts'] > 0 && $BBB_entry[0]['maxParts'] < $total_students ? $BBB_entry[0]['maxParts'] : $total_students, 'maxMics' => $BBB_entry[0]['maxMics'] > 0 && $BBB_entry[0]['maxMics'] < $total_students ? $BBB_entry[0]['maxMics'] : $total_students)); if ($form->isSubmitted() && $form->validate()) { if (eF_checkParameter($form->exportValue('name'), 'text')) { $smarty = $this->getSmartyVar(); $currentLesson = $this->getCurrentLesson(); $timestamp = mktime($form->exportValue('hour'), $form->exportValue('minute'), 0, $form->exportValue('month'), $form->exportValue('day'), $form->exportValue('year')); $fields = array('name' => $form->exportValue('name'), 'timestamp' => $timestamp, 'lessons_ID' => $currentLesson->lesson['id'], 'durationHours' => $form->exportValue('duration_hours'), 'durationMinutes' => $form->exportValue('duration_minutes'), 'confType' => $form->exportValue('presenterAV'), 'maxParts' => $form->exportValue('maxParticipants') > 0 ? $form->exportValue('maxParticipants') : 20, 'maxMics' => $form->exportValue('maxMics'), 'lobby' => $form->exportValue('lobby')); if (isset($_GET['edit_BBB'])) { if (eF_updateTableData("module_BBB", $fields, "id=" . $_GET['edit_BBB'])) { header("location:" . $this->moduleBaseUrl . "&message=" . urlencode(_BBB_SUCCESFULLYUPDATEDBBBENTRY) . "&message_type=success"); } else { header("location:" . $this->moduleBaseUrl . "&message=" . urlencode(_BBB_PROBLEMUPDATINGBBBENTRY) . "&message_type=failure"); } } else { // The key will be the current time when the event was set concatenated with the initial timestamp for the meeting // If the latter changes after an event editing the key will not be changed $fields['confKey'] = $currentLesson->lesson['id'] . time() . $timestamp; if ($result = eF_insertTableData("module_BBB", $fields)) { header("location:" . $this->moduleBaseUrl . "&edit_BBB=" . $result . "&message=" . urlencode(_BBB_SUCCESFULLYINSERTEDBBBENTRY) . "&message_type=success&tab=users"); } else { header("location:" . $this->moduleBaseUrl . "&message=" . urlencode(_BBB_PROBLEMINSERTINGBBBENTRY) . "&message_type=failure"); } } } else { header("location:" . $this->moduleBaseUrl . "&message=" . urlencode(_BBB_PROBLEMINSERTINGBBBENTRY) . "&message_type=failure"); } } $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty); $form->accept($renderer); $smarty->assign('T_BBB_FORM', $renderer->toArray()); } else { $currentUser = $this->getCurrentUser(); $currentLesson = $this->getCurrentLesson(); if ($currentUser->getRole($this->getCurrentLesson()) == "professor") { $BBB = eF_getTableData("module_BBB", "*", "lessons_ID = '" . $currentLesson->lesson['id'] . "'"); $smarty->assign("T_BBB_CURRENTLESSONTYPE", "professor"); } else { $BBB = eF_getTableData("module_BBB_users_to_meeting JOIN module_BBB ON id = meeting_ID", "*", "lessons_ID = '" . $currentLesson->lesson['id'] . "' AND users_LOGIN='******'login'] . "'"); $smarty->assign("T_BBB_CURRENTLESSONTYPE", "student"); } $now = time(); foreach ($BBB as $key => $meeting) { if ($meeting['timestamp'] < $now) { $BBB[$key]['mayStart'] = 1; $BBB[$key]['joiningUrl'] = $this->createBBBUrl($currentUser, $meeting, true); $smarty->assign("T_BBB_CREATEMEETINGURL", $BBB[$key]['joiningUrl']); // TESTING } else { $BBB[$key]['mayStart'] = 0; } } //pr($BBB); $smarty->assign("T_BBB", $BBB); $smarty->assign("T_USERINFO", $currentUser->user); } } return true; }
$multipleLogins = array('global' => $values['global'] ? 1 : 0, 'user_types' => $values['user_types'], 'groups' => $values['groups']); EfrontConfiguration::setValue('multiple_logins', serialize($multipleLogins)); eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=user&tab=multiple_logins&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } } $smarty->assign("T_USER_MULTIPLE_LOGINS_FORM", $userMultipleLoginsForm->toArray()); $userWebserverAuthenticationForm = new HTML_QuickForm("user_webserver_authentication_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=user&tab=webserver_authentication", "", null, true); $userWebserverAuthenticationForm->registerRule('checkParameter', 'callback', 'eF_checkParameter'); $userWebserverAuthenticationForm->addElement("advcheckbox", "webserver_auth", _WEBSERVERAUTHENTICATION, null, 'class = "inputCheckBox"', array(0, 1)); $userWebserverAuthenticationForm->addElement("advcheckbox", "webserver_registration", _WEBSERVERREGISTRATION, null, 'class = "inputCheckBox"', array(0, 1)); $userWebserverAuthenticationForm->addElement("text", "error_page", _ERRORPAGEFORINVALIDLOGIN, 'class = "inputText"'); $userWebserverAuthenticationForm->addElement("text", "unauthorized_page", _ERRORPAGEFORUNAUTHORIZED, 'class = "inputText"'); $userWebserverAuthenticationForm->addElement("text", "username_variable", _VARIABLEFORUSERNAME, 'class = "inputText"'); $userWebserverAuthenticationForm->addElement("text", "registration_file", _INCLUDEFILETHATHANDLESUSERCREATION, 'class = "inputText"'); eval('$usernameVar=' . $GLOBALS['configuration']['username_variable'] . ';'); $userWebserverAuthenticationForm->addRule('webserver_auth', str_replace(array("%x", "%y"), array($GLOBALS['configuration']['username_variable'], $_SESSION['s_login']), _VARIABLEMUSTCONTAINLOGIN), 'callback', create_function('$checkbox', "if (\$GLOBALS['usernameVar'] == \$_SESSION['s_login']) {return true;}")); $userWebserverAuthenticationForm->setDefaults($GLOBALS['configuration']); if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') { $userWebserverAuthenticationForm->freeze(); } else { $userWebserverAuthenticationForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"'); if ($userWebserverAuthenticationForm->isSubmitted() && $userWebserverAuthenticationForm->validate()) { $values = $userWebserverAuthenticationForm->exportValues(); unset($values['submit']); foreach ($values as $key => $value) { EfrontConfiguration::setValue($key, $value); } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=user&tab=webserver_authentication&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } } $smarty->assign("T_USER_WEBSERVER_AUTHENTICATION_FORM", $userWebserverAuthenticationForm->toArray());
$lockdown_form->addElement('textarea', 'lock_message', _LOCKDOWNMESSAGE, 'class = "inputContentTextarea mceEditor" style = "width:100%;height:20em;"'); $lockdown_form->addElement('checkbox', 'logout_users', null, null, 'class = "inputCheckBox"'); $lockdown_form->setDefaults(array("lock_message" => $GLOBALS['configuration']['lock_message'] ? $GLOBALS['configuration']['lock_message'] : _SYSTEMDOWNFORMAINTENANCE, "logout_users" => true)); $lockdown_form->addElement('submit', 'submit_lockdown', _LOCKDOWN, 'class = "flatButton"'); $lockdown_form->addElement('submit', 'submit_message', _SAVECHANGES, 'class = "flatButton"'); $lockdown_form->addElement('submit', 'submit_unlock', _UNLOCK, 'class = "flatButton"'); //Check here, whether the system is already locked, and present unlock button if ($lockdown_form->isSubmitted() && $lockdown_form->validate()) { //If the form is submitted and validated $values = $lockdown_form->exportValues(); if ($GLOBALS['configuration']['lock_down'] && isset($values['submit_unlock'])) { EfrontSystem::unlockSystem(); } elseif (isset($values['submit_lockdown'])) { EfrontSystem::lockSystem($values['lock_message'], $values['logout_users']); } elseif (isset($values['submit_message'])) { EfrontConfiguration::setValue('lock_message', $values['lock_message']); } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=maintenance&tab=lock_down"); } $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty); //Create a smarty renderer $lockdown_form->accept($renderer); //Assign this form to the renderer, so that corresponding template code is created $smarty->assign('T_LOCKDOWN_FORM', $renderer->toArray()); //Assign the form to the template if ($_GET['check_cleanup'] || isset($_GET['cleanup'])) { //User check $users = eF_getTableDataFlat("users", "login"); //$users_dir = eF_getDirContents(G_ROOTPATH.'upload/', '', false, false); $users_dir = scandir(G_ROOTPATH . 'upload/'); foreach ($users_dir as $key => $value) {
set_include_path($path . '../PEAR/' . PATH_SEPARATOR . $path . 'includes/' . PATH_SEPARATOR . $path . PATH_SEPARATOR . get_include_path()); //Fix IIS bug by setting the request URI setRequestURI(); //Set global defines for the system setDefines(); //Set default exception handler to be defaultExceptionHandler() function set_exception_handler('defaultExceptionHandler'); register_shutdown_function('shutdownFunction'); /** General tools for system */ require_once "tools.php"; /** Database manipulation functions*/ require_once "database.php"; /** General class representing an entity*/ require_once "entity.class.php"; //Get configuration values $configuration = EfrontConfiguration::getValues(); //Set debugging parameter if ($configuration['debug_mode'] == '1' || $_SESSION['s_login'] && in_array($_SESSION['s_login'], explode(",", $configuration['debug_mode']))) { define("G_DEBUG", 1); if (isset($_GET['debug'])) { debug(); define("NO_OUTPUT_BUFFERING", 1); } } else { define("G_DEBUG", 0); } //Turn on compressed output buffering, unless NO_OUTPUT_BUFFERING is defined or it's turned off from the configuration !defined('NO_OUTPUT_BUFFERING') && $configuration['gz_handler'] ? ob_start("ob_gzhandler") : null; //Set the memory_limit and max_execution_time PHP settings, but only if system-specific values are greater than global isset($configuration['memory_limit']) && $configuration['memory_limit'] && str_replace("M", "", ini_get('memory_limit')) < $configuration['memory_limit'] ? ini_set('memory_limit', $configuration['memory_limit'] . 'M') : null; isset($configuration['max_execution_time']) && $configuration['max_execution_time'] && ini_get('max_execution_time') < $configuration['max_execution_time'] ? ini_set('max_execution_time', $configuration['max_execution_time']) : null;
echo "<xml>"; echo "<status>error</status>"; echo "<message>This user does not exist</message>"; echo "</xml>"; break; } try { $lesson = new EfrontLesson($_GET['lesson']); $info = unserialize($lesson->lesson['info']); } catch (Exception $e) { echo "<xml>"; echo "<status>error</status>"; echo "<message>Lesson doesn't exist</message>"; echo "</xml>"; } $ef_conf = EfrontConfiguration::getValues(); $paypal_variables = array("notify_url" => G_SERVERNAME . 'ipn.php', "cmd" => "_xclick", "bn" => "efront_BuyNow_WPS_GR", "amount" => $lesson->lesson['price'], "item_name" => $lesson->lesson['name'], "custom" => $user->user['login'], "item_number" => $lesson->lesson['id'] . ":::", "charset" => "utf-8", "return" => G_SERVERNAME . 'index.php?ctg=checkout&checkout=1&return_paypal=1', "rm" => "2", "cancel_return" => G_SERVERNAME . 'index.php?ctg=checkout&checkout=1®ister_lessons=1&message=You+have+cancelled+the+transaction', "currency_code" => $GLOBALS['configuration']['currency'], "business" => strtolower($ef_conf['paypalbusiness']), "undefined_quantity" => "0", "address_override" => "1", "upload" => "1", "no_note" => "1", "no_shipping" => "1", "cbt" => "Return to " . $ef_conf['site_name']); $paypal_url = "https://www.paypal.com/cgi-bin/webscr"; $query_string = "?"; foreach ($paypal_variables as $name => $value) { $query_string .= $name . "=" . $value . "&"; } $redirect_url = $paypal_url . urlencode($query_string); echo "<xml>"; echo "<redirect_url>" . $redirect_url . "</redirect_url>"; echo "</xml>"; } else { echo "<xml>"; echo "<status>error</status>"; echo "<message>Invalid token</message>"; echo "</xml>";
$appearanceFaviconForm->freeze(); } else { $appearanceFaviconForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"'); if ($appearanceFaviconForm->isSubmitted() && $appearanceFaviconForm->validate()) { try { //If the form is submitted and validated if ($appearanceFaviconForm->exportValue('default_favicon')) { EfrontConfiguration::setValue('favicon', ''); } else { $faviconDirectory = new EfrontDirectory(G_LOGOPATH); $filesystem = new FileSystemTree(G_LOGOPATH); try { $faviconFile = $filesystem->uploadFile('favicon', $logoDirectory); if (strpos($faviconFile['mime_type'], 'image') === false) { throw new EfrontFileException(_NOTANIMAGEFILE, EfrontFileException::NOT_APPROPRIATE_TYPE); } EfrontConfiguration::setValue('favicon', $faviconFile['id']); clearTemplatesCache(); } catch (Exception $e) { if ($e->getCode() != UPLOAD_ERR_NO_FILE) { throw $e; } } } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=appearance&tab=favicon&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } catch (Exception $e) { handleNormalFlowExceptions($e); } } } $smarty->assign("T_APPEARANCE_FAVICON_FORM", $appearanceFaviconForm->toArray());
if (!$GLOBALS['configuration']['notifications_lock'] || time() - $GLOBALS['configuration']['notifications_lock'] > 600) { //10 minutes maximum lock time EFrontConfiguration::setValue('notifications_lock', time()); $sent_messages = EfrontNotification::sendNextNotifications($GLOBALS['configuration']['notifications_messages_per_time']); EFrontConfiguration::setValue('notifications_lock', 0); } else { chdir($dir); echo "locked"; exit; } } } //pr($sent_messages); //debug(false); if ($GLOBALS['configuration']['notifications_maximum_inter_time'] > 0) { EfrontConfiguration::setValue('notifications_last_send_timestamp', time()); } if ($sent_messages) { EfrontNotification::clearSentMessages(); } if ((!isset($hide_messages) || !$hide_messages) && !isset($_GET['ajax']) && basename($_SERVER['PHP_SELF']) != 'crontab_notifications.php') { if ($sent_messages) { $message = $sent_messages . " notification emails sent successfully"; $message_type = "success"; } else { $message = "No notification emails have been sent"; $message_type = "failure"; } eF_redirect($_SESSION['s_type'] . ".php?ctg=digests&message={$message}&message_type={$message_type}&tab=messages_queue"); } else { if (!isset($message)) {
/* $socialModulesToBeActivated = EfrontUser::isOptionVisible('system_timeline') & EfrontUser::isOptionVisible('lessons_timeline') & EfrontUser::isOptionVisible('func_people') & EfrontUser::isOptionVisible('func_comments') & EfrontUser::isOptionVisible('func_userstatus'); vd($socialModulesToBeActivated); */ //EfrontConfiguration :: setValue('social_modules_activated', $socialModulesToBeActivated); // Create the new binary map $socialValues = array('mode_system_timeline', 'mode_lessons_timeline', 'mode_func_people', 'mode_func_comments', 'mode_func_userstatus'); $socialModulesToBeActivated = ''; foreach ($values as $key => $value) { if ($value == 1 && in_array($key, $socialValues) !== false) { $socialModulesToBeActivated = $socialModulesToBeActivated . strval($value); } } $socialModulesToBeActivated = intval($socialModulesToBeActivated, 2); EfrontConfiguration::setValue('social_modules_activated', $socialModulesToBeActivated); if ($values['mode_payments'] == 0) { eF_updateTableData("lessons", array('price' => 0), "id=id"); eF_updateTableData("courses", array('price' => 0), "id=id"); } if ($values['mode_simple_complete'] == 0) { eF_updateTableData("users", array('simple_mode' => 0)); } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=customization&tab=disable&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } } $smarty->assign("T_MODE_FORM", $modeForm->toArray());
$config_form->addRule('notifications_messages_per_time', _THEFIELD . ' "' . _MESSAGESTOSENDEVERYTIME . '" ' . _ISMANDATORY, 'required', null, 'client'); $config_form->addElement('text', 'notifications_max_sent_messages', _MAXIMUMSENTMESSAGESSTORED, 'class = "inputText"'); $config_form->addRule('notifications_max_sent_messages', _POSITIVENUMBERREQUIRED, 'callback', create_function('$a', 'return ($a > 0);')); //The score must be between 0 and 100 $config_form->addRule('notifications_max_sent_messages', _THEFIELD . ' "' . _MAXIMUMSENTMESSAGESSTORED . '" ' . _MUSTBENUMERIC, 'numeric', null, 'client'); $config_form->addRule('notifications_max_sent_messages', _THEFIELD . ' "' . _MAXIMUMSENTMESSAGESSTORED . '" ' . _ISMANDATORY, 'required', null, 'client'); $config_form->addElement('select', 'notifications_send_mode', _SENDMODE, array(_EMAIL, _PERSONALMESSAGE, _EMAILANDPM)); $config_form->addRule('notifications_max_sent_messages', _THEFIELD . ' "' . _MAXIMUMSENTMESSAGESSTORED . '" ' . _MUSTBENUMERIC, 'numeric', null, 'client'); $config_form->addElement('submit', 'submit_variables', _SUBMIT, 'class = "flatButton"'); $notification_configurations = array('notifications_use_cron', 'notifications_pageloads', 'notifications_maximum_inter_time', 'notifications_messages_per_time', 'notifications_max_sent_messages', 'notifications_send_mode'); foreach ($notification_configurations as $conf_option) { $config_form->setDefaults(array($conf_option => $GLOBALS['configuration'][$conf_option])); } if ($config_form->isSubmitted()) { foreach ($notification_configurations as $conf_option) { EfrontConfiguration::setValue($conf_option, $config_form->exportValue($conf_option)); } // Clear the stored sent messages according to the new limitations EfrontNotification::clearSentMessages(); $message = _NOTIFICATIONCONFIGURATIONSUPDATEDSUCCESSFULLY; $message_type = 'success'; eF_redirect("" . $_SESSION['s_type'] . ".php?ctg=digests&message=" . urlencode($message) . "&message_type=" . $message_type); } $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty); //Create a smarty renderer $renderer->setRequiredTemplate('{$html}{if $required} <span class = "formRequired">*</span> {/if}'); if (isset($currentUser->coreAccess['notifications']) && $currentUser->coreAccess['notifications'] != 'change') { $config_form->freeze(); }
/** * Get the list of users that are currently online * * This function is used to get a list of the users that are currently online * In addition, it logs out any inactive users, based on global setting * <br>Example: * <code> * $online = EfrontUser :: getUsersOnline(); * </code> * * @param boolean $userType Return only users of the basic type $user_type * @param int $interval The idle interval above which a user is logged out. If it's not specified, no logging out takes place * @return array The list of online users * @since 3.5.0 * @access public */ public static function getUsersOnline($interval = false) { $usersOnline = array(); //A user may have multiple active entries on the user_times table, one for system, one for unit etc. Pick the most recent $result = eF_getTableData("user_times,users", "users.login, users.name, users.surname, users.user_type, timestamp_now, session_timestamp, session_id", "users.login=user_times.users_LOGIN and session_expired=0", "timestamp_now desc"); foreach ($result as $value) { if (!isset($parsedUsers[$value['login']])) { if (time() - $value['timestamp_now'] < $interval || !$interval) { $usersOnline[] = array('login' => $value['login'], 'formattedLogin' => formatLogin($value['login'], $value), 'user_type' => $value['user_type'], 'timestamp_now' => $value['timestamp_now'], 'session_timestamp' => $value['session_timestamp'], 'time' => EfrontTimes::formatTimeForReporting(time() - $value['session_timestamp'])); } else { //pr($result); //pr("interval: $interval, time: ".time().", timestamp_now:".$value['timestamp_now']); EfrontUserFactory::factory($value['login'])->logout($value['session_id']); //exit; } $parsedUsers[$value['login']] = true; } } $online_users = sizeof($result); if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if (G_VERSIONTYPE != 'standard') { #cpp#ifndef STANDARD $threshold = $GLOBALS['configuration']['max_online_users_threshold']; if ($threshold > 0 && $online_users > $threshold && time() > $GLOBALS['configuration']['max_online_users_threshold_timestamp'] + 24 * 60 * 60) { $admin = EfrontSystem::getAdministrator(); eF_mail($GLOBALS['configuration']['system_email'], $admin->user['email'], _ONLINEUSERSMAIL, str_replace(array('%w', '%x', '%y', '%z'), array($admin->user['name'], $threshold, $GLOBALS['configuration']['site_name'], G_SERVERNAME), _ONLINEUSERSMAILBODY)); EfrontConfiguration::setValue('max_online_users_threshold_timestamp', time()); } } #cpp#endif } #cpp#endif if ($GLOBALS['configuration']['max_online_users'] < $online_users) { EfrontConfiguration::setValue('max_online_users', $online_users); EfrontConfiguration::setValue('max_online_users_timestamp', time()); } if (G_VERSIONTYPE == 'enterprise' && defined("G_BRANCH_URL") && G_BRANCH_URL && $_SESSION['s_current_branch']) { $branch = new EfrontBranch($_SESSION['s_current_branch']); $branchUsers = $branch->getBranchTreeUsers(); foreach ($usersOnline as $key => $value) { if (!isset($branchUsers[$value['login']]) && $value['user_type'] != 'administrator') { unset($usersOnline[$key]); } } } return $usersOnline; }
define("USERNAME","' . $defaultConfig['phplivedocx_username'] . '"); define("PASSWORD","' . $defaultConfig['phplivedocx_password'] . '"); define("PHPLIVEDOCXAPI","' . $defaultConfig['phplivedocx_server'] . '"); ?>'; file_put_contents($path . "phplivedocx_config.php", $phplivedocxConfig); eF_updateTableData("users", array('email' => $values['admin_email'], 'password' => EfrontUser::createPassword($values['admin_password']), 'last_login' => '0')); eF_updateTableData("users", array('login' => $values['admin_name']), "id=1"); eF_updateTableData("courses", array('created' => time())); eF_updateTableData("courses", array('created' => time(), 'creator_LOGIN' => $values['admin_name'])); eF_updateTableData("lessons", array('created' => time(), 'creator_LOGIN' => $values['admin_name'])); eF_updateTableData("users_to_courses", array('from_timestamp' => time())); eF_updateTableData("users_to_lessons", array('from_timestamp' => time())); eF_deleteTableData("logs", ""); eF_deleteTableData("events", ""); EfrontConfiguration::setValue("database_version", G_VERSION_NUM); EfrontConfiguration::setValue("system_Email", $values['admin_email']); $file = new EfrontFile(EfrontDirectory::normalize(getcwd()) . '/lessons.zip'); $newFile = $file->copy(G_LESSONSPATH, true); $newFile->uncompress(); $newFile->delete(); if (G_VERSIONTYPE == 'community') { #cpp#ifdef COMMUNITY $modulesToRemove[] = 'content_reports'; $modulesToRemove[] = 'course_reports'; $modulesToRemove[] = 'fuze_meetings'; $modulesToRemove[] = 'training_reports'; } #cpp#endif if (G_VERSIONTYPE != 'enterprise') { #cpp#ifndef ENTERPRISE $modulesToRemove[] = 'branch_reports';