mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
pass mask=PEAR_LOG_DEBUG to getLogger()
This commit is contained in:
parent
17673db914
commit
f36735ef81
|
@ -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");
|
||||
|
@ -2653,7 +2654,7 @@ class Auth { /* {{{ */
|
|||
} elseif(!in_array($request->getUri()->getPath(), array('login')) && substr($request->getUri()->getPath(), 0, 5) != 'echo/') {
|
||||
$userobj = null;
|
||||
if(!empty($this->container->environment['HTTP_AUTHORIZATION']) && !empty($settings->_apiKey) && !empty($settings->_apiUserId)) {
|
||||
$logger->log("Authorization key: ".$this->container->environment['HTTP_AUTHORIZATION'], PEAR_LOG_DEBUG);
|
||||
$logger->log("Authorization key: ".$this->container->environment['HTTP_AUTHORIZATION'], PEAR_LOG_DEBUG);
|
||||
if($settings->_apiKey == $this->container->environment['HTTP_AUTHORIZATION']) {
|
||||
if(!($userobj = $dms->getUser($settings->_apiUserId))) {
|
||||
return $response->withStatus(403);
|
||||
|
@ -2667,13 +2668,12 @@ 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
|
||||
return $response->withStatus(403);
|
||||
$logger->log("Session for id '".$dms_session."' has gone", PEAR_LOG_ERR);
|
||||
return $response->withStatus(403);
|
||||
}
|
||||
|
||||
/* Load user data */
|
||||
|
|
Loading…
Reference in New Issue
Block a user