Example #1
0
function profile()
{
    checkPerm('view');
    require_once $GLOBALS['where_lms'] . '/lib/lib.lms_user_profile.php';
    $lang =& DoceboLanguage::createInstance('profile', 'framework');
    $profile = new LmsUserProfile(getLogUserId());
    $profile->init('profile', 'framework', 'modname=profile&op=profile&id_user='******'ap');
    if (checkPerm('mod', true)) {
        $profile->enableEditMode();
    }
    if (Get::sett('profile_only_pwd') == 'on') {
        $GLOBALS['page']->add($profile->getTitleArea() . $profile->getHead() . $profile->performAction(false, 'mod_password') . profileBackUrl() . $profile->getFooter(), 'content');
    } else {
        $GLOBALS['page']->add($profile->getTitleArea() . $profile->getHead() . $profile->performAction() . profileBackUrl() . $profile->getFooter(), 'content');
    }
}
 public function show()
 {
     if (!defined("LMS")) {
         checkRole('/lms/course/public/profile/view', false);
     } else {
         checkPerm('view', false, 'profile', 'lms');
     }
     require_once _lms_ . '/lib/lib.lms_user_profile.php';
     $id_user = Docebo::user()->getIdST();
     $profile = new LmsUserProfile($id_user);
     $profile->init('profile', 'framework', 'r=lms/profile/show', 'ap');
     //'modname=profile&op=profile&id_user='******'/lms/course/public/profile/mod', true);
     } else {
         $_check = checkPerm('mod', true, 'profile', 'lms');
     }
     if ($_check) {
         $profile->enableEditMode();
     }
     //view part
     if (Get::sett('profile_only_pwd') == 'on') {
         echo $profile->getTitleArea();
         echo $profile->getHead();
         echo $profile->performAction(false, 'mod_password');
         echo $this->_profileBackUrl();
         echo $profile->getFooter();
     } else {
         echo $profile->getTitleArea();
         echo $profile->getHead();
         echo $profile->performAction();
         echo $this->_profileBackUrl();
         echo $profile->getFooter();
     }
 }
Example #3
0
 function addSubscription()
 {
     checkPerm('view');
     require_once _base_ . '/lib/lib.form.php';
     $action = importVar('action', true, 0);
     $id_event = importVar('id_event', true, 0);
     $lang =& DoceboLanguage::createInstance('reservation');
     $out = $GLOBALS['page'];
     $out->setWorkingZone('content');
     $man_res = new Man_Reservation();
     if (isset($_POST['save_profile'])) {
         $confirm = importVar('confirm', true, 0);
         if ($confirm) {
             require_once $GLOBALS['where_lms'] . '/lib/lib.lms_user_profile.php';
             $out->add(getTitleArea('_RESERVATION_PROFILE_MODIFY') . '<div class="std_block">', 'content');
             $profile = new LmsUserProfile(getLogUserId(), true);
             $profile->init('subscription', 'lms', 'modname=reservation&op=add_subscription&id_event=' . $id_event . '&confirm=1&from=2&id_user='******'ap');
             $out->add($profile->getTitleArea() . $profile->getHead() . $profile->performAction() . $profile->getFooter() . '</div>', 'content');
         }
     } elseif (isset($_GET['confirm'])) {
         $confirm = importVar('confirm', true, 0);
         if ($confirm) {
             require_once $GLOBALS['where_lms'] . '/lib/lib.lms_user_profile.php';
             $out->add(getTitleArea($lang->def('_RESERVATION_PROFILE_MODIFY')) . '<div class="std_block">', 'content');
             $out->add($lang->def('_CONFIRM_DATA') . '<br/>');
             $profile = new LmsUserProfile(getLogUserId(), true);
             $profile->init('subscription', 'lms', 'modname=reservation&op=add_subscription&id_event=' . $id_event . '&confirm=1&from=2&id_user='******'ap');
             //$profile->enableEditMode();
             $out->add($profile->getTitleArea() . $profile->getHead() . $profile->performAction() . $profile->getFooter() . '</div>', 'content');
         }
     } else {
         $event_info = $man_res->getEventInfo($id_event);
         $out->add(getTitleArea($lang->def('_ADD_SUBSCRIPTION_TITLE'), '', $lang->def('_EVENT')) . '<div class="std_block">' . getModifyUi($lang->def('_AREYOUSURE_ADD_SUBSCRIPTION'), $event_info[EVENT_TITLE], true, 'index.php?modname=reservation&amp;op=add_subscription&amp;id_event=' . $id_event . '&amp;confirm=1&amp;ap=mod_profile&amp;from=2', 'index.php?modname=reservation&amp;op=reservation') . '</div>', 'content');
     }
 }
Example #4
0
function viewprofile()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.usermanager.php';
    $lang =& DoceboLanguage::createInstance('forum');
    $id_message = importVar('idMessage');
    $ini = importVar('ini', true, 1);
    $idThread = importVar('idThread', true, 1);
    list($id_thread, $idst_user) = sql_fetch_row(sql_query("\r\n\tSELECT idThread, author\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\tWHERE idMessage = '" . $id_message . "'"));
    require_once $GLOBALS['where_lms'] . '/lib/lib.lms_user_profile.php';
    $lang =& DoceboLanguage::createInstance('profile', 'framework');
    $profile = new LmsUserProfile($idst_user);
    $profile->init('profile', 'framework', 'modname=forum&op=viewprofile&idMessage=' . $id_message . '&ini=' . $ini, 'ap');
    $GLOBALS['page']->add($profile->getTitleArea() . $profile->getHead() . forumBackUrl() . $profile->performAction() . $profile->getFooter(), 'content');
}