Password reset for admin login added (still buggy if cache is installed and sql_patch...
[mailer.git] / inc / functions.php
index 38b4f58b634af08cb2b399a15e40621ae67fb06f..d94a0336fee24b04d53de9fb23c67cc9fd9ece54 100644 (file)
@@ -368,7 +368,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML='N', $FROM="") {
        }
 
        // Fix HTML parameter (default is no!)
-       if (empty($HTML)) $HTML = 'N';
+       if (empty($HTML)) $HTML = "N";
        if (isBooleanConstantAndTrue('DEBUG_MODE')) {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part
                echo "<PRE>
@@ -377,7 +377,7 @@ To      : ".$TO."
 Subject : ".$SUBJECT."
 Message : ".$MSG."
 </PRE>\n";
-       } elseif (($HTML == 'Y') && (EXT_IS_ACTIVE("html_mail", true))) {
+       } elseif (($HTML == "Y") && (EXT_IS_ACTIVE("html_mail", true))) {
                // Send mail as HTML away
                SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM);
        } elseif (!empty($TO)) {
@@ -386,7 +386,7 @@ Message : ".$MSG."
 
                // Send Mail away
                SEND_RAW_EMAIL($TO, COMPILE_CODE($SUBJECT), COMPILE_CODE($MSG), $FROM);
-       } elseif ($HTML == 'N') {
+       } elseif ($HTML == "N") {
                // Problem found!
                SEND_RAW_EMAIL(WEBMASTER, COMPILE_CODE($SUBJECT), COMPILE_CODE($MSG), $FROM);
        }
@@ -684,7 +684,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") {
 
        // Keept for backward-compatiblity (please replace these variables against our new {--CONST--} syntax!)
        $MAIN_TITLE = MAIN_TITLE; $URL = URL; $WEBMASTER = WEBMASTER;
-       $surname = ""; $family = ""; $nick = ""; $sex = 'N';
+       $surname = ""; $family = ""; $nick = ""; $sex = "N";
 
        // Prepare IP number and User Agent
        $REMOTE_ADDR = getenv('REMOTE_ADDR');
@@ -822,7 +822,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") {
                }
        } else {
                // Neutral sex and email address is default
-               $sex = 'N';
+               $sex = "N";
                $email = WEBMASTER;
        }
 
@@ -1162,10 +1162,10 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0")
 
        case "yn":
                $OUT .= "      <OPTION value=\"Y\"";
-               if ($DEFAULT == 'Y') $OUT .= " selected=\"selected\"";
+               if ($DEFAULT == "Y") $OUT .= " selected=\"selected\"";
                $OUT .= ">".YES."</OPTION>
                        <OPTION value=\"N\"";
-               if ($DEFAULT == 'N') $OUT .= " selected=\"selected\"";
+               if ($DEFAULT == "N") $OUT .= " selected=\"selected\"";
                $OUT .= ">".NO."</OPTION>\n";
                break;
        }
@@ -1910,11 +1910,11 @@ function CREATE_EMAIL_LINK($email, $table="admins") {
 function generateHash ($plainText, $salt = "") {
        global $_CONFIG, $_SERVER;
 
-       // Is the required extension "sql_patches" there?
-       if ((GET_EXT_VERSION("sql_patches") < "0.3.6") || (GET_EXT_VERSION("sql_patches") == "")) {
+       // Is the required extension "sql_patches" there and a salt is not given?
+       if (((GET_EXT_VERSION("sql_patches") < "0.3.6") || (GET_EXT_VERSION("sql_patches") == "")) && (empty($salt))) {
                // Extension sql_patches is missing/outdated so we return the plain text
                return $plainText;
-       }
+       } // END - if
 
        // When the salt is empty build a new one, else use the first x configured characters as the salt
        if ($salt == "") {