[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/04: Redirect if DB version not correct
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 01/04: Redirect if DB version not correct |
Date: |
Sat, 16 Jan 2021 06:01:28 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 01ef0a8d608dd3f25d9eac080d48cb6b565d887f
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Fri Jan 15 17:12:15 2021 +0100
Redirect if DB version not correct
---
html/login.php | 52 +++++++++++++++++++++++++++++-----------------------
1 file changed, 29 insertions(+), 23 deletions(-)
diff --git a/html/login.php b/html/login.php
index face7be..7131420 100644
--- a/html/login.php
+++ b/html/login.php
@@ -48,30 +48,33 @@ if ( isset ($_POST["p_user"] ) )
* Check repository version
*/
- if ($version != DBVERSIONREPO)
- {
- echo alert(_('Version de base de données incorrectes, vous
devez mettre à jour'));
- echo "<META HTTP-EQUIV=\"REFRESH\"
content=\"0;url=admin-noalyss.php\">";
- exit();
- }
+ if ($version != DBVERSIONREPO)
+ {
+ echo html_page_start();
+ echo h1(_("Version base de donneés incorrecte"));
+ echo span(_('Un instant svp'));
+ echo alert(_('Version de base de données incorrectes, vous devez
mettre à jour'));
+ echo "<META HTTP-EQUIV=\"REFRESH\"
content=\"3;url=admin-noalyss.php??action=upgrade&sb=database\">";
+ exit();
+ }
require_once NOALYSS_INCLUDE."/class/user.class.php";
$User=new User($rep);
$User->Check(false,'LOGIN');
if ($g_captcha == true)
- {
- include("securimage/securimage.php");
- $img = new Securimage();
- $valid = $img->check($_POST['captcha_code']);
- if ( $valid == false )
- {
- echo alert(_('Code invalide'));
- echo "<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=index.php\">";
- exit();
- }
+ {
+ include("securimage/securimage.php");
+ $img = new Securimage();
+ $valid = $img->check($_POST['captcha_code']);
+ if ( $valid == false )
+ {
+ echo alert(_('Code invalide'));
+ echo "<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=index.php\">";
+ exit();
+ }
}
- // force the nocache
- $backurl='user_login.php?v='.microtime(true);
- if ( isset ($_POST['backurl'])) {
+ // force the nocache
+ $backurl='user_login.php?v='.microtime(true);
+ if ( isset ($_POST['backurl'])) {
$backurl=urldecode($_POST['backurl']);
}
echo "<META HTTP-EQUIV=\"REFRESH\" content=\"0;url={$backurl}\">";
@@ -86,10 +89,13 @@ else
*/
if ( $version != DBVERSIONREPO)
- {
- echo alert(_('Version de base de données incorrectes, vous devez mettre
à jour'));
- echo "<META HTTP-EQUIV=\"REFRESH\"
content=\"1;url=admin-noalyss.php\">";
- exit();
+ {
+ echo html_page_start();
+ echo h1(_("Version base de donneés incorrecte"));
+ echo span(_('Un instant svp'));
+ echo alert(_('Version de base de données incorrectes, vous devez
mettre à jour'));
+ echo "<META HTTP-EQUIV=\"REFRESH\"
content=\"3;url=admin-noalyss.php?action=upgrade&sb=database\">";
+ exit();
}