noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 320/323: Bug : Cannot upgrade core


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 320/323: Bug : Cannot upgrade core
Date: Wed, 14 Mar 2018 17:39:15 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 0a54848ec8934d412c8e5a63f5bac3df9cf22492
Author: Dany De Bontridder <address@hidden>
Date:   Mon Mar 12 22:26:30 2018 +0100

    Bug : Cannot upgrade core
---
 include/class/package_core.class.php | 13 +++++++++++--
 include/upgrade-core.php             |  4 ++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/include/class/package_core.class.php 
b/include/class/package_core.class.php
index 44b8787..db2a86b 100644
--- a/include/class/package_core.class.php
+++ b/include/class/package_core.class.php
@@ -33,7 +33,12 @@ class Package_Core extends Package_Noalyss
      */
     public function can_install()
     {
-        
+        if (! is_writable(NOALYSS_HOME)) {
+            return 0;
+        }
+        if ( !is_writable(NOALYSS_INCLUDE)) {
+            return 0;
+        }
     }
 
     /**
@@ -44,6 +49,10 @@ class Package_Core extends Package_Noalyss
      */
     public function install()
     {
+        if ( $this->can_install() == 0 )
+        {
+            throw new Exception(sprintf(_("Permission incorrecte : ne peut 
écrire dans %s ou %s"),NOALYSS_HOME,NOALYSS_INCLUDE),3);
+        }
         $zip=new ZipArchive ();
         // open the file
         if ($zip->open(NOALYSS_HOME."/tmp/".$this->get_file()))
@@ -51,7 +60,7 @@ class Package_Core extends Package_Noalyss
             // try to unzip and overwrite current 
             if (!$zip->extractTo(NOALYSS_HOME."/../"))
             {
-                throw new Exception(_("Echec mis à jour"), 1);
+                throw new Exception(_("Echec mise à jour"), 1);
             }
         }
         else
diff --git a/include/upgrade-core.php b/include/upgrade-core.php
index 529bf86..69744b4 100644
--- a/include/upgrade-core.php
+++ b/include/upgrade-core.php
@@ -22,13 +22,13 @@
 if (!defined('ALLOWED'))     die('Appel direct ne sont pas permis');
 if ( ! defined ('ALLOWED_ADMIN')) { die (_('Non autorisé'));}
 
-
+global $version_noalyss;
 require_once NOALYSS_INCLUDE.'/class/package_repository.class.php';
 /**
  * @file
  * @brief 
  */
-printf (_(" La version de votre installaiton est %s "),NOALYSS_VERSION);
+printf (_(" La version de votre installation est %s "),$version_noalyss);
 
 $core=new Package_Repository();
 $xml=$core->getContent();



reply via email to

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