本文整理汇总了PHP中claro_die函数的典型用法代码示例。如果您正苦于以下问题:PHP claro_die函数的具体用法?PHP claro_die怎么用?PHP claro_die使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了claro_die函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notify
/**
* call all gateway notification
*
* @param int $uidList
* @param messageToSend $message
* @param int $messageId
*/
public static function notify($uidList, $message, $messageId)
{
// list all file in ./notifier/
$notifierFile = new Claro_FileFinder_Extension(dirname(__FILE__) . '/notifier/', '.notifier.lib.php', false);
$classNotLoad = '';
foreach ($notifierFile as $file) {
require_once $file->getPathname();
//take the name of the class
// convention file: name.lib.php classe: name
$className = substr($file->getFilename(), 0, strlen($file->getFilename()) - strlen(".notifier.lib.php")) . 'Notifier';
if (class_exists($className)) {
$notifier = new $className();
$notifier->notify($uidList, $message, $messageId);
} else {
if ($classNotLoad != '') {
$classNotLoad .= ', ';
}
$classNotLoad .= $className;
}
}
if ($classNotLoad != '') {
claro_die(get_lang("The message sent but the notification by " . $classNotLoad . " failed"));
}
}
示例2: isset
$userId = isset($_REQUEST['userId']) ? (int) $_REQUEST['userId'] : null;
$link_arg = array();
if (!is_null($userId) && !empty($userId)) {
$currentUserId = (int) $_REQUEST['userId'];
$link_arg['userId'] = $currentUserId;
} else {
$currentUserId = claro_get_current_user_id();
}
if ($currentUserId != claro_get_current_user_id() && !claro_is_platform_admin()) {
claro_die(get_lang("Not allowed"));
}
// user exist ?
if ($currentUserId != claro_get_current_user_id()) {
$userData = user_get_properties($currentUserId);
if ($userData === false) {
claro_die(get_lang("User not found"));
} else {
$title = get_lang('Messages of %firstName %lastName', array('%firstName' => claro_htmlspecialchars($userData['firstname']), '%lastName' => claro_htmlspecialchars($userData['lastname'])));
}
} else {
$title = get_lang('My messages');
}
$linkPage = $_SERVER['PHP_SELF'];
$acceptedValues = array('inbox', 'outbox', 'trashbox');
if (!isset($_REQUEST['box']) || !in_array($_REQUEST['box'], $acceptedValues)) {
$_REQUEST['box'] = "inbox";
}
$link_arg['box'] = $_REQUEST['box'];
require_once dirname(__FILE__) . '/lib/tools.lib.php';
$content = "";
if ($link_arg['box'] == "inbox") {
示例3: strtolower
$pathInfo = strtolower(str_replace('\\', '/', $pathInfo));
}
$document_url = str_replace($rootSys, $urlAppend . '/', $pathInfo);
if (get_conf('useSendfile', true) && ($mimeType != 'text/html' || $extension == 'url') || $wasFolder) {
if (claro_send_file($pathInfo) !== false) {
$claroline->notifier->event('download', array('data' => array('url' => $document_url)));
if ($wasFolder) {
unlink($pathInfo);
}
if (!$canRetry) {
$sql = 'DELETE FROM `' . $tableName . '` WHERE token = \'' . claro_sql_escape($token) . '\'';
Claroline::getDatabase()->exec($sql);
}
} else {
header('HTTP/1.1 404 Not Found');
claro_die(get_lang('File download failed : %failureMSg%', array('%failureMsg%' => claro_failure::get_last_failure())));
}
} else {
$sql = 'DELETE FROM `' . $tableName . '` WHERE token = \'' . claro_sql_escape($token) . '\'';
Claroline::getDatabase()->exec($sql);
// redirect to document
claro_redirect($document_url);
}
} else {
header('HTTP/1.1 404 Not Found');
}
//Clean left zip here
$sql = 'SELECT * FROM `' . $tableName . '` WHERE ADDTIME(`requestTime`,\'0 0:0:30\') < NOW() AND NOT `wasFolder` = \'0\'';
$result = Claroline::getDatabase()->query($sql);
while (($row = $result->fetch()) !== false) {
if (is_file($row['requestedPath'])) {
示例4: user_search
/**
* @param array $criterionList -
* Allowed keys are 'name', 'firstname', 'email', 'officialCode','username'
* @param string $courseId (optional)
* permit check if user are already enrolled in the concerned cours
* @param boolean $allCriterion (optional)
* define if all submited criterion has to be set.
* @param boolean $strictCompare (optional)
* define if criterion comparison use wildcard or not
* @return array : existing users who met the criterions
*/
function user_search($criterionList = array(), $courseId = null, $allCriterion = true, $strictCompare = false, $ignoreDisabledAccounts = false)
{
$validatedCritList = array('lastname' => '', 'firstname' => '', 'email' => '', 'officialCode' => '', 'username' => '');
foreach ($criterionList as $thisCritKey => $thisCritValue) {
if (array_key_exists($thisCritKey, $validatedCritList)) {
$validatedCritList[$thisCritKey] = str_replace('%', '\\%', $thisCritValue);
} else {
claro_die('user_search(): WRONG CRITERION KEY !');
}
}
$operator = $allCriterion ? 'AND' : 'OR';
$wildcard = $strictCompare ? '' : '%';
$tbl_mdb_names = claro_sql_get_main_tbl();
$tbl_user = $tbl_mdb_names['user'];
$tbl_course_user = $tbl_mdb_names['rel_course_user'];
$sql = "SELECT U.nom lastname,\n U.prenom firstname,\n U.email email,\n U.officialCode officialCode,\n U.username username,\n U.`user_id` AS uid\n " . ($courseId ? ', CU.user_id AS registered' : '') . "\n FROM `" . $tbl_user . "` AS U ";
if ($courseId) {
$sql .= " LEFT JOIN `" . $tbl_course_user . "` AS CU\n ON CU.`user_id`=U.`user_id`\n AND CU.`code_cours` = '" . $courseId . "' ";
}
$sqlCritList = array();
if ($validatedCritList['lastname']) {
$sqlCritList[] = " U.nom LIKE '" . claro_sql_escape($validatedCritList['lastname']) . $wildcard . "'";
}
if ($validatedCritList['firstname']) {
$sqlCritList[] = " U.prenom LIKE '" . claro_sql_escape($validatedCritList['firstname']) . $wildcard . "'";
}
if ($validatedCritList['email']) {
$sqlCritList[] = " U.email LIKE '" . claro_sql_escape($validatedCritList['email']) . $wildcard . "'";
}
if ($validatedCritList['officialCode']) {
$sqlCritList[] = " U.officialCode = '" . claro_sql_escape($validatedCritList['officialCode']) . "'";
}
if ($validatedCritList['username']) {
$sqlCritList[] = " U.username = '" . claro_sql_escape($validatedCritList['username']) . "'";
}
if (count($sqlCritList) > 0) {
$sql .= 'WHERE ' . implode(" {$operator} ", $sqlCritList);
}
// ignore disabled account if needed
if ($ignoreDisabledAccounts) {
if (count($sqlCritList) > 0) {
$sql .= " AND U.authSource != 'disabled' ";
} else {
$sql .= "WHERE U.authSource != 'disabled' ";
}
}
$sql .= " ORDER BY U.nom, U.prenom";
return claro_sql_query_fetch_all($sql);
}
示例5: array
/*---------------------------------------------------------------------------
Group initialisation
---------------------------------------------------------------------------*/
// if the requested group is different from the group in session
if ($gidReq && (!isset($_SESSION['_gid']) || $gidReq != $_SESSION['_gid'])) {
$gidReset = true;
}
if ($gidReset || $cidReset) {
if ($gidReq && $_cid) {
$context = array(CLARO_CONTEXT_COURSE => $_cid, CLARO_CONTEXT_GROUP => $gidReq);
$course_group_data = claro_get_group_data($context, true);
$_group = $course_group_data;
if ($_group) {
$_gid = $course_group_data['id'];
} else {
claro_die('WARNING !! Undefined groupd id: the requested group ' . ' doesn\'t exist at line ' . __LINE__ . '. ' . 'Please contact your platform administrator.');
}
} else {
$_gid = null;
$_group = null;
}
} else {
$_gid = !empty($_SESSION['_gid']) ? $_SESSION['_gid'] : null;
$_group = !empty($_SESSION['_group']) ? $_SESSION['_group'] : null;
}
/*---------------------------------------------------------------------------
Group / User relation initialisation
---------------------------------------------------------------------------*/
if ($uidReset || $cidReset || $gidReset) {
if ($_uid && $_cid && $_gid) {
$sql = "SELECT status,\n role\n FROM `" . $_course['dbNameGlu'] . "group_rel_team_user`\n WHERE `user` = '" . (int) $_uid . "'\n AND `team` = '" . (int) $gidReq . "'";
示例6: addslashes
$sqlPrepareList[] = 'nom = "' . addslashes(utf8_decode($_SERVER[$shibbolethData['nom']])) . '"';
$sqlPrepareList[] = 'prenom = "' . addslashes(utf8_decode($_SERVER[$shibbolethData['prenom']])) . '"';
// Use first email only
$shibbolethEmail = explode($shibbolethEmailSep, $_SERVER[$shibbolethData['email']]);
if ($shibbolethEmail[0] == '') {
$shibbolethEmail[0] = $shibbolethDefaultEmail;
}
$sqlPrepareList[] = 'email = "' . addslashes($shibbolethEmail[0]) . '"';
$sqlPrepareList[] = 'authSource = "' . $shibbolethAuthSource . '"';
$sqlPrepareList[] = '`' . $shibbolethUidTbl . '` = "' . $_SERVER[$shibbolethUniqueIdAttr] . '"';
if ($shibbolethUidTbl != 'username') {
$sqlPrepareList[] = 'username = "' . addslashes(shibbolethUniqueUsername($_SERVER[$shibbolethData['nom']], $_SERVER[$shibbolethData['prenom']])) . '"';
}
$sql = 'UPDATE `' . $tbl_user . '` ' . 'SET ' . implode(', ', $sqlPrepareList) . ' ' . 'WHERE user_id = ' . (int) $_uid;
$res = mysql_query($sql) or die('<center>UPDATE QUERY FAILED LINE ' . __LINE__ . '<center>');
// redirect as normal login back to "My User Account"
session_destroy();
claro_redirect(get_conf('claro_ShibbolethPath') . 'index.php?sourceUrl=' . base64_encode($rootWeb . "claroline/auth/profile.php"));
}
} else {
// was not logged in
claro_die("<center>WARNING ! UNABLE TO CHANGE AUTHSOURCE. <a href=\"" . $rootWeb . "\">LOGIN FIRST</a>!.</center>");
}
} else {
// Shibboleth authentication failed
claro_die("<center>WARNING ! SHIBBOLETH AUTHENTICATION FAILED.</center>");
}
} else {
// Directory not protected
claro_die("<center>WARNING ! PROTECT THIS FOLDER IN YOUR WEBSERVER CONFIGURATION.</center>");
}
示例7: user_set_course_properties
} else {
$properties['isCourseManager'] = 0;
$properties['tutor'] = 0;
}
user_set_course_properties($user_id, $cidToEdit, $properties);
//set dialogbox message
if ($done) {
$dialogBox->success(get_lang('The user has been enroled to the course'));
}
break;
}
//build and call DB to get info about current course (for title) if needed :
$courseData = claro_get_course_data($cidToEdit);
if (!$courseData) {
unset($_REQUEST['cidToEdit']);
claro_die('ERROR : COURSE NOT FOUND!!!');
}
//----------------------------------
// Build query and find info in db
//----------------------------------
$sql = "\nSELECT\n U.nom, U.prenom, U.`user_id` AS ID,\n CU.*,\n CU.`user_id` AS Register\nFROM `" . $tbl_user . "` AS U";
$toAdd = "\nLEFT JOIN `" . $tbl_course_user . "` AS CU\n ON CU.`user_id`=U.`user_id`\n AND CU.`code_cours` = '" . claro_sql_escape($cidToEdit) . "'\n ";
$sql .= $toAdd;
//deal with LETTER classification call
if (isset($_GET['letter'])) {
$toAdd = "\n AND U.`nom` LIKE '" . claro_sql_escape($_GET['letter']) . "%' ";
$sql .= $toAdd;
}
//deal with KEY WORDS classification call
if (isset($_REQUEST['search']) && $_REQUEST['search'] != '') {
$toAdd = " WHERE (U.`nom` LIKE '" . claro_sql_escape($_REQUEST['search']) . "%'\n OR U.`username` LIKE '" . claro_sql_escape($_REQUEST['search']) . "%'\n OR U.`prenom` LIKE '" . claro_sql_escape($_REQUEST['search']) . "%') ";
示例8: isset
$portletLabel = isset($_REQUEST['portletLabel']) ? $_REQUEST['portletLabel'] : null;
$portletClass = isset($portletLabel) ? $portletLabel . '_portlet' : null;
require '../inc/claro_init_global.inc.php';
require_once get_path('incRepositorySys') . '/lib/claroCourse.class.php';
require_once get_path('incRepositorySys') . '/lib/users/userlist.lib.php';
require_once dirname(__FILE__) . '/coursehomepage/lib/coursehomepageportlet.class.php';
require_once dirname(__FILE__) . '/coursehomepage/lib/coursehomepageportletiterator.class.php';
// Instanciate dialog box
$dialogBox = new DialogBox();
// Display the auth form if necessary
// Also redirect if no cid specified
if (!claro_is_in_a_course() || !claro_is_course_allowed()) {
claro_disp_auth_form(true);
}
if (empty($cidReq)) {
claro_die(get_lang('Cannot find course'));
}
// Fetch this course's portlets
$portletiterator = new CourseHomePagePortletIterator(ClaroCourse::getIdFromCode($cidReq));
// Include specific CSS if any
if (file_exists(get_conf('coursesRepositorySys') . $_course['path'] . '/css/course.css')) {
$claroline->display->header->addHtmlHeader('<link rel="stylesheet" media="screen" type="text/css" href="' . get_path('url') . '/' . get_path('coursesRepositoryAppend') . $_course['path'] . '/css/course.css" />');
}
// Instantiate course
$thisCourse = new ClaroCourse();
$thisCourse->load($cidReq);
include claro_get_conf_repository() . 'rss.conf.php';
// Include the course home page special CSS
CssLoader::getInstance()->load('coursehomepage', 'all');
$toolRepository = get_path('clarolineRepositoryWeb');
claro_set_display_mode_available(true);
示例9: DialogBox
}
/* ************************************************************************** */
/* Initialise variables and include libraries
/* ************************************************************************** */
$dialogBox = new DialogBox();
// Initialisation of global variables and used libraries
require_once get_path('incRepositorySys') . '/lib/pager.lib.php';
require_once get_path('incRepositorySys') . '/lib/course_user.lib.php';
include claro_get_conf_repository() . 'user_profile.conf.php';
$tbl_mdb_names = claro_sql_get_main_tbl();
/**
* Manage incoming.
*/
if (isset($_REQUEST['cidToEdit']) && $_REQUEST['cidToEdit'] == '' || !isset($_REQUEST['cidToEdit'])) {
unset($_REQUEST['cidToEdit']);
claro_die('ERROR : NO COURSE SET!!!');
} else {
$cidToEdit = $_REQUEST['cidToEdit'];
}
// See SESSION variables used for reorder criteria
$validCmdList = array('unsub');
$validRefererList = array('clist');
$cmd = isset($_REQUEST['cmd']) && in_array($_REQUEST['cmd'], $validCmdList) ? $_REQUEST['cmd'] : null;
$cfrom = isset($_REQUEST['cfrom']) && in_array($_REQUEST['cfrom'], $validRefererList) ? $_REQUEST['cfrom'] : null;
$pager_offset = isset($_REQUEST['pager_offset']) ? $_REQUEST['pager_offset'] : '0';
$addToURL = '';
$do = null;
// Parse command
if ($cmd == 'unsub') {
$do = 'unsub';
}
示例10: claro_die
claro_die(get_lang("Wrong page title"));
}
}
// --------- Start of wiki command processing ----------
// init message
$message = '';
switch ($action) {
case 'rqSearch':
break;
case 'exSearch':
$pattern = isset($_REQUEST['searchPattern']) ? trim($_REQUEST['searchPattern']) : null;
if (!empty($pattern)) {
$searchEngine = new WikiSearchEngine($con, $config);
$searchResult = $searchEngine->searchInWiki($pattern, $wikiId, CLWIKI_SEARCH_ANY);
if ($searchEngine->hasError()) {
claro_die($searchEngine->getError());
}
if (is_null($searchResult)) {
$searchResult = array();
}
$wikiList = $searchResult;
} else {
$message = get_lang("Missing search keywords");
$dialogBox->error($message);
$action = 'rqSearch';
}
break;
// show differences
// show differences
case 'diff':
require_once 'lib/lib.diff.php';
示例11: DialogBox
$dialogBox = new DialogBox();
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$adminContext = isset($_REQUEST['adminContext']) ? (bool) $_REQUEST['adminContext'] : null;
// $sourceCourseId has a value only if we're about to create a session course; it's null otherwise
$sourceCourseId = isset($_REQUEST['course_sourceCourseId']) ? (int) $_REQUEST['course_sourceCourseId'] : null;
// New course object
$thisUser = claro_get_current_user_data();
$course = new ClaroCourse($thisUser['firstName'], $thisUser['lastName'], $thisUser['mail']);
if (!is_null($sourceCourseId)) {
$course->sourceCourseId = $sourceCourseId;
}
if (!is_null($course->sourceCourseId) && !empty($course->sourceCourseId)) {
$sourceCourse = new claroCourse();
$sourceCourse->load(claroCourse::getCodeFromId($course->sourceCourseId));
if ($sourceCourse->sourceCourseId) {
claro_die(get_lang('You cannot create a course session from another course session'));
}
$course->categories = $sourceCourse->categories;
}
if ($adminContext && claro_is_platform_admin()) {
// From admin, add param to form
$course->addHtmlParam('adminContext', '1');
}
if (claro_is_platform_admin() || get_conf('courseCreationAllowed', true)) {
if ($cmd == 'exEdit') {
$course->handleForm();
if ($course->validate()) {
if ($course->save()) {
// include the platform language file with all language variables
language::load_translation();
language::load_locale_settings();
示例12: array
$claroline->log('DELETION COURSE', array('courseName' => $course->title, 'uid' => claro_get_current_user_id()));
if ($adminContext) {
claro_redirect(get_path('rootAdminWeb') . '/admin_courses.php');
} else {
claro_redirect(get_path('url') . '/index.php');
}
} else {
$dialogBox->error(get_lang('Unable to delete'));
}
}
if ($cmd == 'rqDelete') {
$display = DISP_COURSE_RQ_DELETE;
}
} else {
// course data load failed
claro_die(get_lang('Wrong parameters'));
}
// Command list
$cmdList = array();
$cmdList[] = array('img' => 'edit', 'name' => get_lang('Edit Tool list'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/tools.php')));
// Main group settings
$cmdList[] = array('img' => 'settings', 'name' => get_lang('Main Group Settings'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_module_url('CLGRP') . '/group_properties.php')));
// Add tracking link
if (get_conf('is_trackingEnabled')) {
$cmdList[] = array('img' => 'statistics', 'name' => get_lang('Statistics'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'tracking/courseReport.php')));
}
// Add delete course link
if (get_conf('showLinkToDeleteThisCourse')) {
$paramString = $course->getHtmlParamList('GET');
$cmdList[] = array('img' => 'delete', 'name' => get_lang('Delete the whole course website'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/settings.php?cmd=rqDelete' . (!empty($paramString) ? '&' . $paramString : ''))));
}
示例13: get_path
$tbl_dock = $tbl_name['dock'];
//NEEDED LIBRAIRIES
require_once get_path('incRepositorySys') . '/lib/module/manage.lib.php';
require_once get_path('incRepositorySys') . '/lib/admin.lib.inc.php';
$undeactivable_tool_array = get_not_deactivable_tool_list();
$htmlHeadXtra[] = "<script type=\"text/javascript\">\nfunction confirmMakeVisible ()\n{\n if (confirm(\" " . clean_str_for_javascript(get_lang("Are you sure you want to make this module visible in all courses ?")) . "\"))\n {return true;}\n else\n {return false;}\n}\nfunction confirmMakeInVisible ()\n{\n if (confirm(\" " . clean_str_for_javascript(get_lang("Are you sure you want to make this module invisible in all courses ?")) . "\"))\n {return true;}\n else\n {return false;}\n}\n</script>";
//----------------------------------
// GET REQUEST VARIABLES
//----------------------------------
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$item = isset($_REQUEST['item']) ? $_REQUEST['item'] : 'GLOBAL';
$section_selected = isset($_REQUEST['section']) ? $_REQUEST['section'] : null;
$moduleId = isset($_REQUEST['module_id']) ? (int) $_REQUEST['module_id'] : null;
$module = get_module_info($moduleId);
if (!$module) {
claro_die("ERROR: INVALID MODULE ID!!!");
}
language::load_module_translation($module['label']);
$dockList = get_dock_list($module['type']);
$nameTools = get_lang('Module settings');
$noPHP_SELF = true;
// FIXME : BAD use of get_lang !!!!!
ClaroBreadCrumbs::getInstance()->prepend(get_lang($module['module_name']));
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Module list'), get_path('rootAdminWeb') . 'module/module_list.php?typeReq=' . $module['type']);
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
ClaroBreadCrumbs::getInstance()->setCurrent($nameTools);
$dialogBox = new dialogBox();
//----------------------------------
// EXECUTE COMMAND
//----------------------------------
switch ($cmd) {
示例14: claro_is_course_manager
$toolTitle['mainTitle'] = $nameTools;
$is_allowedToTrack = claro_is_course_manager();
$out = '';
if ($is_allowedToTrack && get_conf('is_trackingEnabled')) {
if (isset($_REQUEST['cmd']) && ($_REQUEST['cmd'] == 'tool' && !empty($_REQUEST['id']))) {
$toolTitle['subTitle'] = claro_get_tool_name(claro_get_tool_id_from_course_tid((int) $_REQUEST['id']));
// prepare SQL query
$sql = "SELECT `U`.`nom` AS `lastName`,\n `U`.`prenom` AS `firstName`,\n MAX(UNIX_TIMESTAMP(`TE`.`date`)) AS `data`,\n COUNT(`TE`.`date`) AS `nbr`\n FROM `" . $tbl_course_tracking_event . "` AS `TE`\n LEFT JOIN `" . $tbl_user . "` AS `U`\n ON `TE`.`user_id` = `U`.`user_id`\n WHERE `TE`.`tool_id` = '" . (int) $_REQUEST['id'] . "'\n GROUP BY `U`.`nom`, `U`.`prenom`\n ORDER BY `U`.`nom`, `U`.`prenom`";
} elseif (isset($_REQUEST['cmd']) && ($_REQUEST['cmd'] == 'doc' && !empty($_REQUEST['path']))) {
// FIXME : fix query, probably not a good idea to use like to find a match inside serialized data
// set the subtitle for the echo claro_html_tool_title function
$toolTitle['subTitle'] = get_lang('Documents and Links') . " : " . claro_htmlspecialchars($_REQUEST['path']);
// prepare SQL query
$sql = "SELECT `U`.`nom` as `lastName`,\n `U`.`prenom` as `firstName`,\n MAX(UNIX_TIMESTAMP(`TE`.`date`)) AS `data`,\n COUNT(`TE`.`date`) AS `nbr`\n FROM `" . $tbl_course_tracking_event . "` AS `TE`\n LEFT JOIN `" . $tbl_user . "` AS `U`\n ON `U`.`user_id` = `TE`.`user_id`\n WHERE `TE`.`data` LIKE '%" . claro_sql_escape($_REQUEST['path']) . "%'\n GROUP BY `U`.`nom`, `U`.`prenom`\n ORDER BY `U`.`nom`, `U`.`prenom`";
} else {
claro_die(get_lang('Wrong operation'));
}
$out .= claro_html_tool_title($toolTitle);
// TODO use datagrid
$out .= '<br />' . "\n\n" . '<table class="claroTable" border="0" cellpadding="5" cellspacing="1">' . "\n" . '<tr class="headerX">' . "\n" . '<th>' . get_lang('Username') . '</th>' . "\n" . '<th>' . get_lang('Last access') . '</th>' . "\n" . '<th>' . get_lang('Access count') . '</th>' . "\n" . '</tr>' . "\n" . '<tbody>' . "\n\n";
$i = 0;
$anonymousCount = 0;
if (isset($sql)) {
$accessList = claro_sql_query_fetch_all($sql);
// display the list
foreach ($accessList as $userAccess) {
$userName = $userAccess['lastName'] . " " . $userAccess['firstName'];
if (empty($userAccess['lastName'])) {
$anonymousCount = $userAccess['nbr'];
continue;
}
示例15: get_path
require_once get_path('incRepositorySys') . '/lib/display/dialogBox.lib.php';
// Initialise variables
$nameTools = get_lang('User settings');
$dialogBox = new DialogBox();
/*=====================================================================
Main Section
=====================================================================*/
// see which user we are working with ...
if (empty($_REQUEST['uidToEdit'])) {
claro_redirect('adminusers.php');
} else {
$userId = $_REQUEST['uidToEdit'];
}
$user_data = user_get_properties($userId);
if (empty($user_data)) {
claro_die(get_lang('Unable to load user information'));
}
$user_extra_data = user_get_extra_data($userId);
if (count($user_extra_data)) {
$dgExtra = new claro_datagrid(user_get_extra_data($userId));
} else {
$dgExtra = null;
}
if (isset($_REQUEST['applyChange'])) {
// get params form the form
if (isset($_POST['lastname'])) {
$user_data['lastname'] = trim($_POST['lastname']);
}
if (isset($_POST['firstname'])) {
$user_data['firstname'] = trim($_POST['firstname']);
}