define('SERVER_URL', "http://www.mxchange.org");
// Current SVN revision
-define('CURR_SVN_REVISION', "654");
+define('CURR_SVN_REVISION', "655");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
// Run SQLs
REGISTER_FILTER('run_sqls', 'RUN_SQLS');
+ // Admin ACL check
+ REGISTER_FILTER('check_admin_acl', 'CHECK_ADMIN_ACL');
+
// Register shutdown filters
REGISTER_FILTER('shutdown', 'FLUSH_FILTERS');
}
// Update last module / online time
$result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
- array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
+ array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
}
} else {
// Destroy session, we cannot update!
}
}
+// Filter for checking admin ACL
+function FILTER_CHECK_ADMIN_ACL () {
+ // Extension not installed so it's always allowed to access everywhere!
+ $ret = true;
+
+ // Ok, Cookie-Update done
+ if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
+ // Check if action GET variable was set
+ $action = SQL_ESCAPE($GLOBALS['action']);
+ if (!empty($GLOBALS['what'])) {
+ // Get action value by what-value
+ $action = GET_ACTION("admin", $GLOBALS['what']);
+ } // END - if
+
+ // Check for access control line of current menu entry
+ $ret = ADMINS_CHECK_ACL($action, $GLOBALS['what']);
+ } // END - if
+
+ // Return result
+ return $ret;
+}
+
//
?>
return REGISTER_ADD_CATEGORY_TABLE ($MODE, $return);
}
// Generate an email link
-function CREATE_EMAIL_LINK($email, $table="admins") {
+function CREATE_EMAIL_LINK ($email, $table = "admins") {
// Default email link (INSECURE! Spammer can read this by harvester programs)
$EMAIL = "mailto:".$email;
define('ADMINS_CONTACT_DEFAULT_MAIL', "Ihre Nachricht wird als Mail versendet.");
define('ADMINS_MSG_FROM_ADMIN', "Nachricht von einem Admin");
define('ADMINS_ADMIN_CONTACTED', "Administrator wurde benachrichtigt!");
-define('ADMINS_ACCESS_DENIED', "Zugriff nicht gestattet.");
define('ADMIN_ADMINS_ADD_ACL', "Zugriffkontrollzeile hinzufügen");
define('ADMIN_ADMINS_SELECT_LOGIN', "Admin-Login auswählen");
define('ADMIN_ADMINS_SELECT_ACTION', "Hauptmenü");
define('TASK_SUBJ_EXTENSION_DEACTIVATED', "Erweiterung deaktiviert");
define('ADMIN_SUBJECT_EXTENSION_DEACTIVATED', "Automatische Deaktivierung einer Erweiterung");
define('FATAL_EXTENSION_LOADED', "Erweiterung <u>%s/u> bereits geladen!");
+define('ADMIN_ACCESS_DENIED', "Zugriff auf diesen Adminmenüpunkt nicht gestattet.");
define('MEMBER_MAIL_BONUS_CONFIRMED_ON', "Sie haben diese Bonusmail <span class=\"data\">%s</span> bestätigt.");
define('MEMBER_MAIL_NORMAL_CONFIRMED_ON', "Sie haben diese Klickmail <span class=\"data\">%s</span> bestätigt.");
// Cookie-Data accepted
if ((set_session("admin_md5", get_session('admin_md5'))) && (set_session("admin_login", get_session('admin_login'))) && (set_session("admin_last", time())) && (set_session("admin_to", bigintval(get_session('admin_to'))))) {
// Ok, Cookie-Update done
- if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
- // Check if action GET variable was set
- $act = SQL_ESCAPE($GLOBALS['action']);
- if (!empty($GLOBALS['what'])) {
- // Get action value by what-value
- $act = GET_ACTION("admin", $GLOBALS['what']);
- }
-
- // Check for access control line of current menu entry
- define('__ACL_ALLOW', ADMINS_CHECK_ACL($act, $GLOBALS['what']));
- } else {
- // Extension not installed so it's always allowed to access everywhere!
- define('__ACL_ALLOW', true);
- }
+ // Check for access control line of current menu entry
+ define('__ACL_ALLOW', RUN_FILTER('check_admin_acl'));
// When type of admin menu is not set fallback to old menu system
if (getConfig('admin_menu') == null) $_CONFIG['admin_menu'] = "OLD";
include($INC);
} elseif (__ACL_ALLOW == false) {
// Access denied
- LOAD_TEMPLATE("admin_menu_failed", false, ADMINS_ACCESS_DENIED);
- ADD_FATAL(ADMINS_ACCESS_DENIED);
+ LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_ACCESS_DENIED);
+ ADD_FATAL(ADMIN_ACCESS_DENIED);
} else {
// Include file not found! :-(
LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_404_ACTION);