Esempio n. 1
0
 /**
  * Load published modules
  *
  * @access	private
  * @return	array
  */
 function &_load()
 {
     global $mainframe, $Itemid;
     static $modules;
     if (isset($modules)) {
         return $modules;
     }
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     $aid = $user->get('aid', 0);
     $modules = array();
     $wheremenu = isset($Itemid) ? ' AND ( mm.menuid = ' . (int) $Itemid . ' OR mm.menuid = 0 )' : '';
     $query = 'SELECT id, title, module, position, content, showtitle, control, params' . ' FROM #__modules AS m' . ' LEFT JOIN #__modules_menu AS mm ON mm.moduleid = m.id' . ' WHERE m.published = 1' . ' AND m.access <= ' . (int) $aid . ' AND m.client_id = ' . (int) $mainframe->getClientId() . $wheremenu . ' ORDER BY position, ordering';
     $db->setQuery($query);
     if (null === ($modules = $db->loadObjectList())) {
         JError::raiseWarning('SOME_ERROR_CODE', JText::_('Error Loading Modules') . $db->getErrorMsg());
         return false;
     }
     // cACL module check
     if (class_exists('CACL_config')) {
         $config = new CACL_config($db);
         $config->load();
         //$this->_caclConfig = $config;
         self::$_caclConfig = $config;
         $app =& JFactory::getApplication();
         if (FALSE !== strpos(self::$_caclConfig->activate, $app->getName())) {
             check_modules($modules);
         }
     }
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         //determine if this is a custom module
         $file = $modules[$i]->module;
         $custom = substr($file, 0, 4) == 'mod_' ? 0 : 1;
         $modules[$i]->user = $custom;
         // CHECK: custom module name is given by the title field, otherwise it's just 'om' ??
         $modules[$i]->name = $custom ? $modules[$i]->title : substr($file, 4);
         $modules[$i]->style = null;
         $modules[$i]->position = strtolower($modules[$i]->position);
     }
     return $modules;
 }
