noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 202/323: Improve : New DEFINE NOALYSS_URL


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 202/323: Improve : New DEFINE NOALYSS_URL
Date: Wed, 14 Mar 2018 17:38:50 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 98a48dad322e9e158cf89e472a0b57a771dad3da
Author: Dany De Bontridder <address@hidden>
Date:   Mon Feb 12 20:16:38 2018 +0100

    Improve : New DEFINE NOALYSS_URL
---
 html/do.php          | 12 ++++++++----
 html/user_login.php  | 38 ++++++++++++++++++++------------------
 include/constant.php | 14 +++++++++++++-
 3 files changed, 41 insertions(+), 23 deletions(-)

diff --git a/html/do.php b/html/do.php
index 6714502..2635141 100644
--- a/html/do.php
+++ b/html/do.php
@@ -190,15 +190,19 @@ if ($cn->exist_table('version') == false)
 }
 if (DBVERSION < dossier::get_version($cn))
 {
-    echo '<h2 class="error" style="font-size:12px">' . _("Attention: la 
version de base de donnée est supérieure à la version du programme, vous 
devriez mettre à jour") . '</h2>';
+    $a = _("cliquez ici pour mettre à jour ");
+    $base =NOALYSS_URL."/admin-noalyss.php?action=upgrade&sb=application";
+
+    echo '<h2 class="error" style="font-size:12px">' .
+            _("Attention: la version de base de donnée est supérieure à la 
version du programme, vous devriez mettre à jour") ,
+        '<a hreF="' . $base . '">' . $a . '</a></h2>',
+            '</h2>';
 }
 if (DBVERSION > dossier::get_version($cn))
 {
     echo '<h2 class="error" style="font-size:12px">' . _("Votre base de 
données n'est pas à jour") . '   ';
     $a = _("cliquez ici pour appliquer le patch");
-    $base = dirname($_SERVER['REQUEST_URI']);
-    if ($base == '/') { $base = ''; }
-    $base .= '/admin-noalyss.php';
+    $base =NOALYSS_URL.'/admin-noalyss.php?action=upgrade&sb=database';
     echo '<a hreF="' . $base . '">' . $a . '</a></h2>';
 }
 
diff --git a/html/user_login.php b/html/user_login.php
index 8eec383..81e6b41 100644
--- a/html/user_login.php
+++ b/html/user_login.php
@@ -68,7 +68,7 @@ $hi=new HttpInput();
 if ( $ac->exist_table('version') == false)
 {
     echo '<h2 class="error" style="font-size:12px">'._("Base de donnée 
invalide").'</h2>';
-    $base=dirname($_SERVER['REQUEST_URI']);
+    echo '<a hreF="'.NOALYSS_URL.'/user_login.php">'._("Retour").'</a></h2>';
     exit();
 }
 
@@ -78,27 +78,30 @@ if ( $version < DBVERSIONREPO )
 {
     echo '<h2 class="error" style="font-size:12px">'._("Votre base de données 
n'est pas à jour").'   ';
     $a=_("cliquez ici pour appliquer le patch");
-    $base = dirname($_SERVER['REQUEST_URI']);
-    if ($base == '/') { $base = ''; }
-    $base .= '/admin-noalyss.php';
+    $base =NOALYSS_URL.'/admin-noalyss.php';
     echo '<a hreF="'.$base.'">'.$a.'</a></h2>';
 
 }
 if ( $User->Admin()  == 1)
 {
-       if (SITE_UPDATE !="") {
-        address@hidden(SITE_UPDATE);
+    if (SITE_UPDATE !="") {
+     address@hidden(SITE_UPDATE);
         if ($update > $version_noalyss ) {
-                echo '<div id="version_div" class="inner_box" 
style="width:25%;margin-left:10%;margin-top:3px;">';
-                echo '<p class="notice">';
-                printf ( "Mise à jour disponible de NOALYSS version actuelle : 
%s  votre version %s ",$update,$version_noalyss);
-                echo '</p>';
-                 echo '<p style="text-align:center"> <a class="button" 
onclick="document.body.removeChild(document.getElementById(\'version_div\'))">'.
-                         _('Fermer').
-                         "</a></p>";
-                echo '</div>';
-        }
-       }
+            echo '<div id="version_div" class="inner_box" 
style="width:25%;margin-left:10%;margin-top:3px;">';
+            echo '<p class="notice">';
+            printf ( "Mise à jour disponible de NOALYSS version actuelle : %s  
votre version %s ",$update,$version_noalyss);
+
+            // Link to admin_repo : upgrade application
+            $base 
=NOALYSS_URL."/admin-noalyss.php?action=upgrade&sb=application";
+
+           echo '<a hreF="' . $base . '">' . _("Cliquez ici pour mettre à 
jour") . '</a>';
+           echo '</p>';
+           echo '<p style="text-align:center"> <a class="button" 
onclick="document.body.removeChild(document.getElementById(\'version_div\'))">'.
+                   _('Fermer').
+                   "</a></p>";
+           echo '</div>';
+        }
+    }
 }
 
 include_once NOALYSS_INCLUDE."/lib/user_menu.php";
@@ -144,12 +147,11 @@ if ( $User->admin == 0 || (defined("MULTI")&& MULTI == 0 
) )
     if ( $folder != null  && count($folder) == 1 )
     {
 
-            redirect('do.php?gDossier='.$folder[0]['dos_id']);
+            redirect(NOALYSS_URL.'/do.php?gDossier='.$folder[0]['dos_id']);
             exit();
     }
 
 }
-
 $result="";
 $result.="<table border=\"0\">";
 $result.='<TR>';
diff --git a/include/constant.php b/include/constant.php
index 31b8801..afa6e05 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -103,7 +103,9 @@ if ( !defined("SITE_UPDATE"))
     define ("SITE_UPDATE",'http://www.noalyss.eu/last_version.txt');
 if ( !defined("SITE_UPDATE_PLUGIN"))
     define 
("SITE_UPDATE_PLUGIN",'http://www.noalyss.eu/plugin_last_version.txt');
-
+if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
+    define ("NOALYSS_PACKAGE_REPOSITORY","https://package.noalyss.eu/";);
+}
 // If you don't want that the system information  is accessible
 if ( ! defined ("SYSINFO_DISPLAY")) {
     define ("SYSINFO_DISPLAY",TRUE);
@@ -311,3 +313,13 @@ define ('EXC_PARAM_TYPE',1006);
 define ('EXC_DUPLICATE',1200);
 define ("UNPINDG","&#xf047;");
 define ("PINDG","&#xe809;");
+
+// Url of NOALYSS (http://...) 
+// 
+if ( ! defined ("NOALYSS_URL")) {
+    $base=$_SERVER['REQUEST_SCHEME'].'://'.
+            $_SERVER['HTTP_HOST'].
+            ":".$_SERVER['SERVER_PORT'].
+            dirname($_SERVER['PHP_SELF']);
+    define ("NOALYSS_URL",$base);
+}
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]