pass mask=PEAR_LOG_DEBUG to getLogger()

This commit is contained in:
Uwe Steinmann 2022-11-08 20:07:59 +01:00
parent 17673db914
commit f36735ef81

View File

@ -3,8 +3,9 @@ include("../inc/inc.Settings.php");
require_once("../inc/inc.Language.php");
require_once("../inc/inc.Utils.php");
require_once("Log.php");
$logger = getLogger('restapi-');
$logger = getLogger('restapi-', PEAR_LOG_DEBUG);
require_once("../inc/inc.Init.php");
require_once("../inc/inc.Extension.php");
@ -259,7 +260,7 @@ class RestapiController { /* {{{ */
if(!$userobj) {
setcookie("mydms_session", '', time()-3600, $settings->_httpRoot);
$logger->log("Login with user name '".$username."' failed", PEAR_LOG_INFO);
$logger->log("Login with user name '".$username."' failed", PEAR_LOG_ERR);
return $response->withJson(array('success'=>false, 'message'=>'Login failed', 'data'=>''), 403);
} else {
require_once("../inc/inc.ClassSession.php");
@ -2667,12 +2668,11 @@ class Auth { /* {{{ */
$session = new SeedDMS_Session($dms->getDb());
if (isset($_COOKIE["mydms_session"])) {
$dms_session = $_COOKIE["mydms_session"];
$logger->log("Session key: ".$dms_session, PEAR_LOG_DEBUG);
if(!$resArr = $session->load($dms_session)) {
/* Delete Cookie */
setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot);
if($settings->_enableGuestLogin)
$userobj = $dms->getUser($settings->_guestID);
else
$logger->log("Session for id '".$dms_session."' has gone", PEAR_LOG_ERR);
return $response->withStatus(403);
}