Esempio n. 1
0
$strFooter = $hldGlobal->fnGetFooter();
//Fetches footer template
$strLmenu = $hldGlobal->fnMenu("", $arrMpage);
//Fetches left menu
$hdlTpl->setVariable("metatag", $strMetatag);
//Assigns Metatag
$hdlTpl->setVariable("header", $strHeader);
//Assigns header
$hdlTpl->setVariable("footer", $strFooter);
//Assigns footer
$hdlTpl->setVariable("menu", $strLmenu);
//Assigns left menu
if ($_POST["submit"] == "Forgot Password") {
    $strErrorMessage = "";
    $intError = 0;
    $intCheck = $hldGlobal->fnCheckEmail($_POST["email"]);
    if (!$intCheck) {
        $strErrorMessage = "Email address does not exists!";
        $intError = 1;
    } else {
        $strPass = $hldGlobal->generatePassword(5, 8);
        $arrUser = $hldGlobal->fnGetUserEmail($_POST["email"]);
        $sqlUpd = "UPDATE tbluser SET password='******' WHERE id=" . $arrUser[0]["id"];
        mysql_query($sqlUpd) or die(mysql_error());
        $to = $_POST["email"];
        $subject = 'Login credentials';
        $message = 'Hi 
            Your login credentials
            
            User name : ' . $arrUser[0]["username"] . '
            Password : ' . $strPass;
Esempio n. 2
0
     $intError = 1;
 }
 if (trim($_POST["email"]) == "") {
     $strErrorMessage .= "Email should not be blank<br />";
     $intError = 1;
 }
 if (trim(strlen($_POST["strPassword"])) < 4) {
     $strErrorMessage .= "Password should be atlest 4 character long<br />";
     $intError = 1;
 }
 if (trim($_POST["strPassword"]) != trim($_POST["cPassword"])) {
     $strErrorMessage .= "Password does not match<br />";
     $intError = 1;
 }
 if (trim($_POST["email"]) != "") {
     $intEmail = $hldGlobal->fnCheckEmail($_POST["email"], $_SESSION["UsErId"]);
     if ($intEmail) {
         $strErrorMessage .= "Email already present<br />";
         $intError = 1;
     }
 }
 if (trim($_POST["utype"]) == "--") {
     if ($_POST["date18"] == "" && trim($_POST["noofhrs"]) == "") {
         $strErrorMessage .= "Please select date <br> --OR-- <br> Enter value for how many hours, week or month this user should be valid<br />";
         $intError = 1;
     }
     if (trim($_POST["noofhrs"]) != "") {
         if (!preg_match("/^[0-9]*\$/", trim($_POST["noofhrs"]))) {
             $strErrormessage .= "Please enter only numeric value.<br>";
             $intError = 0;
         }