fix missing bold for your account item
[brisk.git] / web / mailmgr.php
index 91d73c7..e3a970c 100644 (file)
@@ -3,7 +3,7 @@
  *  brisk - mailmgr.php
  *
  *  Copyright (C) 2014      Matteo Nastasi
- *                          mailto: nastasi@alternativeoutput.it 
+ *                          mailto: nastasi@alternativeoutput.it
  *                                  matteo.nastasi@milug.org
  *                          web: http://www.alternativeoutput.it
  *
  *
  */
 
+foreach (array("HTTP_HOST", "DOCUMENT_ROOT") as $i) {
+    if (isset($_SERVER[$i])) {
+        $$i = $_SERVER[$i];
+        }
+    }
+
+foreach (array("f_act", "f_code", "f_hash") as $i) {
+    if (isset($_GET[$i])) {
+        $$i = $_GET[$i];
+        }
+    }
+
+
 $G_base = "";
 
 ini_set("max_execution_time", "240");
@@ -59,9 +72,9 @@ function main() {
                 break;
             }
 
-            if (($bdb->user_update_flag_ty($mai->ucode,
-                                        USER_FLAG_TY_DISABLE, USER_DIS_REA_NU_MAILED,
-                                        USER_FLAG_TY_DISABLE, USER_DIS_REA_NU_TOBECHK)) == FALSE) {
+            if (($bdb->user_update_flag_ty($mai->ucode, USER_FLAG_TY_DISABLE,
+                                        TRUE, USER_DIS_REA_NU_MAILED,
+                                        TRUE, USER_DIS_REA_NU_TOBECHK)) == FALSE) {
                 $errcode = 10003;
                 break;
             }
@@ -72,12 +85,18 @@ function main() {
             }
             $bdb->transaction('COMMIT');
 
-            singlemsg("Verifica della e-mail andata a buon fine.", "Verifica della e-mail andata a buon fine.");
+            singlemsg("Verifica della e-mail andata a buon fine.", "Verifica della e-mail andata a buon fine.<br>Riceverai a breve una email con la tua nuova password.<br>Benvenuto!");
             $errcode = 0;
         } while (FALSE);
         if ($errcode) {
-            singlemsg("E' occorso un errore durante la verifica della e-mail.",
-                      sprintf("E' occorso un errore durante la verifica della e-mail.<br><br>Codice d'errore: %d.<br>", $errcode));
+            if ($errcode == 10002) {
+                singlemsg("L'email è già stata verificata con successo.",
+                          "L'email è già stata verificata con successo, ora attenda che le venga recapitata la password.");
+            }
+            else {
+                singlemsg("E' occorso un errore durante la verifica della e-mail.",
+                          sprintf("E' occorso un errore durante la verifica della e-mail.<br><br>Codice d'errore: %d.<br>", $errcode));
+            }
             $bdb->transaction('ROLLBACK');
         }
     }
@@ -86,4 +105,4 @@ function main() {
 }
 
 main();
-?>
\ No newline at end of file
+?>