noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 29/46: Task #0001793: Installation mot de pas


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 29/46: Task #0001793: Installation mot de passe for password , use NOALYSS_ADMIN_PASSWORD
Date: Mon, 4 May 2020 13:38:51 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 4dcae09efe8a718c3fedf7e66b827aeee4d33a7a
Author: Dany De Bontridder <address@hidden>
AuthorDate: Tue Mar 24 14:21:48 2020 +0100

    Task #0001793: Installation mot de passe
    for password , use NOALYSS_ADMIN_PASSWORD
---
 html/install.php            | 16 ++++++++++------
 include/lib/config_file.php |  4 ++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/html/install.php b/html/install.php
index a83e7e1..ca76438 100644
--- a/html/install.php
+++ b/html/install.php
@@ -272,6 +272,7 @@ if (isset($_POST['save_config'])) {
 //
 //------------------------------------------------------------------------
 if ( ! file_exists(NOALYSS_INCLUDE.'/config.inc.php')) {
+
   echo '<h1 class="info">'._('Entrez les informations nécessaires à 
noalyss').'</h1>';
   echo '<form method="post">';
   require_once NOALYSS_INCLUDE.'/lib/config_file.php';
@@ -524,7 +525,7 @@ if ($account == 0 ) {
   
$cn->execute_script(NOALYSS_INCLUDE."/sql/account_repository/constraint.sql");
   /* update name administrator */
   $cadmin=NOALYSS_ADMINISTRATOR;
-  $cn->exec_sql("update ac_users set 
use_login=$1,use_password=md5($2),use_active=1 where use_id=1",
+  $cn->exec_sql("update ac_users set 
use_login=$1,use_pass=md5($2),use_active=1 where use_id=1",
               array(strtolower($cadmin),$icpassword_admin));
 
   $cn->commit($cn);
@@ -619,11 +620,11 @@ if  (defined("MULTI") && MULTI == 0)
             }
         }
         
-        $db->exec_sql("update ac_users set use_login=$1 where use_id=1",
-              array(strtolower(NOALYSS_ADMINISTRATOR)));
+        $db->exec_sql("update ac_users set use_login=$1,use_pass=2 where 
use_id=1",
+              array(strtolower(NOALYSS_ADMINISTRATOR),NOALYSS_ADMIN_PASSWORD));
         echo '<h1>'._('Important').'</h1>';
         echo '<p>'._('Utilisateur administrateur'),' 
',NOALYSS_ADMINISTRATOR,'</p>';
-        echo '<p>',_('Mot de passe par défaut à l\'installation'),' 
phpcompta','</p>';
+        
         echo "<h2 class=\"warning\">";
         printf (" VOUS DEVEZ EFFACER CE FICHIER %s",__FILE__);
         echo "</h2>";
@@ -642,9 +643,12 @@ define ('ALLOWED',1);
 define ('ALLOWED_ADMIN',1);
 
 $rep=new Database();
-if (defined(NOALYSS_ADMINISTRATOR))
+if (defined(NOALYSS_ADMINISTRATOR) && defined (NOALYSS_ADMIN_PASSWORD))
 {
-    $rep->exec_sql("update ac_users set use_login=$1 where use_id=1", 
array(strtolower(NOALYSS_ADMINISTRATOR)));
+    $rep->exec_sql("update ac_users set use_login=$1 ,use_pass=md5(2) 
+             where use_id=1", 
+            array(strtolower(NOALYSS_ADMINISTRATOR),
+                NOALYSS_ADMIN_PASSWORD));
 }
  Dossier::upgrade();
 echo '<h1>'._('Important').'</h1>';
diff --git a/include/lib/config_file.php b/include/lib/config_file.php
index f9c89ee..3f9f722 100644
--- a/include/lib/config_file.php
+++ b/include/lib/config_file.php
@@ -161,9 +161,9 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
     print ("\r\n");
     print ("// For changing the password of admin, go to preference or update 
in db");
     print ("\r\n");
-    print ("// this password is only used when installing ");
+    print ("// this password is only used when executing install.php ");
     print ("\r\n");
-    print ( 'define ("NOALYSS_PASSWORD","'.$icpassword_admin.'");');
+    print ( 'define ("NOALYSS_ADMIN_PASSWORD","'.$icpassword_admin.'");');
     print ("\r\n");
     
     print ( 'define ("LOCALE",'.$clocale.');');



reply via email to

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