1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

PHP 7.4 and more verbose logging for external authorizations

This commit is contained in:
Jon Ziebell 2022-12-24 11:32:13 -05:00
parent e7bdd175b2
commit 8eac5140bb
2 changed files with 6 additions and 2 deletions

View File

@ -232,7 +232,11 @@ final class session {
* @return int The current user_id. * @return int The current user_id.
*/ */
public function get_user_id() { public function get_user_id() {
return $this->session['user_id']; if ($this->session !== null) {
return $this->session['user_id'];
}
return null;
} }
/** /**

View File

@ -47,7 +47,7 @@ class external_api extends cora\api {
*/ */
protected function curl($arguments) { protected function curl($arguments) {
$user = $this->api('user', 'get', $this->session->get_user_id()); $user = $this->api('user', 'get', $this->session->get_user_id());
if ($user['debug'] === true) { if ($user === null || $user['debug'] === true) {
$this::$log_mysql = 'all'; $this::$log_mysql = 'all';
$this::$log_mysql_verbose = true; $this::$log_mysql_verbose = true;
} }