]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Rewrites from to , fixes
[mailer.git] / inc / modules / admin / admin-inc.php
index 0d06e5fbfde55875e011fd4fd359fced8c054b84..4ee9340b32aba67d244665a28f9d4423c5d8d428 100644 (file)
@@ -53,8 +53,12 @@ function addAdminAccount ($user, $md5, $email) {
        // Is the entry there?
        if (SQL_NUMROWS($result) == 0) {
                // Ok, let's create the admin login
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins` (login, password, email) VALUES ('%s', '%s', '%s')",
-               array($user, $md5, $email), __FUNCTION__, __LINE__);
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins` (`login`, `password`, `email`) VALUES ('%s', '%s', '%s')",
+                       array(
+                               $user,
+                               $md5,
+                               $email
+                       ), __FUNCTION__, __LINE__);
                $ret = 'done';
        } // END - if
 
@@ -175,15 +179,15 @@ function ifAdminLoginDataIsValid ($admin, $password) {
        // Count login failure if admins extension version is 0.7.0+
        if (($ret == 'pass') && (getExtensionVersion('admins') >= '0.7.0')) {
                // Update counter
-               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET login_failures=login_failures+1,last_failure=NOW() WHERE `id`=%s LIMIT 1",
-               array($adminId), __FUNCTION__, __LINE__);
+               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET login_failures`=`login_failures`+1,`last_failure`=NOW() WHERE `id`=%s LIMIT 1",
+                       array($adminId), __FUNCTION__, __LINE__);
 
                // Rebuild cache
                rebuildCacheFile('admin', 'admin');
        } // END - if
 
        // Return the result
-       //* DEBUG: */ die("RETURN=".$ret);
+       //* DEBUG: */ die('RETURN=' . $ret);
        return $ret;
 }
 
@@ -1207,7 +1211,7 @@ function doResetAdminPassword ($login, $password) {
        $passHash = '';
 
        // Now check if we have sql_patches installed
-       if (getExtensionVersion('sql_patches') >= '0.3.6') {
+       if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
                // Use new way of hashing
                $passHash = generateHash($password);
        } else {
@@ -1291,31 +1295,5 @@ function adminCreateUserLink ($userid) {
        return '{?URL?}/modules.php?module=admin&what=list_user';
 }
 
-// -----------------------------------------------------------------------------
-// ---                           Filter functions                            ---
-// -----------------------------------------------------------------------------
-
-// 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 ((isExtensionInstalledAndNewer('admins', '0.3.0')) && (isExtensionActive('admins'))) {
-               // Check if action GET variable was set
-               $action = getAction();
-               if (isWhatSet()) {
-                       // Get action value by what-value
-                       $action = getModeAction('admin', getWhat());
-               } // END - if
-
-               // Check for access control line of current menu entry
-               $ret = adminsCheckAdminAcl($action, getWhat());
-       } // END - if
-
-       // Set it here
-       $GLOBALS['acl_allow'] = $ret;
-}
-
 // [EOF]
 ?>