+
+// Get email address of admin id
+function getAdminEmail ($adminId) {
+ // By default an invalid emails is returned
+ $ret = '***';
+
+ if (isset($GLOBALS['cache_array']['admin']['email'][$adminId])) {
+ // Get cache
+ $ret = $GLOBALS['cache_array']['admin']['email'][$adminId];
+
+ // Update cache hits
+ incrementStatsEntry('cache_hits');
+ } elseif (!isExtensionActive('cache')) {
+ // Load from database
+ $result_admin_id = SQL_QUERY_ESC("SELECT email FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ array(bigintval($adminId)), __FUNCTION__, __LINE__);
+ if (SQL_NUMROWS($result_admin_id) == 1) {
+ // Get data
+ list($ret) = SQL_FETCHROW($result_admin_id);
+
+ // Set cache
+ $GLOBALS['cache_array']['admin']['email'][$adminId] = $ret;
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result_admin_id);
+ }
+
+ // Return email
+ return $ret;
+}
+
+// Get default ACL of admin id
+function getAdminDefaultAcl ($adminId) {
+ // By default an invalid ACL value is returned
+ $ret = '***';
+
+ // Is sql_patches there and was it found in cache?
+ if (!isExtensionActive('sql_patches')) {
+ // Not found, which is bad, so we need to allow all
+ $ret = 'allow';
+ } elseif (isset($GLOBALS['cache_array']['admin']['def_acl'][$adminId])) {
+ // Use cache
+ $ret = $GLOBALS['cache_array']['admin']['def_acl'][$adminId];
+
+ // Update cache hits
+ incrementStatsEntry('cache_hits');
+ } elseif (!isExtensionActive('cache')) {
+ // Load from database
+ $result_admin_id = SQL_QUERY_ESC("SELECT `default_acl` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ array(bigintval($adminId)), __FUNCTION__, __LINE__);
+ if (SQL_NUMROWS($result_admin_id) == 1) {
+ // Fetch data
+ list($ret) = SQL_FETCHROW($result_admin_id);
+
+ // Set cache
+ $GLOBALS['cache_array']['admin']['def_acl'][$adminId] = $ret;
+ }
+
+ // Free result
+ SQL_FREERESULT($result_admin_id);
+ }
+
+ // Return email
+ return $ret;
+}
+
+// Generates an option list from various parameters
+function generateOptionList ($table, $id, $name, $default='', $special='', $where='') {
+ $ret = '';
+ if ($table == '/ARRAY/') {