function Page_Main() { global $UserTableConn, $Language, $gsFormError; global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("forgotpwd", "RequestPwdPage", ew_CurrentUrl(), "", "", TRUE); $bPostBack = ew_IsHttpPost(); $bValidEmail = FALSE; if ($bPostBack) { // Setup variables $this->Email = $_POST["email"]; $bValidEmail = $this->ValidateForm($this->Email); if ($bValidEmail) { if (EW_ENCRYPTED_PASSWORD) { $this->Action = "reset"; } else { $this->Action = "confirm"; } // Send password directly if not MD5 $this->ActivateCode = ew_Encrypt($this->Email); } else { $this->setFailureMessage($gsFormError); } // Handle email activation } elseif (@$_GET["action"] != "") { $this->Action = $_GET["action"]; $this->Email = @$_GET["email"]; $this->ActivateCode = @$_GET["code"]; if ($this->Email != ew_Decrypt($this->ActivateCode) || strtolower($this->Action) != "confirm" && strtolower($this->Action) != "reset") { // Email activation if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("ActivateFailed")); } // Set activate failed message $this->Page_Terminate("login.php"); // Go to login page } if (strtolower($this->Action) == "reset") { $this->Action = "resetpassword"; } } if ($this->Action != "") { $bEmailSent = FALSE; // Set up filter (SQL WHERE clause) and get Return SQL // SQL constructor in user class, userinfo.php $sFilter = str_replace("%e", ew_AdjustSql($this->Email, EW_USER_TABLE_DBID), EW_USER_EMAIL_FILTER); $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); if ($RsUser = $UserTableConn->Execute($sSql)) { if (!$RsUser->EOF) { $rsold = $RsUser->fields; $bValidEmail = TRUE; // Call User Recover Password event $bValidEmail = $this->User_RecoverPassword($rsold); if ($bValidEmail) { $sUserName = $rsold['CODE']; $sPassword = $rsold['PASS']; } } else { $bValidEmail = FALSE; $this->setFailureMessage($Language->Phrase("InvalidEmail")); } $RsUser->Close(); if ($bValidEmail) { if (strtolower($this->Action) == "resetpassword") { // Reset password $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = $sUserName; // Save login user name $_SESSION[EW_SESSION_STATUS] = "passwordreset"; $this->Page_Terminate("changepwd.php"); } else { $Email = new cEmail(); if (strtolower($this->Action) == "confirm") { $Email->Load(EW_EMAIL_FORGOTPWD_TEMPLATE); $Email->ReplaceContent('<!--$Password-->', $sPassword); } else { $Email->Load(EW_EMAIL_RESETPWD_TEMPLATE); $sActivateLink = ew_FullUrl() . "?action=reset"; $sActivateLink .= "&email=" . $this->Email; $sActivateLink .= "&code=" . $this->ActivateCode; $Email->ReplaceContent('<!--$ActivateLink-->', $sActivateLink); } $Email->ReplaceSender(EW_SENDER_EMAIL); // Replace Sender $Email->ReplaceRecipient($this->Email); // Replace Recipient $Email->ReplaceContent('<!--$UserName-->', $sUserName); $Args = array(); if (EW_ENCRYPTED_PASSWORD && strtolower($this->Action) == "confirm") { $Args["rs"] =& $rsnew; } if ($this->Email_Sending($Email, $Args)) { $bEmailSent = $Email->Send(); } } } } if ($bEmailSent) { if ($this->getSuccessMessage() == "") { if (strtolower($this->Action) == "confirm") { $this->setSuccessMessage($Language->Phrase("PwdEmailSent")); } else { $this->setSuccessMessage($Language->Phrase("ResetPwdEmailSent")); } } // Set up success message $this->Page_Terminate("login.php"); // Return to login page } elseif ($bValidEmail) { $this->setFailureMessage($Email->SendErrDescription); // Set up error message } } }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb->Add("list", $this->TableVar, $this->AddMasterUrl("banklist.php"), "", $this->TableVar, TRUE); $PageId = "delete"; $Breadcrumb->Add("delete", $PageId, $url); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = ew_CurrentUrl(); $url = preg_replace('/\\?cmd=reset(all){0,1}$/i', '', $url); // Remove cmd=reset / cmd=resetall $Breadcrumb->Add("list", $this->TableVar, $url, "", $this->TableVar, TRUE); }
function Page_Init() { global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm; // Security $Security = new cAdvancedSecurity(); if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } if (!$Security->IsLoggedIn()) { $Security->SaveLastUrl(); $this->Page_Terminate("login.php"); } // Get export parameters if (@$_GET["export"] != "") { $this->Export = $_GET["export"]; } elseif (ew_IsHttpPost()) { if (@$_POST["exporttype"] != "") { $this->Export = $_POST["exporttype"]; } } else { $this->setExportReturnUrl(ew_CurrentUrl()); } $gsExport = $this->Export; // Get export parameter, used in header $gsExportFile = $this->TableVar; // Get export file, used in header // Get grid add count $gridaddcnt = @$_GET[EW_TABLE_GRID_ADD_ROW_COUNT]; if (is_numeric($gridaddcnt) && $gridaddcnt > 0) { $this->GridAddRowCount = $gridaddcnt; } // Set up list options $this->SetupListOptions(); // Setup export options $this->SetupExportOptions(); $this->CurrentAction = @$_GET["a"] != "" ? $_GET["a"] : @$_POST["a_list"]; // Global Page Loading event (in userfn*.php) Page_Loading(); // Page Load event $this->Page_Load(); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", $this->TableVar, "Stateslist.php", $this->TableVar, TRUE); $PageId = "view"; $Breadcrumb->Add("view", $PageId, ew_CurrentUrl()); }
function Page_Main() { global $conn, $Language, $Security, $gsFormError; global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("changepwd", "ChangePwdPage", ew_CurrentUrl(), "", "", TRUE); $bPostBack = ew_IsHttpPost(); $bValidate = TRUE; if ($bPostBack) { $this->OldPassword = ew_StripSlashes(@$_POST["opwd"]); $this->NewPassword = ew_StripSlashes(@$_POST["npwd"]); $this->ConfirmedPassword = ew_StripSlashes(@$_POST["cpwd"]); $bValidate = $this->ValidateForm($this->OldPassword, $this->NewPassword, $this->ConfirmedPassword); if (!$bValidate) { $this->setFailureMessage($gsFormError); } } $bPwdUpdated = FALSE; if ($bPostBack && $bValidate) { // Setup variables $sUsername = $Security->CurrentUserName(); $sFilter = str_replace("%u", ew_AdjustSql($sUsername), EW_USER_NAME_FILTER); // Set up filter (Sql Where Clause) and get Return SQL // SQL constructor in usuarios class, usuariosinfo.php $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); if ($rs = $conn->Execute($sSql)) { if (!$rs->EOF) { $rsold = $rs->fields; if (ew_ComparePassword($rsold['contrasenia'], $this->OldPassword)) { $bValidPwd = TRUE; $bValidPwd = $this->User_ChangePassword($rsold, $sUsername, $this->OldPassword, $this->NewPassword); if ($bValidPwd) { $rsnew = array('contrasenia' => $this->NewPassword); // Change Password $sEmail = $rsold['email']; $rs->Close(); $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $bValidPwd = $this->Update($rsnew); $conn->raiseErrorFn = ''; if ($bValidPwd) { $bPwdUpdated = TRUE; } } else { $this->setFailureMessage($Language->Phrase("InvalidNewPassword")); $rs->Close(); } } else { $this->setFailureMessage($Language->Phrase("InvalidPassword")); } } else { $rs->Close(); } } } if ($bPwdUpdated) { if (@$sEmail != "") { // Load Email Content $Email = new cEmail(); $Email->Load("phptxt/changepwd.txt"); $Email->ReplaceSender(EW_SENDER_EMAIL); // Replace Sender $Email->ReplaceRecipient($sEmail); // Replace Recipient $Email->ReplaceContent('<!--$Password-->', $this->NewPassword); $Email->Charset = EW_EMAIL_CHARSET; $Args = array(); $Args["rs"] =& $rsnew; $bEmailSent = FALSE; if ($this->Email_Sending($Email, $Args)) { $bEmailSent = $Email->Send(); } // Send email failed if (!$bEmailSent) { $this->setFailureMessage($Email->SendErrDescription); } } if ($this->getSuccessMessage() == "") { $this->setSuccessMessage($Language->Phrase("PasswordChanged")); } // Set up success message $this->Page_Terminate("index.php"); // Exit page and clean up } }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", $this->TableVar, "servicio_medico_prestadolist.php", "", $this->TableVar, TRUE); $PageId = $this->CurrentAction == "C" ? "Copy" : "Add"; $Breadcrumb->Add("add", $PageId, ew_CurrentUrl()); }
function Page_Init() { global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm; global $tbl_facebook_stat; // Security $Security = new cAdvancedSecurity(); if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } if (!$Security->IsLoggedIn()) { $Security->SaveLastUrl(); $this->Page_Terminate("login.php"); } $Security->TablePermission_Loading(); $Security->LoadCurrentUserLevel($this->TableName); $Security->TablePermission_Loaded(); if (!$Security->IsLoggedIn()) { $Security->SaveLastUrl(); $this->Page_Terminate("login.php"); } if (!$Security->CanList()) { $Security->SaveLastUrl(); $this->Page_Terminate("login.php"); } // Create form object $objForm = new cFormObj(); // Get export parameters if (@$_GET["export"] != "") { $tbl_facebook_stat->Export = $_GET["export"]; } elseif (ew_IsHttpPost()) { if (@$_POST["exporttype"] != "") { $tbl_facebook_stat->Export = $_POST["exporttype"]; } } else { $tbl_facebook_stat->setExportReturnUrl(ew_CurrentUrl()); } $gsExport = $tbl_facebook_stat->Export; // Get export parameter, used in header $gsExportFile = $tbl_facebook_stat->TableVar; // Get export file, used in header // Global Page Loading event (in userfn*.php) Page_Loading(); // Page Load event $this->Page_Load(); }
function SetupBreadcrumb() { global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb->Add("custom", "backup_v1_php", $url, "", "backup_v1_php", TRUE); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", $this->TableVar, "servicio_medico_prestadolist.php", "", $this->TableVar, TRUE); $PageId = "delete"; $Breadcrumb->Add("delete", $PageId, ew_CurrentUrl()); }
function SetupBreadcrumb() { global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb->Add("custom", "PrincipalDestinations_php", $url, "", "PrincipalDestinations_php", TRUE); }
function Page_Main() { global $Security, $Language, $UserProfile, $gsFormError; global $Breadcrumb; $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("login", "LoginPage", $url, "", "", TRUE); $sPassword = ""; $sLastUrl = $Security->LastUrl(); // Get last URL if ($sLastUrl == "") { $sLastUrl = "index.php"; } // If session expired, show session expired message if (@$_GET["expired"] == "1") { $this->setFailureMessage($Language->Phrase("SessionExpired")); } if (IsLoggingIn()) { $this->Username = @$_SESSION[EW_SESSION_USER_PROFILE_USER_NAME]; $sPassword = @$_SESSION[EW_SESSION_USER_PROFILE_PASSWORD]; $this->LoginType = @$_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE]; $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE); if ($bValidPwd) { $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = ""; $_SESSION[EW_SESSION_USER_PROFILE_PASSWORD] = ""; $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = ""; } } else { if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } $Security->LoadUserLevel(); // Load user level $this->Username = ""; // Initialize $encrypted = FALSE; if (isset($_POST["username"])) { $this->Username = ew_RemoveXSS(ew_StripSlashes($_POST["username"])); $sPassword = ew_RemoveXSS(ew_StripSlashes(@$_POST["password"])); $this->LoginType = strtolower(ew_RemoveXSS(@$_POST["type"])); } else { if (EW_ALLOW_LOGIN_BY_URL && isset($_GET["username"])) { $this->Username = ew_RemoveXSS(ew_StripSlashes($_GET["username"])); $sPassword = ew_RemoveXSS(ew_StripSlashes(@$_GET["password"])); $this->LoginType = strtolower(ew_RemoveXSS(@$_GET["type"])); $encrypted = !empty($_GET["encrypted"]); } } if ($this->Username != "") { $bValidate = $this->ValidateForm($this->Username, $sPassword); if (!$bValidate) { $this->setFailureMessage($gsFormError); } $_SESSION[EW_SESSION_USER_LOGIN_TYPE] = $this->LoginType; // Save user login type $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = $this->Username; // Save login user name $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = $this->LoginType; // Save login type // Max login attempt checking if ($UserProfile->ExceedLoginRetry($this->Username)) { $bValidate = FALSE; $this->setFailureMessage(str_replace("%t", EW_USER_PROFILE_RETRY_LOCKOUT, $Language->Phrase("ExceedMaxRetry"))); } } else { if ($Security->IsLoggedIn()) { if ($this->getFailureMessage() == "") { $this->Page_Terminate($sLastUrl); } // Return to last accessed page } $bValidate = FALSE; // Restore settings if (@$_COOKIE[EW_PROJECT_NAME]['Checksum'] == strval(crc32(md5(EW_RANDOM_KEY)))) { $this->Username = ew_Decrypt(@$_COOKIE[EW_PROJECT_NAME]['Username']); } if (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "autologin") { $this->LoginType = "a"; } elseif (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "rememberusername") { $this->LoginType = "u"; } else { $this->LoginType = ""; } } $bValidPwd = FALSE; if ($bValidate) { // Call Logging In event $bValidate = $this->User_LoggingIn($this->Username, $sPassword); if ($bValidate) { $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE, $encrypted); // Manual login if (!$bValidPwd) { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("InvalidUidPwd")); } // Invalid user id/password } } else { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("LoginCancelled")); } // Login cancelled } } } if ($bValidPwd) { // Write cookies if ($this->LoginType == "a") { // Auto login setcookie(EW_PROJECT_NAME . '[AutoLogin]', "autologin", EW_COOKIE_EXPIRY_TIME); // Set autologin cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Password]', ew_Encrypt($sPassword), EW_COOKIE_EXPIRY_TIME); // Set password cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } elseif ($this->LoginType == "u") { // Remember user name setcookie(EW_PROJECT_NAME . '[AutoLogin]', "rememberusername", EW_COOKIE_EXPIRY_TIME); // Set remember user name cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } else { setcookie(EW_PROJECT_NAME . '[AutoLogin]', "", EW_COOKIE_EXPIRY_TIME); // Clear auto login cookie } $this->WriteAuditTrailOnLogin($this->Username); // Call loggedin event $this->User_LoggedIn($this->Username); $this->Page_Terminate($sLastUrl); // Return to last accessed URL } elseif ($this->Username != "" && $sPassword != "") { // Call user login error event $this->User_LoginError($this->Username, $sPassword); } }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb->Add("list", $this->TableVar, "in_bodegaubicacioneslist.php", "", $this->TableVar, TRUE); $PageId = "delete"; $Breadcrumb->Add("delete", $PageId, $url); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", $this->TableVar, "localidadeslist.php", "", $this->TableVar, TRUE); $PageId = "addopt"; $Breadcrumb->Add("addopt", $PageId, ew_CurrentUrl()); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", $this->TableVar, "cciag_montoslist.php", "", $this->TableVar, TRUE); $PageId = $this->CurrentAction == "C" ? "Copy" : "Add"; $Breadcrumb->Add("add", $PageId, ew_CurrentUrl()); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb->Add("list", $this->TableVar, "profile_piclist.php", "", $this->TableVar, TRUE); $PageId = "edit"; $Breadcrumb->Add("edit", $PageId, $url); }
function Page_Init() { global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm; // Security $Security = new cAdvancedSecurity(); if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } if (!$Security->IsLoggedIn()) { $Security->SaveLastUrl(); $this->Page_Terminate("login.php"); } // Get export parameters if (@$_GET["export"] != "") { $this->Export = $_GET["export"]; } elseif (ew_IsHttpPost()) { if (@$_POST["exporttype"] != "") { $this->Export = $_POST["exporttype"]; } } else { $this->setExportReturnUrl(ew_CurrentUrl()); } $gsExport = $this->Export; // Get export parameter, used in header $gsExportFile = $this->TableVar; // Get export file, used in header if (@$_GET["realmid"] != "") { if ($gsExportFile != "") { $gsExportFile .= "_"; } $gsExportFile .= ew_StripSlashes($_GET["realmid"]); } if (@$_GET["acctid"] != "") { if ($gsExportFile != "") { $gsExportFile .= "_"; } $gsExportFile .= ew_StripSlashes($_GET["acctid"]); } // Setup export options $this->SetupExportOptions(); $this->CurrentAction = @$_GET["a"] != "" ? $_GET["a"] : @$_POST["a_list"]; // Global Page Loading event (in userfn*.php) Page_Loading(); // Page Load event $this->Page_Load(); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $PageCaption = $this->TableCaption(); $Breadcrumb->Add("list", "<span id=\"ewPageCaption\">" . $PageCaption . "</span>", "gallery_detaillist.php", $this->TableVar); $PageCaption = $Language->Phrase("delete"); $Breadcrumb->Add("delete", "<span id=\"ewPageCaption\">" . $PageCaption . "</span>", ew_CurrentUrl(), $this->TableVar); }
function Page_Init() { global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm; global $order; // Security $Security = new cAdvancedSecurity(); if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } if (!$Security->IsLoggedIn()) { $Security->SaveLastUrl(); $this->Page_Terminate("login.php"); } // Get export parameters if (@$_GET["export"] != "") { $order->Export = $_GET["export"]; } elseif (ew_IsHttpPost()) { if (@$_POST["exporttype"] != "") { $order->Export = $_POST["exporttype"]; } } else { $order->setExportReturnUrl(ew_CurrentUrl()); } $gsExport = $order->Export; // Get export parameter, used in header $gsExportFile = $order->TableVar; // Get export file, used in header // Global Page Loading event (in userfn*.php) Page_Loading(); // Page Load event $this->Page_Load(); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $PageCaption = $this->TableCaption(); $Breadcrumb->Add("list", "<span id=\"ewPageCaption\">" . $PageCaption . "</span>", "estadoslist.php", $this->TableVar); $PageCaption = $this->CurrentAction == "C" ? $Language->Phrase("Copy") : $Language->Phrase("Add"); $Breadcrumb->Add("add", "<span id=\"ewPageCaption\">" . $PageCaption . "</span>", ew_CurrentUrl(), $this->TableVar); }
function Page_Main() { global $conn, $Language, $gsFormError; global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("forgotpwd", "<span id=\"ewPageCaption\">" . $Language->Phrase("RequestPwdPage") . "</span>", ew_CurrentUrl()); $bPostBack = ew_IsHttpPost(); $bValidEmail = FALSE; if ($bPostBack) { // Setup variables $this->Email = $_POST["email"]; $bValidEmail = $this->ValidateForm($this->Email); if ($bValidEmail) { $this->Action = "activate"; $this->ActivateCode = ew_Encrypt($this->Email); } else { $this->setFailureMessage($gsFormError); } // Handle email activation } elseif (@$_GET["action"] != "") { $this->Action = $_GET["action"]; $this->Email = @$_GET["email"]; $this->ActivateCode = @$_GET["code"]; if ($this->Email != ew_Decrypt($this->ActivateCode) || strtolower($this->Action) != "confirm") { // Email activation if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("ActivateFailed")); } // Set activate failed message $this->Page_Terminate("login.php"); // Go to login page } } if ($this->Action != "") { $bEmailSent = FALSE; // Set up filter (SQL WHERE clause) and get Return SQL // SQL constructor in usuario class, usuarioinfo.php $sFilter = str_replace("%e", ew_AdjustSql($this->Email), EW_USER_EMAIL_FILTER); $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); if ($RsUser = $conn->Execute($sSql)) { if (!$RsUser->EOF) { $rsold = $RsUser->fields; $bValidEmail = TRUE; // Call User Recover Password event $bValidEmail = $this->User_RecoverPassword($rsold); if ($bValidEmail) { $sUserName = $rsold['usuario']; $sPassword = $rsold['contrasenia']; if (EW_ENCRYPTED_PASSWORD) { if (strtolower($this->Action) == "confirm") { $sPassword = substr($sPassword, 0, 16); // Use first 16 characters only $rsnew = array('contrasenia' => $sPassword); // Reset the password $this->Update($rsnew); } } else { $this->Action = "confirm"; // Send password directly if not MD5 } } } else { $bValidEmail = FALSE; $this->setFailureMessage($Language->Phrase("InvalidEmail")); } if ($bValidEmail) { $Email = new cEmail(); if (strtolower($this->Action) == "confirm") { $Email->Load("phptxt/forgotpwd.txt"); $Email->ReplaceContent('<!--$Password-->', $sPassword); } else { $Email->Load("phptxt/resetpwd.txt"); $sActivateLink = ew_FullUrl() . "?action=confirm"; $sActivateLink .= "&email=" . $this->Email; $sActivateLink .= "&code=" . $this->ActivateCode; $Email->ReplaceContent('<!--$ActivateLink-->', $sActivateLink); } $Email->ReplaceSender(EW_SENDER_EMAIL); // Replace Sender $Email->ReplaceRecipient($this->Email); // Replace Recipient $Email->ReplaceContent('<!--$UserName-->', $sUserName); $Email->Charset = EW_EMAIL_CHARSET; $Args = array(); if (EW_ENCRYPTED_PASSWORD && strtolower($this->Action) == "confirm") { $Args["rs"] =& $rsnew; } if ($this->Email_Sending($Email, $Args)) { $bEmailSent = $Email->Send(); } } $RsUser->Close(); } if ($bEmailSent) { if ($this->getSuccessMessage() == "") { if (strtolower($this->Action) == "confirm") { $this->setSuccessMessage($Language->Phrase("PwdEmailSent")); } else { $this->setSuccessMessage($Language->Phrase("ResetPwdEmailSent")); } } // Set up success message $this->Page_Terminate("login.php"); // Return to login page } elseif ($bValidEmail) { $this->setFailureMessage($Language->Phrase("FailedToSendMail")); // Set up error message } } }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", $this->TableVar, "cciag_tramiteslist.php", "", $this->TableVar, TRUE); $PageId = "edit"; $Breadcrumb->Add("edit", $PageId, ew_CurrentUrl()); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $PageCaption = $this->TableCaption(); $url = ew_CurrentUrl(); $url = preg_replace('/\\?cmd=reset(all){0,1}$/i', '', $url); // Remove cmd=reset / cmd=resetall $Breadcrumb->Add("list", "<span id=\"ewPageCaption\">" . $PageCaption . "</span>", $url, $this->TableVar); }
function Page_Main() { global $Security, $Language; global $EW_RELATED_LANGUAGE_FOLDER; global $Breadcrumb; $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", "nivel_usuario", "nivel_usuariolist.php", "", "nivel_usuario"); $Breadcrumb->Add("userpriv", "UserLevelPermission", $url); // Try to load PHP Report Maker language file // Note: The langauge IDs must be the same in both projects $Security->LoadUserLevelFromConfigFile($this->UserLevelList, $this->UserLevelPrivList, $this->TableList, TRUE); if ($EW_RELATED_LANGUAGE_FOLDER != "") { $this->ReportLanguage = new cLanguage($EW_RELATED_LANGUAGE_FOLDER); } $this->TableNameCount = count($this->TableList); $this->Privileges =& ew_InitArray($this->TableNameCount, 0); // Get action if (@$_POST["a_edit"] == "") { $this->CurrentAction = "I"; // Display with input box // Load key from QueryString if (@$_GET["codigo"] != "") { $this->codigo->setQueryStringValue($_GET["codigo"]); } else { $this->Page_Terminate("nivel_usuariolist.php"); // Return to list } if ($this->codigo->QueryStringValue == "-1") { $this->Disabled = " disabled=\"disabled\""; } else { $this->Disabled = ""; } } else { $this->CurrentAction = $_POST["a_edit"]; // Get fields from form $this->codigo->setFormValue($_POST["x_codigo"]); for ($i = 0; $i < $this->TableNameCount; $i++) { if (defined("EW_USER_LEVEL_COMPAT")) { $this->Privileges[$i] = intval(@$_POST["Add_" . $i]) + intval(@$_POST["Delete_" . $i]) + intval(@$_POST["Edit_" . $i]) + intval(@$_POST["List_" . $i]); } else { $this->Privileges[$i] = intval(@$_POST["Add_" . $i]) + intval(@$_POST["Delete_" . $i]) + intval(@$_POST["Edit_" . $i]) + intval(@$_POST["List_" . $i]) + intval(@$_POST["View_" . $i]) + intval(@$_POST["Search_" . $i]); } } } switch ($this->CurrentAction) { case "I": // Display if (!$Security->SetUpUserLevelEx()) { // Get all User Level info $this->Page_Terminate("nivel_usuariolist.php"); } // Return to list break; case "U": // Update if ($this->EditRow()) { // Update record based on key if ($this->getSuccessMessage() == "") { $this->setSuccessMessage($Language->Phrase("UpdateSuccess")); } // Set up update success message // Alternatively, comment out the following line to go back to this page $this->Page_Terminate("nivel_usuariolist.php"); // Return to list } } }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("list", $this->TableVar, "nilailist.php", $this->TableVar, TRUE); $PageId = "delete"; $Breadcrumb->Add("delete", $PageId, ew_CurrentUrl()); }
function Page_Init() { global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm; global $t_promotions_vins; // Get export parameters if (@$_GET["export"] != "") { $t_promotions_vins->Export = $_GET["export"]; } elseif (ew_IsHttpPost()) { if (@$_POST["exporttype"] != "") { $t_promotions_vins->Export = $_POST["exporttype"]; } } else { $t_promotions_vins->setExportReturnUrl(ew_CurrentUrl()); } $gsExport = $t_promotions_vins->Export; // Get export parameter, used in header $gsExportFile = $t_promotions_vins->TableVar; // Get export file, used in header $Charset = EW_CHARSET != "" ? ";charset=" . EW_CHARSET : ""; // Charset used in header // Get grid add count $gridaddcnt = @$_GET[EW_TABLE_GRID_ADD_ROW_COUNT]; if (is_numeric($gridaddcnt) && $gridaddcnt > 0) { $t_promotions_vins->GridAddRowCount = $gridaddcnt; } // Set up list options $this->SetupListOptions(); // Setup export options $this->SetupExportOptions(); // Global Page Loading event (in userfn*.php) Page_Loading(); // Page Load event $this->Page_Load(); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb->Add("list", $this->TableVar, "sub_categorylist.php", "", $this->TableVar, TRUE); $PageId = "view"; $Breadcrumb->Add("view", $PageId, $url); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb->Add("list", $this->TableVar, $this->AddMasterUrl("flightlist.php"), "", $this->TableVar, TRUE); $PageId = $this->CurrentAction == "C" ? "Copy" : "Add"; $Breadcrumb->Add("add", $PageId, $url); }
function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $PageCaption = $this->TableCaption(); $Breadcrumb->Add("list", "<span id=\"ewPageCaption\">" . $PageCaption . "</span>", "cciagsocioslist.php", $this->TableVar); $PageCaption = $Language->Phrase("edit"); $Breadcrumb->Add("edit", "<span id=\"ewPageCaption\">" . $PageCaption . "</span>", ew_CurrentUrl(), $this->TableVar); }
function Page_Main() { global $Security, $Language, $UserProfile, $gsFormError; global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("login", "<span id=\"ewPageCaption\">" . $Language->Phrase("LoginPage") . "</span>", ew_CurrentUrl()); $sPassword = ""; $sLastUrl = $Security->LastUrl(); // Get last URL if ($sLastUrl == "") { $sLastUrl = "index.php"; } if (IsLoggingIn()) { $this->Username = @$_SESSION[EW_SESSION_USER_PROFILE_USER_NAME]; $sPassword = @$_SESSION[EW_SESSION_USER_PROFILE_PASSWORD]; $this->LoginType = @$_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE]; $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE); if ($bValidPwd) { $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = ""; $_SESSION[EW_SESSION_USER_PROFILE_PASSWORD] = ""; $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = ""; } } else { if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } $this->Username = ""; // Initialize if (@$_POST["username"] != "") { // Setup variables $this->Username = ew_RemoveXSS(ew_StripSlashes(@$_POST["username"])); $sPassword = ew_RemoveXSS(ew_StripSlashes(@$_POST["password"])); $this->LoginType = strtolower(ew_RemoveXSS(@$_POST["type"])); } if ($this->Username != "") { $bValidate = $this->ValidateForm($this->Username, $sPassword); if (!$bValidate) { $this->setFailureMessage($gsFormError); } $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = $this->Username; // Save login user name $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = $this->LoginType; // Save login type } else { if ($Security->IsLoggedIn()) { if ($this->getFailureMessage() == "") { $this->Page_Terminate($sLastUrl); } // Return to last accessed page } $bValidate = FALSE; // Restore settings if (@$_COOKIE[EW_PROJECT_NAME]['Checksum'] == strval(crc32(md5(EW_RANDOM_KEY)))) { $this->Username = ew_Decrypt(@$_COOKIE[EW_PROJECT_NAME]['Username']); } if (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "autologin") { $this->LoginType = "a"; } elseif (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "rememberusername") { $this->LoginType = "u"; } else { $this->LoginType = ""; } } $bValidPwd = FALSE; if ($bValidate) { // Call Logging In event $bValidate = $this->User_LoggingIn($this->Username, $sPassword); if ($bValidate) { $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE); // Manual login if (!$bValidPwd) { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("InvalidUidPwd")); } // Invalid user id/password } } else { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("LoginCancelled")); } // Login cancelled } } } if ($bValidPwd) { // Write cookies if ($this->LoginType == "a") { // Auto login setcookie(EW_PROJECT_NAME . '[AutoLogin]', "autologin", EW_COOKIE_EXPIRY_TIME); // Set autologin cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Password]', ew_Encrypt($sPassword), EW_COOKIE_EXPIRY_TIME); // Set password cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } elseif ($this->LoginType == "u") { // Remember user name setcookie(EW_PROJECT_NAME . '[AutoLogin]', "rememberusername", EW_COOKIE_EXPIRY_TIME); // Set remember user name cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } else { setcookie(EW_PROJECT_NAME . '[AutoLogin]', "", EW_COOKIE_EXPIRY_TIME); // Clear auto login cookie } // Call loggedin event $this->User_LoggedIn($this->Username); $this->Page_Terminate($sLastUrl); // Return to last accessed URL } elseif ($this->Username != "" && $sPassword != "") { // Call user login error event $this->User_LoginError($this->Username, $sPassword); } }