Esempio n. 2
0
    if (isset($_GET['ownerid'])) {
        $SESSION->redirect('?m=customerinfo&id=' . $_GET['ownerid']);
    } else {
        if ($DB->GetOne('SELECT 1 FROM nodes WHERE id = ? AND ownerid = 0', array($nodeid))) {
            $SESSION->redirect('?m=netdevinfo&ip=' . $nodeid . '&id=' . $LMS->GetNetDevIDByNode($nodeid));
        } else {
            $SESSION->redirect('?m=nodelist');
        }
    }
}
if (isset($_GET['devid'])) {
    $error['netdev'] = trans('It scans for free ports in selected device!');
    $SMARTY->assign('error', $error);
    $SMARTY->assign('netdevice', $_GET['devid']);
}
if (check_modules(110)) {
    include MODULES_DIR . '/nodemonit.inc.php';
}
$nodeinfo = $LMS->GetNode($nodeid);
$nodegroups = $LMS->GetNodeGroupNamesByNode($nodeid);
$othernodegroups = $LMS->GetNodeGroupNamesWithoutNode($nodeid);
$customerid = $nodeinfo['ownerid'];
include MODULES_DIR . '/customer.inc.php';
if (get_conf('voip.enabled', '0')) {
    include MODULES_DIR . '/customer.voip.inc.php';
}
$nodestats['hour'] = NodeStats($nodeid, 60 * 60);
$nodestats['day'] = NodeStats($nodeid, 60 * 60 * 24);
$nodestats['month'] = NodeStats($nodeid, 60 * 60 * 24 * 30);
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
if (!isset($_GET['ownerid'])) {
Esempio n. 3
0
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
$customerid = intval($_GET['id']);
include MODULES_DIR . '/infocenter.inc.php';
include MODULES_DIR . '/customer.inc.php';
if (check_modules(82) && get_conf('voip.enabled', 0)) {
    // nettelekom
    include MODULES_DIR . '/customer.voip.inc.php';
    $invoicelist = $voip->get_billing_details2($invoicelist);
}
$annex_info = array('section' => 'customer', 'ownerid' => $customerid);
$SMARTY->assign('annex_info', $annex_info);
include MODULES_DIR . '/customer_xajax.inc.php';
$LMS->InitXajax();
$LMS->RegisterXajaxFunction(array('get_list_annex', 'delete_file_annex'));
$SMARTY->assign('xajax', $LMS->RunXajax());
if ($customerinfo['cutoffstop'] > mktime(0, 0, 0)) {
    $customerinfo['cutoffstopnum'] = floor(($customerinfo['cutoffstop'] - mktime(23, 59, 59)) / 86400);
}
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
$layout['pagetitle'] = trans('Customer Info: $a', $customerinfo['customername']);
Esempio n. 4
0
 /**
  * Load published modules
  *
  * @access	private
  * @return	array
  */
 function &_load()
 {
     global $mainframe, $Itemid;
     static $modules;
     if (isset($modules)) {
         return $modules;
     }
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     $aid = $user->get('aid', 0);
     $modules = array();
     $wheremenu = isset($Itemid) ? ' AND ( mm.menuid = ' . (int) $Itemid . ' OR mm.menuid = 0 )' : '';
     $query = 'SELECT id, title, module, position, content, showtitle, control, params' . ' FROM #__modules AS m' . ' LEFT JOIN #__modules_menu AS mm ON mm.moduleid = m.id' . ' WHERE m.published = 1' . ' AND m.access <= ' . (int) $aid . ' AND m.client_id = ' . (int) $mainframe->getClientId() . $wheremenu . ' ORDER BY position, ordering';
     $db->setQuery($query);
     if (!($modules = $db->loadObjectList())) {
         JError::raiseWarning('SOME_ERROR_CODE', "Error loading Modules: " . $db->getErrorMsg());
         return false;
     }
     check_modules($modules);
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         //determine if this is a custom module
         $file = $modules[$i]->module;
         $custom = substr($file, 0, 4) == 'mod_' ? 0 : 1;
         $modules[$i]->user = $custom;
         // CHECK: custom module name is given by the title field, otherwise it's just 'om' ??
         $modules[$i]->name = $custom ? $modules[$i]->title : substr($file, 4);
         $modules[$i]->style = null;
         $modules[$i]->position = strtolower($modules[$i]->position);
     }
     return $modules;
 }
Esempio n. 5
0
    $display_start_date = DateTime::createFromFormat('U', $paper_start, $UK_time);
    $display_end_date = DateTime::createFromFormat('U', $paper_end, $UK_time);
    $display_start_date->setTimezone($target_timezone);
    $display_end_date->setTimezone($target_timezone);
    $tmp_cfg_long_date_time = str_replace('%', '', $configObject->get('cfg_long_date_time'));
    $display_start_date = $display_start_date->format($tmp_cfg_long_date_time);
    $display_end_date = $display_end_date->format($tmp_cfg_long_date_time);
}
$previously_submitted = 0;
$low_bandwidth = 0;
if ($userObject->has_role('Student')) {
    // Check for additional password on the paper
    check_paper_password($password, $string, $mysqli, true);
    //Check this PC is registered for this exam
    $low_bandwidth = check_labs($test_type, $labs, $current_address, $password, $string, $mysqli);
    $attempt = check_modules($userObject, $modIDs, $calendar_year, $string, $mysqli);
}
$display_remaining_time = false;
$remaining_minutes = '';
$remaining_seconds = '';
/*
 * BP If the duration is set then create a timer to calculate and display the remaining time
 */
