$admin = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
// Zero? = Not assigned
- if ($aid > 0) {
+ if (bigintval($aid) > 0) {
// Load admin's login
$login = GET_ADMIN_LOGIN($aid);
+
+ // Is the login valid?
if ($login != "***") {
// Is the extension there?
if (EXT_IS_ACTIVE("admins")) {
} // END - if
// Return value
+ //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:act={$act},wht={$wht},default={$default},acl_mode={$acl_mode}<br />\n";
return $ret;
}
// Create email link to admins's account
function ADMINS_CREATE_EMAIL_LINK ($email, $mod="admin") {
- if (strpos("@", $email) > 0) {
+ // Is it an email?
+ if (strpos($email, "@") !== false) {
// Create email link
- $result = SQL_QUERY_ESC("SELECT id
+ $result = SQL_QUERY_ESC("SELECT `id`
FROM `{!_MYSQL_PREFIX!}_admins`
-WHERE email='%s' LIMIT 1",
+WHERE `email`='%s' LIMIT 1",
array($email), __FUNCTION__, __LINE__);
// Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Load userid
- list($uid) = SQL_FETCHROW($result);
+ list($aid) = SQL_FETCHROW($result);
// Rewrite email address to contact link
- $email = "{!URL!}/modules.php?module=".$mod."&what=user_contct&uid=".bigintval($uid);
- }
+ $email = "{!URL!}/modules.php?module=".$mod."&what=admins_contct&admin=".bigintval($aid);
+ } // END - if
// Free memory
SQL_FREERESULT($result);
$result = SQL_QUERY_ESC("SELECT userid
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE email='%s'".$locked." LIMIT 1",
+WHERE `email`='%s'".$locked." LIMIT 1",
array($email), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load userid
} // END - foreach
// Finish SQL statement
- $sql = substr($sql, 0, -1) . sprintf(" WHERE %s=%s AND %s='%s' LIMIT 1",
+ $sql = substr($sql, 0, -1) . sprintf(" WHERE `%s`=%s AND `%s`='%s' LIMIT 1",
$idColumn,
bigintval($id),
$statusColumn,
// By default an invalid ACL value is returned
$ret = "***";
- if (isset($GLOBALS['cache_array']['admins']['def_acl'][$aid])) {
+ // Is sql_patches there and was it found in cache?
+ if (!EXT_IS_ACTIVE("sql_patches")) {
+ // Not found, which is bad, so we need to allow all
+ $ret = "allow";
+ } elseif (isset($GLOBALS['cache_array']['admins']['def_acl'][$aid])) {
// Use cache
$ret = $GLOBALS['cache_array']['admins']['def_acl'][$aid];