function addResetPassword($name, $email) { //3mik user account exists with this email? $row = mysql\User::has3mikEmail($email); $count = $row["count"]; if ($count <= 0) { $message = "Sorry! We could not find any 3mik account with this email."; throw new UIException(array($message)); } //is a request already pending for this email? $row = mysql\Mail::isPending($email); $count = $row["count"]; if ($count > 0) { $message = "Your request is already pending. Please try after 20 minutes."; throw new UIException(array($message)); } $token = Util::getMD5GUID(); mysql\Mail::add($name, $email, $token, AppConstants::RESET_PASSWORD_MAIL); }
use com\indigloo\Url; use com\indigloo\ui\form\Sticky; use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\sc\auth\Login; use com\indigloo\exception\UIException; $gSessionLogin = Login::getLoginInSession(); $loginId = $gSessionLogin->id; if (strcmp($gSessionLogin->provider, Login::MIK) != 0) { $message = "change password only works for 3mik logins!"; throw new UIException(array($message)); } $userDao = new \com\indigloo\sc\dao\User(); $userDBRow = $userDao->getonLoginId($loginId); //tokens for use in next screen $ftoken = Util::getMD5GUID(); $email = $userDBRow["email"]; $femail = Util::encrypt($email); $gWeb = \com\indigloo\core\Web::getInstance(); $gWeb->store("change.password.email", $femail); $gWeb->store("change.password.token", $ftoken); $title = $userDBRow["email"]; $qUrl = base64_encode(Url::current()); $fUrl = Url::current(); $submitUrl = "/user/account/form/change-password.php"; ?> <!DOCTYPE html> <html> <head>