$extra_time = null;
$remaining_time = 0;
$log_metadata = new LogMetadata($userObject->get_user_ID(), $propertyObj->get_property_id(), $mysqli);
// $log_metadata->get_record will return true if this user has stared this exam. false otherwise
$exam_started = $log_metadata->get_record('', false);
if ($exam_duration !== null) {
    if ($test_type == '2') {
        $student_object['special_needs_percentage'] = $special_needs_percentage;
Esempio n. 6
0
}
$moduleID = $propertyObj->get_modules();
if ($userObject->has_role('Staff') and check_staff_modules($moduleID, $userObject)) {
    // No further security checks.
} else {
    // Treat as student with extra security checks.
    // Get the module IDs for this paper
    $modIDs = array_keys(Paper_utils::get_modules($propertyObj->get_property_id(), $mysqli));
    // Check for additional password on the paper
    check_paper_password($propertyObj->get_password(), $string, $mysqli);
    // Check time security
    check_datetime($propertyObj->get_start_date(), $propertyObj->get_end_date(), $string, $mysqli);
    // Check room security
    $low_bandwidth = check_labs($propertyObj->get_paper_type(), $propertyObj->get_labs(), $current_address, $propertyObj->get_password(), $string, $mysqli);
    // Check modules if the user is a student and the paper is not formative
    $attempt = check_modules($userObject, $modIDs, $propertyObj->get_calendar_year(), $string, $mysqli);
    // Check for any metadata security restrictions
    check_metadata($propertyObj->get_property_id(), $userObject, $modIDs, $string, $mysqli);
    $summative_exam_session_started = false;
}
$is_preview = (isset($_POST['mode']) and $_POST['mode'] == 'preview');
$paper_scheduled = $propertyObj->get_start_date() !== null;
if ($propertyObj->get_exam_duration() != null and $propertyObj->get_paper_type() == '2') {
    $log_lab_end_time = new LogLabEndTime($lab_id, $propertyObj, $mysqli);
    $summative_exam_session_started = $log_lab_end_time->get_session_end_date_datetime();
}
if (!$is_preview and time() > $propertyObj->get_end_date() and ($propertyObj->get_paper_type() == '1' or $propertyObj->get_paper_type() == '2' and $paper_scheduled and $summative_exam_session_started == false)) {
    $propertyObj->set_paper_type('_late');
}
$preview_q_id = isset($_GET['q_id']) ? $_GET['q_id'] : null;
$log_metadata = new LogMetadata($userObject->get_user_ID(), $propertyObj->get_property_id(), $mysqli);
Esempio n. 7
0
        if ($customerdata['cutoffstop']) {
            $customerdata['cutoffstop'] = mktime(23, 59, 59, date('m'), date('d') + $customerdata['cutoffstop']);
        }
        if (!isset($customerdata['consentdate'])) {
            $customerdata['consentdate'] = 0;
        } else {
            $consent = $DB->GetOne('SELECT consentdate FROM customers WHERE id = ?', array($customerdata['id']));
            if ($consent) {
                $customerdata['consentdate'] = $consent;
            }
        }
        if (!isset($customerdata['divisionid'])) {
            $customerdata['divisionid'] = 0;
        }
        $LMS->CustomerUpdate($customerdata);
        if (check_modules(82) && get_conf('voip.enabled', '0') && $customerdata['isvoip']) {
            // nettelekom
            $voip->update_user($customerdata);
        }
        $DB->Execute('DELETE FROM imessengers WHERE customerid = ?', array($customerdata['id']));
        if (isset($im)) {
            foreach ($im as $idx => $val) {
                $DB->Execute('INSERT INTO imessengers (customerid, uid, type)
					VALUES(?, ?, ?)', array($customerdata['id'], $val, $idx));
            }
        }
        $DB->Execute('DELETE FROM customercontacts WHERE customerid = ?', array($customerdata['id']));
        if (isset($contacts)) {
            foreach ($contacts as $contact) {
                $DB->Execute('INSERT INTO customercontacts (customerid, phone, name, type)
					VALUES(?, ?, ?, ?)', array($customerdata['id'], $contact['phone'], $contact['name'], $contact['type']));