20require_once
'../include/constant.php';
22require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
33if (defined(
'MULTI') && MULTI == 0)
34 $version =
$rep->get_value(
'select val from repo_version');
43if ( isset (
$_POST[
"p_user"] ) )
48 Noalyss_user::clean_session(
$http->post(
"p_user"));
50 $User->Check(
false,
'LOGIN');
59 echo
h1(
_(
"Version base de donneés incorrecte"));
60 echo
span(
_(
'Un instant svp'));
61 echo
alert(
_(
'Version de base de données incorrectes, vous devez mettre à jour'));
62 echo
"<META HTTP-EQUIV=\"REFRESH\" content=\"3;url=admin-noalyss.php??action=upgrade&sb=database\">";
65 if (defined(
'NOALYSS_CAPTCHA') && NOALYSS_CAPTCHA==
true)
67 include(
"securimage/securimage.php");
72 echo
alert(
_(
'Code invalide'));
74 header(
"Location: ".NOALYSS_URL.
"/index.php");
80 if (
$User->get_access_mode() ==
'PC' &&
$User->get_authent_method() == 1) {
82 $uuid=
$User->send_code_otp ();
85 $backurl=(isset(
$_POST[
'backurl']))?
$_POST[
'backurl']:
"";
88 $User->input_otp($uuid,$backurl);
94 if (
$User->get_access_mode() ==
'PC' &&
$User->get_authent_method() ==2 ) {
96 $backurl=(isset(
$_POST[
'backurl']))?
$_POST[
'backurl']:
"";
98 $User->input_otp(url:$backurl);
103 if (
$User->get_access_mode()==
'PC')
106 $backurl=NOALYSS_URL.
'/user_login.php?v='.microtime(
true);
107 if ( isset (
$_POST[
'backurl'])) {
108 $backurl=urldecode(
$_POST[
'backurl']);
110 $backurl=preg_replace(
'/^.*\?/',
'',$backurl);
111 $backurl=NOALYSS_URL.
"/do.php?$backurl";
113 header(
"Location: $backurl");
116 header(
"Location: ".NOALYSS_URL.
"/mobile.php");
134 echo
h1(
_(
"Version base de donneés incorrecte"));
135 echo
span(
_(
'Un instant svp'));
136 echo
alert(
_(
'Version de base de données incorrectes, vous devez mettre à jour'));
137 echo
"<META HTTP-EQUIV=\"REFRESH\" content=\"3;url=admin-noalyss.php?action=upgrade&sb=database\">";
145 if (isset(
$_POST[
'to_validate']) ||
$User->get_authent_method() != 0) {
148 $rep->exec_sql(
"delete from otp_send_secret where os_valid_time < now()");
150 $request =
$http->post(
"rq",
"string",
"");
151 $vrf_code =
$http->post(
"vrf_code");
154 if ($request !=
"") {
156 $os_id =
$rep->get_value(
"select os_id from otp_send_secret
160 [$request,
$User->id]);
163 echo
"Désolé, votre code a expiré";
164 echo
"<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=index.php?v=".microtime(
true).
"\">";
173 $vrf_code == $otp_send_secret->get(
'os_code')
174 ||
$User->check_otp($vrf_code)
176 $User->set_identified();
178 $backurl=NOALYSS_URL.
'/user_login.php?v='.microtime(
true);
179 if ( isset (
$_POST[
'backurl'])) {
180 $backurl=urldecode(
$_POST[
'backurl']);
182 $backurl=preg_replace(
'/^.*\?/',
'',$backurl);
183 $backurl=NOALYSS_URL.
"/do.php?$backurl";
184 $otp_send_secret->delete();
186 header(
"Location: $backurl");
190 $backurl=(isset(
$_POST[
'backurl']))?
$_POST[
'backurl']:
"";
191 $User->input_otp(uuid:$request,url:$backurl);
196 if (
$User->check_otp($vrf_code) ==
true) {
197 $User->set_identified();
199 $backurl=NOALYSS_URL.
'/user_login.php?v='.microtime(
true);
200 if ( isset (
$_POST[
'backurl'])) {
202 $backurl=urldecode(
$_POST[
'backurl']);
205 $backurl=preg_replace(
'/^.*\?/',
'',$backurl);
206 $backurl=NOALYSS_URL.
"/do.php?$backurl";
208 header(
"Location: $backurl");
212 $backurl=NOALYSS_URL.
'/user_login.php?v='.microtime(
true);
213 $User->input_otp(url:$backurl);
217 }
catch (Exception $exc) {
224 echo
"<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=user_login.php?v=".microtime(
true).
"\">";
MaintenanceMode($p_file)
When you want to prevent users to connect, create a file in noalyss/ (NOALYSS_BASE) with the message ...
span($p_string, $p_extra='')
html_page_start($p_theme="", $p_script="", $p_script2="")
Default page header for each page.
h1($p_string, $p_class="")
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...
alert($p_msg, $buffer=false)
alert in javascript
_("actif, passif,charge,...")
contains the class for connecting to Noalyss
abstract of the table public.otp_send_secret
for($e=0; $e< count($afiche); $e++) exit
Project: Securimage: A PHP class for creating and managing form CAPTCHA images File: securimage....