]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Several more constants rewritten to getConfig()
[mailer.git] / inc / modules / admin / admin-inc.php
index 0903d1311ab4b072d8bf6c045a39252cecc757e3..bb1bb5e5b9d85a63375d85f873c20745758946ad 100644 (file)
@@ -95,7 +95,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                $add = runFilterChain('sql_admin_extra_data');
 
                // Get password from DB
-               $result = SQL_QUERY_ESC("SELECT password" . $add . " FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `password`" . $add . " FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                        array($aid), __FUNCTION__, __LINE__);
 
                // Entry found?
@@ -111,7 +111,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                SQL_FREERESULT($result);
        }
 
-       //* DEBUG: */ echo "*".$data['password'].'/'.md5($password).'/'.$ret."<br />";
+       //* DEBUG: */ OUTPUT_HTML("*".$data['password'].'/'.md5($password).'/'.$ret."<br />");
        if ((isset($data['password'])) && (strlen($data['password']) == 32) && ($data['password'] == md5($password))) {
                // Generate new hash
                $data['password'] = generateHash($password);
@@ -131,7 +131,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
        $salt = __SALT;
 
        // Check if password is same
-       //* DEBUG: */ echo "*".$ret.','.$data['password'].','.$password.','.$salt."*<br >\n";
+       //* DEBUG: */ OUTPUT_HTML("*".$ret.','.$data['password'].','.$password.','.$salt."*<br />");
        if (($ret == 'pass') && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == $password)) {
                // Re-hash the plain passord with new random salt
                $data['password'] = generateHash($password);
@@ -223,7 +223,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
        $pass = GET_ADMIN_HASH(GET_ADMIN_ID($admin_login));
        if ($pass != '-1') $ret = 'pass';
 
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
 
        // Check if password matches
        if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
@@ -238,7 +238,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
 //
 function ADMIN_DO_ACTION ($wht) {
        global $DATA;
-       //* DEBUG: */ echo __LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />");
 
        // Remove any spaces from variable
        if (empty($wht)) {
@@ -360,7 +360,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
                                if (($menu == $act) && (empty($wht))) {
                                        $OUT .= "<strong>";
                                } else {
-                                       $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&amp;action=".$menu."\">";
+                                       $OUT .= "[<a href=\"{?URL?}/modules.php?module=admin&amp;action=".$menu."\">";
                                }
 
                                $OUT .= $title;
@@ -413,7 +413,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
                                                                if ($wht == $wht_sub) {
                                                                        $OUT .= "<strong>";
                                                                } else {
-                                                                       $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$wht_sub."\">";
+                                                                       $OUT .= "[<a href=\"{?URL?}/modules.php?module=admin&amp;what=".$wht_sub."\">";
                                                                }
                                                        } else {
                                                                $OUT .= "<em class=\"admin_note\">";
@@ -662,10 +662,10 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default = '') {
                // Is this a PHP script?
                if ((!isDirectory($file)) && (strpos($file, "".$type.'-') > -1) && (strpos($file, '.php') > 0)) {
                        // Then test if the file is readable
-                       $test = sprintf("%sinc/modules/%s/%s", constant('PATH'), $menu, $file);
+                       $test = sprintf("inc/modules/%s/%s", $menu, $file);
 
                        // Is the file there?
-                       if (isFileReadable($test)) {
+                       if (isIncludeReadable($test)) {
                                // Extract the value for what=xxx
                                $part = substr($file, (strlen($type) + 1));
                                $part = substr($part, 0, -4);
@@ -688,20 +688,20 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default = '') {
 }
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
-function generateUserProfileLink ($uid, $title = '', $wht="list_user") {
+function generateUserProfileLink ($uid, $title = '', $wht = 'list_user') {
        if (($title == '') && ($title != '0')) {
                // Set userid as title
                $title = $uid;
        } // END - if
 
-       if (($title == '0') && ($wht == "list_refs")) {
+       if (($title == '0') && ($wht == 'list_refs')) {
                // Return title again
                return $title;
        } // END - if
 
-       //* DEBUG: */ echo "a:".$title."<br />";
        // Return link
-       return "<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$wht."&amp;uid=".$uid."\" title=\"{--ADMIN_USER_PROFILE_TITLE--}\">".$title."</a>";
+       //* DEBUG: */ OUTPUT_HTML("a:".$title."<br />");
+       return "<a href=\"{?URL?}/modules.php?module=admin&amp;what=".$wht."&amp;uid=".$uid."\" title=\"{--ADMIN_USER_PROFILE_TITLE--}\">".$title."</a>";
 }
 
 // Check "logical-area-mode"
@@ -1295,11 +1295,11 @@ function ADMIN_CREATE_USERID_LINK ($uid) {
        // Is the userid set correctly?
        if ($uid > 0) {
                // Create a link to that profile
-               return '{!URL!}/modules.php?module=admin&amp;what=list_user&amp;uid='.bigintval($uid);
+               return '{?URL?}/modules.php?module=admin&amp;what=list_user&amp;uid='.bigintval($uid);
        } // END - if
 
        // Return a link to the user list
-       return '{!URL!}/modules.php?module=admin&amp;what=list_user';
+       return '{?URL?}/modules.php?module=admin&amp;what=list_user';
 }
 
 //