public function connectedToUser($network_code, $user_idst = false) { $res = false; $user_idst = $user_idst > 0 ? $user_idst : getLogUserId(); if (!isset($this->_userinfo[$user_idst])) { $acl_man = Docebo::user()->getAclManager(); $this->_userinfo[$user_idst] = $acl_man->getUser($user_idst, false); } switch ($network_code) { case 'twitter': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_TWITTER_ID]); break; case 'linkedin': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_LINKEDIN_ID]); break; case 'facebook': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_FACEBOOK_ID]); break; case 'google': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_GOOGLE_ID]); break; case 'google_apps': $res = true; break; } return $res; }
public function __construct($mvc_name) { parent::__construct($mvc_name); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); }
/** * @return string the actual template name */ function getTemplate() { // If saved in session use this one if (isset($_SESSION['template']) && $_SESSION['template'] != false) { return $_SESSION['template']; } //search for a template associated to the current host $plat_templ = parseTemplateDomain($_SERVER['HTTP_HOST']); if ($plat_templ != false) { $_SESSION['template'] = $plat_templ; return $plat_templ; } // search template according to the org_chart_tree option if (!Docebo::user()->isAnonymous()) { $qtxt = "SELECT associated_template FROM\r\n\t\t\t%adm_org_chart_tree\r\n\t\t\tWHERE associated_template IS NOT NULL AND\r\n\t\t\tidst_oc IN (" . implode(',', Docebo::user()->getArrSt()) . ")\r\n\t\t\tORDER BY iLeft DESC\r\n\t\t\tLIMIT 0,1"; $re = sql_query($qtxt); if (mysql_num_rows($re) > 0) { list($template_code) = sql_fetch_row($re); setTemplate($template_code); return $_SESSION['template']; } } // search for the default template $_SESSION['template'] = getDefaultTemplate(); return $_SESSION['template']; }
function drawCalendar() { checkPerm('view'); $size = importVar('size', false, 'max'); $width = "90%"; if ($size == "min") { $width = "200px"; } addCss('calendar_' . $size); YuiLib::load('base,dragdrop'); Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar.js', true, true); Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar_helper.js', true, true); //permissions = permissions granted to the logged user according to his/her level and role // 2 => can create/delete/modify all events // 1 => can create/delete/modify only own events // 0 => can view only $permissions = 0; if (checkPerm('mod', true)) { $permissions = 2; } elseif (checkPerm('personal', true)) { $permissions = 1; } //mode="edit" => events can be added and edited according to given permissions //mode="view" => events can only be viewed regardless the permissions $GLOBALS['page']->add('<script type="text/javascript">' . ' setup_cal( null, ' . '\'lms\', ' . '\'lms\', ' . '\'edit\', ' . '\'' . $permissions . '\', ' . '\'' . Docebo::user()->getIdSt() . '\' ' . ');' . '</script>', 'page_head'); $GLOBALS['page']->add("\n" . getTitleArea(Lang::t('_CALENDAR', 'calendar'), 'calendar') . '<div class="std_block">' . '<div id="displayCalendar" style="clear: both; width:' . $width . '"></div>' . '<div class="nofloat"></div>' . '</div>', 'content'); }
public function authenticateUser($username, $password) { $acl_man = Docebo::user()->getAclManager(); $query = "SELECT * FROM %adm_user " . "WHERE userid='" . $this->aclManager->absoluteId($username) . "' AND pass='******'"; $res = $this->db->query($query); return $this->db->num_rows($res) > 0; }
function assignVar() { $this->id = importVar("id"); $this->calEventClass = importVar("calEventClass"); $this->start_year = importVar("start_year"); $this->start_month = importVar("start_month"); $this->start_day = importVar("start_day"); $this->_year = $this->start_year; $this->_month = $this->start_month; $this->_day = $this->start_day; $this->start_hour = importVar("start_hour"); $this->start_min = importVar("start_min"); $this->start_sec = importVar("start_sec"); $this->end_year = importVar("end_year"); $this->end_month = importVar("end_month"); $this->end_day = importVar("end_day"); $this->end_hour = importVar("end_hour"); $this->end_min = importVar("end_min"); $this->end_sec = importVar("end_sec"); $this->title = importVar("title"); $this->description = importVar("description"); $this->_owner = importVar("_owner"); if (!$this->_owner) { $this->_owner == Docebo::user()->getIdSt(); } $this->category = importVar("category"); $this->private = importVar("private"); }
public function init() { YuiLib::load('base,tabview'); Lang::init('course'); $this->model = new VideoconferenceLms(Docebo::user()->getIdSt()); $upd = new UpdatesLms(); $this->info = $upd->videoconferenceCounterUpdates(); }
/** * Return the link for the logout * @return <type> */ public static function logout() { $res = ""; if (!Docebo::user()->isAnonymous()) { $res .= '<a href="index.php?action=logout">' . Get::img('standard/exit.png', Lang::t('_LOG_LOGOUT')) . Lang::t('_LOG_LOGOUT') . '</a>'; } return $res; }
public function init() { parent::init(); require_once _base_ . '/lib/lib.json.php'; $this->model = new AdminrulesAdm(); $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); }
public function __construct() { require_once _base_ . '/lib/lib.preference.php'; $this->preference = new AdminPreference(); $this->acl_man =& Docebo::user()->getAclManager(); $this->rules_path = '/framework/adminrules/'; $this->rules_cache = NULL; }
public function __construct() { require_once _base_ . '/lib/lib.preference.php'; $this->preference = new AdminPreference(); $this->acl_man =& Docebo::user()->getAclManager(); list($idst) = each($this->acl_man->getGroupsIdstFromBasePath('/framework/level/admin')); $this->idst_admin_group = $idst; $this->model_adminrules = new AdminrulesAdm(); }
public function init() { parent::init(); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); $this->model = new LabelAlms(); $this->permissions = array('view' => checkPerm('view', true, 'label', 'lms'), 'add' => true, 'mod' => true, 'del' => true); }
function sl_sal_getUserName() { /*$dbconn = $GLOBALS['dbConn']; $result = sql_query("SELECT surname,name FROM ".$GLOBALS['prefix_lms']."_user WHERE idUser="******""); list($surname, $name) = mysql_fetch_array($result);*/ $aclManager = Docebo::user()->getACLManager(); $arr_result = $aclManager->getUser(Docebo::user()->getIdSt(), FALSE); return $arr_result[ACL_INFO_LASTNAME] . ',' . $arr_result[ACL_INFO_FIRSTNAME]; }
public function __construct($id_course = 0, $id_edition = 0) { require_once _lms_ . '/lib/lib.edition.php'; require_once _lms_ . '/lib/lib.course.php'; $this->edition_man = new EditionManager(); $this->course_man = new Man_Course(); $this->acl_man =& Docebo::user()->getAclManager(); $this->id_course = $id_course; $this->id_edition = $id_edition; }
public function init() { require_once _base_ . '/lib/lib.json.php'; $this->db = DbConn::getInstance(); $this->model = new MessageLms(); $this->json = new Services_JSON(); $this->aclManager = Docebo::user()->getAClManager(); $this->can_send = true; //checkPerm('send_all', true) || checkPerm('send_upper', true); }
/** * function learning_Object() * class constructor **/ function Learning_Object($id = NULL, $environment = false) { $this->id = $id; $this->environment = $environment ? $environment : 'course_lo'; $this->idAuthor = ''; $this->title = ''; $this->db = DbConn::getInstance(); $this->aclManager = Docebo::user()->getAclManager(); $this->table = ''; }
function actionEvent(&$event) { require_once $GLOBALS['where_lms'] . '/lib/lib.subscribe.php'; parent::actionEvent($event); $acl_man =& Docebo::user()->getACLManager(); // recover event information $id_user = $event->getProperty('userdeleted'); $man_subs = new CourseSubscribe_Management(); $man_subs->unsubscribeUserFromAllCourses($id_user); return true; }
function checkRole($roleid, $return_value = true) { if (Docebo::user()->matchUserRole($roleid)) { return true; } if ($return_value) { return false; } else { die("You can't access"); } }
public function init() { YuiLib::load('base,tabview'); Lang::init('course'); $this->path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/'; $this->model = new HomecatalogueLms(); $this->model_catalog = new CatalogLms(); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); }
public function __construct($id_course = 0, $id_date = 0) { require_once _lms_ . '/lib/lib.date.php'; require_once _lms_ . '/lib/lib.course.php'; $this->id_course = $id_course; $this->id_date = $id_date; $this->db = DbConn::getInstance(); $this->classroom_man = new DateManager(); $this->course_man = new Man_Course(); $this->acl_man =& Docebo::user()->getAclManager(); }
function lmsLoginOperation() { require_once $GLOBALS['where_lms'] . '/lib/lib.subscribe.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.preassessment.php'; $pa_man = new AssessmentList(); $user_course_as_assessment = $pa_man->getUserAssessmentSubsription(Docebo::user()->getArrSt()); if (is_array($user_course_as_assessment)) { $subs_man = new CourseSubscribe_Management(); $subs_man->multipleUserSubscribe(getLogUserId(), $user_course_as_assessment['course_list'], $user_course_as_assessment['level_number']); } }
public function completedTask() { $model = new AssessmentLms(); $courselist = $model->findAll(array('cu.iduser = :id_user', 'cu.status = :status', 'c.course_type = ":course_type"'), array(':id_user' => Docebo::user()->getId(), ':status' => _CUS_END, ':course_type' => 'assessment')); //check courses accessibility $keys = array_keys($courselist); for ($i = 0; $i < count($keys); $i++) { $courselist[$keys[$i]]['can_enter'] = Man_Course::canEnterCourse($courselist[$keys[$i]]); } $this->render('courselist', array('path_course' => $this->path_course, 'courselist' => $courselist)); }
public function init() { checkPerm('view', false, 'course', 'lms'); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); $this->base_link_course = 'alms/course'; $this->base_link_edition = 'alms/edition'; $this->base_link_subscription = 'alms/subscription'; $this->permissions = array('view' => checkPerm('view', true, 'course', 'lms'), 'add' => checkPerm('add', true, 'course', 'lms'), 'mod' => checkPerm('mod', true, 'course', 'lms'), 'del' => checkPerm('del', true, 'course', 'lms'), 'moderate' => checkPerm('moderate', true, 'course', 'lms'), 'subscribe' => checkPerm('subscribe', true, 'course', 'lms')); }
public function init() { checkPerm('view', false, 'pcourse'); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); $this->model = new ClassroomAlms(); $this->base_link_course = 'lms/pcourse'; $this->base_link_classroom = 'lms/pclassroom'; $this->base_link_subscription = 'lms/psubscription'; $this->permissions = array('view' => checkPerm('view', true, 'pcourse'), 'add' => checkPerm('add', true, 'pcourse'), 'mod' => checkPerm('mod', true, 'pcourse'), 'del' => checkPerm('del', true, 'pcourse'), 'moderate' => checkPerm('moderate', true, 'pcourse'), 'subscribe' => checkPerm('subscribe', true, 'pcourse')); $this->_mvc_name = 'classroom'; }
function getFolderFormIdst(&$arr_idst) { $acl_man =& Docebo::user()->getAclManager(); $groups_id = $acl_man->getGroupsId($arr_idst); $folder_name = $this->tree_db->getFoldersCurrTranslationDoubleCheck($groups_id); $branch_name = array(); while (list($id, $groupid) = each($groups_id)) { $id_dir = split('_', $groupid); $branch_name[$id]['name'] = $folder_name[$id_dir[1]]; $branch_name[$id]['type_of_folder'] = $id_dir[0] == '/oc' ? ORG_CHART_NORMAL : ORG_CHART_WITH_DESCENDANTS; } return $branch_name; }
function actionEvent(&$event) { parent::actionEvent($event); $event_throw = $event->getClassName(); switch ($event_throw) { case "UserDel": $id_user = $event->getProperty('userdeleted'); // remove user from associated $acl_man =& Docebo::user()->getAclmanager(); $acl_man->removeFromAllGroup($id_user); break; } return true; }
public function getCourseUsers($idCourse) { $output = false; $query = "SELECT cu.idUser, u.userid FROM %lms_courseuser as cu JOIN %adm_user as u ON (u.idst=cu.idUser) WHERE cu.idCourse=" . (int) $idCourse; $res = $this->db->query($query); if ($res) { $output = array(); $acl_man = Docebo::user()->getAclManager(); while (list($idUser, $userName) = $this->db->fetch_row($res)) { $output[$idUser] = $acl_man->relativeId($userName); } } return $output; }
function reportList() { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('report', 'framework'); $_SESSION['report_tempdata'] = array(); $can_mod = checkPerm('mod', true); $acl_man = Docebo::aclm(); $public_admin_mod = true; $query = "SELECT t1.*, t2.userid \r\n\tFROM %lms_report_filter as t1 \r\n\t\tLEFT JOIN %adm_user as t2 ON t1.author=t2.idst\r\n\tWHERE t1.is_public = 1 OR t1.author = " . Docebo::user()->getId(); $tb = new Table(); $tb->initNavBar('ini', 'button'); $col_type = array('', 'align_center', 'align_center', 'image'); $col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR', 'report', 'framework'), $lang->def('_CREATION_DATE'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS') . '" title="' . $lang->def('REPORT_SHOW_RESULTS') . '" />'); if ($public_admin_mod && $can_mod) { $col_type[] = 'image'; $col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>'; $col_type[] = 'image'; $col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '"/>'; } $tb->setColsStyle($col_type); $tb->addHead($col_content); $res = sql_query($query); if ($res) { while ($row = sql_fetch_assoc($res)) { $id = $row['id_filter']; $opn_link = '<a href="index.php?modname=public_report_admin&op=view_report&idrep=' . $id . '" ' . ' title="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '" />' . '</a>'; $tb_content = array($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'], $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), Format::date($row['creation_date']), $opn_link); if ($public_admin_mod && $can_mod) { if ($row['author'] == Docebo::user()->getId()) { $tb_content[] = '<a href="index.php?modname=public_report_admin&op=modify_name&modid=' . $id . '" ' . ' title="' . $lang->def('_MOD', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'report', 'framework') . '" />' . '</a>'; } else { $tb_content[] = ''; } if ($row['author'] == Docebo::user()->getId()) { $tb_content[] = '<a href="index.php?modname=public_report_admin&op=del_public_report&idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'report', 'framework') . '" />' . '</a>'; } else { $tb_content[] = ''; } } $tb->addBody($tb_content); } } require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=del_public_report]'); if ($public_admin_mod && $can_mod) { $tb->addActionAdd('<a href="index.php?modname=public_report_admin&op=create_name">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>'); } cout(getTitleArea($lang->def('_REPORT')) . '<div class="std_block">' . $tb->getTable() . '</div>', 'content'); }
/** * @param array $predefined_data * @param array $custom_data * @param integer $id user id; if 0 a new user will be created * @param boolean $dropdown_id if true will take dropdown values as id; * else will search the id starting from the value. */ function saveFields($predefined_data, $custom_data, $id = 0, $dropdown_id = TRUE) { require_once $GLOBALS["where_crm"] . "/modules/company/lib.company.php"; // TODO: at this moment the function works only for user creation; // does not update the user if it already exists $acl =& Docebo::user()->getACL(); $acl_manager =& Docebo::user()->getAclManager(); $data = array(); $userid = $predefined_data["userid"]; $firstname = $predefined_data["firstname"]; $lastname = $predefined_data["lastname"]; $pass = $predefined_data["pass"]; $email = $predefined_data["email"]; if (!empty($userid)) { $idst = $acl_manager->registerUser($userid, $firstname, $lastname, $pass, $email, '', ''); } else { $idst = FALSE; } if ($idst !== false) { // -- Add user to registered users group if not importing into root --- $idst_oc = $acl_manager->getGroup(false, '/oc_0'); $idst_oc = $idst_oc[ACL_INFO_IDST]; $idst_ocd = $acl_manager->getGroup(false, '/ocd_0'); $idst_ocd = $idst_ocd[ACL_INFO_IDST]; $acl_manager->addToGroup($idst_oc, $idst); $acl_manager->addToGroup($idst_ocd, $idst); // -------------------------------------------------------------------| // add to group level $userlevel = $acl_manager->getGroupST(ADMIN_GROUP_USER); $acl_manager->addToGroup($userlevel, $idst); // -- Custom fields ---------------------------------------------------- require_once $GLOBALS["where_framework"] . "/lib/lib.field.php"; $res = array(); $fl = new FieldList(); $custom_fields = array_keys($this->getCustomFields(FALSE)); $field_info_arr = $fl->getFieldsFromIdst($custom_fields); foreach ($custom_fields as $field_id) { // store direct if (isset($custom_data[$field_id])) { $field_obj =& $fl->getFieldInstance($field_id); // $field_obj->setFieldEntryTable($company_entry_table); $field_obj->storeDirect($idst, $custom_data[$field_id], $dropdown_id, FALSE, TRUE); } } } return $idst; }
function env_play($lobj, $options) { list($file) = sql_fetch_row(sql_query("SELECT path" . " FROM %lms_materials_lesson" . " WHERE idLesson = " . (int) $lobj->id . "")); if (!$file) { Util::jump_to($lobj->back_url); } $id_param = $lobj->getIdParam(); if ($lobj->id_reference != false) { require_once _lms_ . '/class.module/track.item.php'; $ti = new Track_Item($lobj, Docebo::user()->getIdSt()); // need id_resource, id_reference, type and environment $ti->setDate(date('Y-m-d H:i:s')); $ti->status = 'completed'; $ti->update(); } Util::download('/appLms/' . Get::sett('pathlesson'), $file); }