]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Fixed a version problem which causes admin logins to fail if ext-admins is installed
[mailer.git] / inc / modules / admin / admin-inc.php
index d668fbaacd7d4447dedffe3820c367fc7cff8fe4..024b3f2e5d390cf3dcdf4ec7f03a9cd7526200a2 100644 (file)
@@ -85,7 +85,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                incrementConfigEntry('cache_hits');
 
                // Include more admins data?
-               if (GET_EXT_VERSION("admins") >= "0.7.0") {
+               if (GET_EXT_VERSION("admins") >= "0.7.2") {
                        // Load them here
                        $data['login_failures'] = $GLOBALS['cache_array']['admins']['login_failures'][$aid];
                        $data['last_failure']   = $GLOBALS['cache_array']['admins']['last_failure'][$aid];
@@ -358,6 +358,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
                                $OUT .= "<tr>
        <td class=\"admin_menu\" colspan=\"2\">
                <nobr>&nbsp;<strong>&middot;</strong>&nbsp;";
+
                                if (($menu == $act) && (empty($wht))) {
                                        $OUT .= "<strong>";
                                } else {
@@ -371,12 +372,14 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
                                } else {
                                        $OUT .= "</a>]";
                                }
+
                                $OUT .= "</nobr></td>
 </tr>\n";
+
+                               // Check for menu entries
                                $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC",
                                        array($menu), __FUNCTION__, __LINE__);
-                               if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu))
-                               {
+                               if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu)) {
                                        $GLOBALS['menu']['description'] = array();
                                        $GLOBALS['menu']['title'] = array(); $SUB = true;
                                        $OUT .= "<tr>
@@ -437,6 +440,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
        </td>
 </tr>\n";
                                }
+
                                $OUT .= "<tr><td height=\"7\" colspan=\"2\"></td></tr>\n";
                        }
                }
@@ -683,7 +687,8 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
        // Return contents
        return $OUT;
 }
-//
+
+// Creates a user-profile link for the admin. This function can also be used for many other purposes
 function ADMIN_USER_PROFILE_LINK ($uid, $title="", $wht="list_user") {
        if (($title == "") && ($title != "0")) {
                // Set userid as title
@@ -1215,6 +1220,7 @@ function ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN ($hash, $login) {
        // Return result
        return $valid;
 }
+
 // Reset the password for the login. Do NOT call this function without calling above function first!
 function ADMIN_RESET_PASSWORD ($login, $password) {
        // Init hash
@@ -1239,16 +1245,19 @@ function ADMIN_RESET_PASSWORD ($login, $password) {
        // Return output
        return ADMIN_PASSWORD_RESET_DONE;
 }
+
 // Solves a task by given id number
 function ADMIN_SOLVE_TASK ($id) {
        // Update the task data
        ADMIN_UPDATE_TASK_DATA($id, "status", "SOLVED");
 }
+
 // Marks a given task as deleted
 function ADMIN_DELETE_TASK ($id) {
        // Update the task data
        ADMIN_UPDATE_TASK_DATA($id, "status", "DELETED");
 }
+
 // Function to update task data
 function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) {
        // Is the id not set, then we need a backtrace here... :(