Fixes/rewrites for missing sql_patches and check on admin's default access mode ...
authorRoland Häder <roland@mxchange.org>
Thu, 12 Mar 2009 19:25:24 +0000 (19:25 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 12 Mar 2009 19:25:24 +0000 (19:25 +0000)
inc/functions.php
inc/libs/admins_functions.php
inc/libs/user_functions.php
inc/modules/admin/admin-inc.php
inc/mysql-manager.php

index 9daec4f80d97259f60a72dbff68ea501694d0143..c875a91aee04841958e6e8b7fc6116a155c61fca 100644 (file)
@@ -2832,9 +2832,11 @@ function GENERATE_AID_LINK ($aid) {
        $admin = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
 
        // Zero? = Not assigned
        $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);
                // Load admin's login
                $login = GET_ADMIN_LOGIN($aid);
+
+               // Is the login valid?
                if ($login != "***") {
                        // Is the extension there?
                        if (EXT_IS_ACTIVE("admins")) {
                if ($login != "***") {
                        // Is the extension there?
                        if (EXT_IS_ACTIVE("admins")) {
index c0d4c13023df4398210569cb391dad0960c30404..a981f8d148a093f49707dd8e42513f138a9b2ca7 100644 (file)
@@ -115,26 +115,28 @@ function ADMINS_CHECK_ACL($act, $wht) {
        } // END - if
 
        // Return value
        } // 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") {
        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
                // Create email link
-               $result = SQL_QUERY_ESC("SELECT id
+               $result = SQL_QUERY_ESC("SELECT `id`
 FROM `{!_MYSQL_PREFIX!}_admins`
 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
                        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
 
                        // Rewrite email address to contact link
-                       $email = "{!URL!}/modules.php?module=".$mod."&amp;what=user_contct&amp;uid=".bigintval($uid);
-               }
+                       $email = "{!URL!}/modules.php?module=".$mod."&amp;what=admins_contct&amp;admin=".bigintval($aid);
+               } // END - if
 
                // Free memory
                SQL_FREERESULT($result);
 
                // Free memory
                SQL_FREERESULT($result);
index 18038d711269d0b4862aeaec232f9b1fccfa117f..8e913f21ae3d51c9a9c228e4ff060f5f35951c4b 100644 (file)
@@ -204,7 +204,7 @@ function USER_CREATE_EMAIL_LINK($email, $mod="admin") {
 
        $result = SQL_QUERY_ESC("SELECT userid
 FROM `{!_MYSQL_PREFIX!}_user_data`
 
        $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
         array($email), __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Load userid
index 5efb6f55974fddaf8ceecfa5e0d3a7090be9a248..f0aff19e6aae954eef2d6e6ef8e1995794ab4d95 100644 (file)
@@ -946,7 +946,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct
                        } // END - foreach
 
                        // Finish SQL statement
                        } // 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,
                                $idColumn,
                                bigintval($id),
                                $statusColumn,
index 111c65c3ef6dc03a349dab1c1c1022da8fd74e0a..db3015241a05653e8326fa33ccd6c73562a577eb 100644 (file)
@@ -1472,7 +1472,11 @@ function GET_ADMIN_DEFAULT_ACL ($aid) {
        // By default an invalid ACL value is returned
        $ret = "***";
 
        // 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];
 
                // Use cache
                $ret = $GLOBALS['cache_array']['admins']['def_acl'][$aid];