]> git.p6c8.net - jirafeau_mojo42.git/commitdiff
add sha-256 password cipher support
authorJuLien42 <julienlacroix42@gmail.com>
Wed, 10 Aug 2016 09:20:48 +0000 (11:20 +0200)
committerJerome Jutteau <j.jutteau@gmail.com>
Fri, 26 Aug 2016 21:13:53 +0000 (23:13 +0200)
admin.php
install.php

index 62fd5eee86eacbc8b3c9a7eb9adc30b6a5e00387..bfbd123be74372fc578da4852db2e96f0a601e5c 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -70,7 +70,8 @@ else
   /* Check classic admin password authentification. */
   if (isset ($_POST['admin_password']) && empty($cfg['admin_http_auth_user']))
   {
-      if ($cfg['admin_password'] === $_POST['admin_password'])
+      if ($cfg['admin_password'] === $_POST['admin_password'] ||
+         $cfg['admin_password'] === hash('sha256', $_POST['admin_password']))
           $_SESSION['admin_auth'] = true;
       else
       {
index c537bdd5d6661b4fa01e17f59594ed20b02556b9..958aa1eef5809d4a80680cfb6d2b421bedb30420 100644 (file)
@@ -166,7 +166,7 @@ if (isset ($_POST['step']) && isset ($_POST['next']))
         break;
 
     case 2:
-        $cfg['admin_password'] = $_POST['admin_password'];
+        $cfg['admin_password'] = hash('sha256', $_POST['admin_password']);
         jirafeau_export_cfg ($cfg);
         break;
 

patrick-canterino.de