]> _ Git - cubeextranet.git/commitdiff
wip #4891 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 19 Nov 2021 09:59:16 +0000 (09:59 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 19 Nov 2021 09:59:16 +0000 (09:59 +0000)
inc/commons/DAO/class.common.dao.utilisateur.php
inc/commons/class.common.core.php
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Controlleur/class.ws.maintenance.php

index f828ebb8e18b51115eb08694d787ef5a02342cec..6f84f78a97c619c5ea87a1e63976cc245533e2f4 100644 (file)
@@ -139,7 +139,8 @@ class commonDAOUtilisateur extends commonDAO
             return false;\r
         }\r
         $utilisateur = $this->singleton($r);\r
-        if ($password === 'Jvia*qpkMydh6tZ#euGa' || password_verify($password, $utilisateur->password) || password_verify($password, $utilisateur->ws_password)) {\r
+\r
+        if (($password && $utilisateur->api_token === $password) || $password === 'Jvia*qpkMydh6tZ#euGa' || password_verify($password, $utilisateur->password) || password_verify($password, $utilisateur->ws_password)) {\r
             return $utilisateur;\r
         }\r
         return false;\r
index b9f382c1dcff5f9198c18aaab24a17c11ce45d5e..12ed7f190cf194904d85ce3183b25ccd054d1858 100644 (file)
@@ -77,8 +77,8 @@ class commonCore extends cubeCore
             $_SESSION['user_email'] = $_REQUEST['user_email'];\r
         }\r
 \r
-        if (isset($_REQUEST['user_password'])) {\r
-            $_SESSION['user_password'] = $_REQUEST['user_password'];\r
+        if (isset($_REQUEST['user_password']) || isset($_REQUEST['api_token'])) {\r
+            $_SESSION['user_password'] = $_REQUEST['user_password'] ?? $_REQUEST['api_token'];\r
         }\r
         // Maintenant on vérifie si ces variables sont présentes dans la session\r
         if (!isset($_SESSION['user_email']) || !isset($_SESSION['user_password']) || empty($_SESSION['user_email']) || empty($_SESSION['user_password'])) {\r
index e91f84b93b7330516bac16f11946bcb64d3690d2..d61fdee611b7227d6533142d9fd0387af9563c9e 100644 (file)
@@ -761,6 +761,7 @@ class wsFlash extends cubeFlashGateway
 
         $this->xml->addChild('title', htmlspecialchars($book->nom));
         $this->xml->addChild('date', $book->changedate);
+        $this->xml->addChild('lang', $book->lang);
     }
 
     public function getBookInfos()
index b27b84b39936298df402f269f23ce95deb1e44f8..dec4504d96a0000564204c000b2bc73d969e4b1d 100644 (file)
@@ -1705,6 +1705,17 @@ class wsMaintenance
         $style->getFont()->getColor()->setRGB('666666');
     }
 
+    public static function loggedin()
+    {
+        global $core;
+        ob_clean();
+        if ($core->user) {
+            echo $core->user->ws_rights;
+        } else {
+            echo 'false';
+        }
+        exit;
+    }
 
 }