incrementConfigEntry('cache_hits');
// Include more admins data?
- if (GET_EXT_VERSION("admins") >= "0.7.0") {
+ if (GET_EXT_VERSION("admins") >= "0.7.2") {
// Load them here
$data['login_failures'] = $GLOBALS['cache_array']['admins']['login_failures'][$aid];
$data['last_failure'] = $GLOBALS['cache_array']['admins']['last_failure'][$aid];
$OUT .= "<tr>
<td class=\"admin_menu\" colspan=\"2\">
<nobr> <strong>·</strong> ";
+
if (($menu == $act) && (empty($wht))) {
$OUT .= "<strong>";
} else {
} else {
$OUT .= "</a>]";
}
+
$OUT .= "</nobr></td>
</tr>\n";
+
+ // Check for menu entries
$result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC",
array($menu), __FUNCTION__, __LINE__);
- if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu))
- {
+ if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu)) {
$GLOBALS['menu']['description'] = array();
$GLOBALS['menu']['title'] = array(); $SUB = true;
$OUT .= "<tr>
</td>
</tr>\n";
}
+
$OUT .= "<tr><td height=\"7\" colspan=\"2\"></td></tr>\n";
}
}
// Return contents
return $OUT;
}
-//
+
+// Creates a user-profile link for the admin. This function can also be used for many other purposes
function ADMIN_USER_PROFILE_LINK ($uid, $title="", $wht="list_user") {
if (($title == "") && ($title != "0")) {
// Set userid as title
// Return result
return $valid;
}
+
// Reset the password for the login. Do NOT call this function without calling above function first!
function ADMIN_RESET_PASSWORD ($login, $password) {
// Init hash
// Return output
return ADMIN_PASSWORD_RESET_DONE;
}
+
// Solves a task by given id number
function ADMIN_SOLVE_TASK ($id) {
// Update the task data
ADMIN_UPDATE_TASK_DATA($id, "status", "SOLVED");
}
+
// Marks a given task as deleted
function ADMIN_DELETE_TASK ($id) {
// Update the task data
ADMIN_UPDATE_TASK_DATA($id, "status", "DELETED");
}
+
// Function to update task data
function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) {
// Is the id not set, then we need a backtrace here... :(
// We currently don't want to install an extension so let's find out if we need...
$EXT_LOAD_MODE = "register";
- $JOBS_DONE = true;
+ $jobsDone = true;
// Open the extension directory
$handle = opendir(constant('PATH')."inc/extensions/") or mxchange_die("Cannot read extension directory!");
if (SQL_NUMROWS($result_tasks) > 0) {
// New jobs found!
- $JOBS_DONE = false;
+ $jobsDone = false;
} // END - if
// Free the result
SQL_FREERESULT($result);
// Return status
- return $JOBS_DONE;
+ return $jobsDone;
}
// Outputs selected tasks
function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
- global $NOTES;
if ((isset($POST['assign'])) && (count($POST['task']) > 0)) {
// Assign / do tasks
$OUT = ""; $SW = 2;
SET_SQLS(EXTENSION_REGISTER($ext_name, $id, true));
// Add notes to text
- $text .= $NOTES;
+ $text .= EXT_GET_NOTES();
// Set title
$title = getMessage('ADMIN_SQLS_EXECUTED_ON_REGISTER');
EXTENSION_UPDATE($ext_name, $ext_ver, true);
// Add notes to text
- $text .= $NOTES;
+ $text .= EXT_GET_NOTES();
// Set title
$title = getMessage('ADMIN_SQLS_EXECUTED_ON_UPDATE');
} else {
// Run SQL commands in dry mode but only return the notes
EXTENSION_UPDATE($ext_name, $ext_ver, true);
- $text .= $NOTES;
+ $text .= EXT_GET_NOTES();
}
// Prepare array for the template
// Otherwise load include file 'overview-inc' (old standard overview page)
LOAD_INC_ONCE("inc/modules/admin/overview-inc.php");
-$JOBS_DONE = true;
+$jobsDone = true;
$taskExt = false; // Default is that "task" is not installed
// When the admin is logging in check several things first (new jobs to complete and so on)
if ($GLOBALS['action'] == "login") {
if (EXT_IS_ACTIVE("task")) {
// When task extension is registered output advanced overview page
- $JOBS_DONE = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task'
+ $jobsDone = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task'
$taskExt = true;
} else {
// Output standart overview (provided by overview-inc.php)
- $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_tasks);
+ $jobsDone = OUTPUT_STANDARD_OVERVIEW($result_tasks);
}
} // END - if
-// Are there jobs to be done?
-if ($JOBS_DONE) {
+// Are we in 'welcome' page and are there jobs to be done?
+if ($GLOBALS['action'] != "login") {
+ // This menu is empty and so no content is displayed
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_MENU_IS_EMPTY'), $GLOBALS['action']));
+} elseif ($jobsDone === true) {
// Generate overview of all main menus
if ((is_array($GLOBALS['menu']['description'])) && (count($GLOBALS['menu']['description']) > 0)) {
$OUT = "";
- foreach ($GLOBALS['menu']['description'] as $key => $value)
- {
+ foreach ($GLOBALS['menu']['description'] as $key => $value) {
// Prepare content
$content = array(
'title' => $GLOBALS['menu']['title'][$key],
// Load row template
$OUT .= LOAD_TEMPLATE("admin_menu_hints_row", true, $content);
- }
+ } // END - foreach
// Load base template
LOAD_TEMPLATE("admin_menu_hints", false, $OUT);