77 lines
2.7 KiB
PHP
77 lines
2.7 KiB
PHP
<?php
|
|
if (isset($_GET["login"]) || isset($_GET["md5_user"])) {
|
|
$data = Utility::sanitizeB64JSON_parse($_GET["login"]);
|
|
|
|
if (isset($_GET["md5_user"])) {
|
|
if (!is_array($data)) {
|
|
$data = array();
|
|
}
|
|
|
|
$data["md5_user"] = Utility::sanitize($_GET["md5_user"]);
|
|
}
|
|
|
|
// $userName = $password = $md5User = "";
|
|
// $azienda = null;
|
|
// if (isset($_GET["md5_user"])) {
|
|
// $md5User = Utility::sanitize($_GET["md5_user"]);
|
|
// } else {
|
|
// $data = Utility::sanitizeB64JSON_parse($_GET["login"]);
|
|
// $userName = $data["username"];
|
|
// $password = $data["password"];
|
|
// $azienda = $data["azienda"];
|
|
// }
|
|
|
|
$LoginRet = Login::authenticate($data);
|
|
if ($LoginRet->is_OK()) {
|
|
$LoginRet->display();
|
|
|
|
} else {
|
|
$flagLoginFailed = true;
|
|
if (\Controller::is_ajaxRequest()) {
|
|
$LoginRet->display();
|
|
}
|
|
}
|
|
} else if (isset($_GET["form-renewpassword"])) {
|
|
include "form-renewpassword.php";
|
|
exit;
|
|
} else if (isset($_GET["request_resetPassword"])) {
|
|
$data = Utility::sanitizeB64JSON_parse($_GET["request_resetPassword"]);
|
|
Login::request_resetPassword($data)->display();
|
|
} else if (isset($_POST["renew_password"])) {
|
|
$data = Utility::sanitizeB64JSON_parse($_POST["renew_password"]);
|
|
Login::renew_password($data)->display();
|
|
} else if (isset($_POST["set_newPasswordExpired"])) {
|
|
$data = Utility::sanitizeB64JSON_parse($_POST["set_newPasswordExpired"]);
|
|
Login::set_newPasswordExpired($data)->display();
|
|
} else if (isset($_GET["get_listBgAzi"])) {
|
|
$Ret = new Ret;
|
|
$data = Utility::sanitizeB64JSON_parse($_GET["get_listBgAzi"]);
|
|
$profileDB = $data["azienda"];
|
|
|
|
if (is_null($profileDB)) {
|
|
$profileDB = PVM::getAziendaHost();
|
|
}
|
|
|
|
$arr_files = Login::get_backgroundsAzienda($profileDB);
|
|
shuffle($arr_files);
|
|
$retData = array(
|
|
"list-background" => $arr_files,
|
|
"logo" => AziendaUtils::getLogo($profileDB)
|
|
);
|
|
|
|
$Ret->set_data($retData)->display();
|
|
} else if (isset($_POST["sign_up"])) {
|
|
Utility::check_recaptchaValidation(); // LA RICHIESTA PREVEDE VALIDAZIONE reCAPTCHA
|
|
$data = Utility::sanitizeB64JSON_parse($_POST["sign_up"]);
|
|
Login\SignUp::send($data)->display();
|
|
} else if (isset($_GET["getNazioni"])) {
|
|
$data = Utility::sanitizeB64JSON_parse($_GET["getNazioni"]);
|
|
Login\SignUp::getNazioni($data)->display();
|
|
} else if (isset($_GET["checkValidUsername"])) {
|
|
$data = Utility::sanitizeB64JSON_parse($_GET["checkValidUsername"]);
|
|
User::checkValidUsername($data)->display();
|
|
} else if (Controller::is_ajaxRequest()) {
|
|
$Ret = new Ret;
|
|
$Ret->set_errorCode(ErrorHandler::UNEXPECTED_AJAX_METHOD)->display();
|
|
}
|