getUserInfo() returns null if userCache doesn't exist, Updated defines.php

This commit is contained in:
michu2k
2020-06-06 22:59:12 +02:00
parent b0908ec118
commit 8c9198dcff
2 changed files with 47 additions and 47 deletions

View File

@@ -28,7 +28,7 @@ abstract class Main
* @var array
*/
public $lang = [];
/**
* Templates instance
*
@@ -95,13 +95,13 @@ abstract class Main
$this->settings = new Settings($this);
date_default_timezone_set($this->settings->get('settings.timezone'));
$this->tpl = new Templates($this);
$this->router = new Router;
$this->append(base64_decode('PG1ldGEgbmFtZT0iZ2VuZXJhdG9yIiBjb250ZW50PSJCYXRmbGF0IiAvPg=='), 'header');
}
/**
* New instance of QueryBuilder
*
@@ -309,7 +309,7 @@ abstract class Main
}
setcookie('batflat_remember', null, -1, '/');
}
return false;
}
@@ -329,7 +329,7 @@ abstract class Main
self::$userCache = $this->db('users')->where('id', $id)->oneArray();
}
return self::$userCache[$field];
return self::$userCache ? self::$userCache[$field] : null;
}
/**
@@ -374,7 +374,7 @@ abstract class Main
$core->db('modules')->save(['dir' => $name, 'sequence' => $order]);
}
redirect(url());
}
}

View File

@@ -1,51 +1,51 @@
<?php
/**
* This file is part of Batflat ~ the lightweight, fast and easy CMS
*
* @author Paweł Klockiewicz <klockiewicz@sruu.pl>
* @author Wojciech Król <krol@sruu.pl>
* @copyright 2017 Paweł Klockiewicz, Wojciech Król <Sruu.pl>
* @license https://batflat.org/license
* @link https://batflat.org
*/
/**
* This file is part of Batflat ~ the lightweight, fast and easy CMS
*
* @author Paweł Klockiewicz <klockiewicz@sruu.pl>
* @author Wojciech Król <krol@sruu.pl>
* @copyright 2017 Paweł Klockiewicz, Wojciech Król <Sruu.pl>
* @license https://batflat.org/license
* @link https://batflat.org
*/
if (!version_compare(PHP_VERSION, '5.5.0', '>=')) {
exit("Batflat requires at least <b>PHP 5.5</b>");
}
if (!version_compare(PHP_VERSION, '5.5.0', '>=')) {
exit("Batflat requires at least <b>PHP 5.5</b>");
}
// Admin cat name
define('ADMIN', 'admin');
// Admin cat name
define('ADMIN', 'admin');
// Themes path
define('THEMES', BASE_DIR . '/themes');
// Themes path
define('THEMES', BASE_DIR . '/themes');
// Modules path
define('MODULES', BASE_DIR . '/inc/modules');
// Modules path
define('MODULES', BASE_DIR . '/inc/modules');
// Uploads path
define('UPLOADS', BASE_DIR . '/uploads');
// Uploads path
define('UPLOADS', BASE_DIR . '/uploads');
// Lock files
define('FILE_LOCK', false);
// Lock files
define('FILE_LOCK', false);
// Basic modules
define('BASIC_MODULES', serialize([
8 => 'settings',
0 => 'dashboard',
2 => 'pages',
3 => 'navigation',
7 => 'users',
1 => 'blog',
4 => 'galleries',
5 => 'snippets',
6 => 'modules',
9 => 'contact',
10 => 'langswitcher',
11 => 'devbar',
]));
// Basic modules
define('BASIC_MODULES', serialize([
8 => 'settings',
0 => 'dashboard',
2 => 'pages',
3 => 'navigation',
7 => 'users',
1 => 'blog',
4 => 'galleries',
5 => 'snippets',
6 => 'modules',
9 => 'contact',
10 => 'langswitcher',
11 => 'devbar',
]));
// HTML beautifier
define('HTML_BEAUTY', false);
// HTML beautifier
define('HTML_BEAUTY', false);
// Developer mode
define('DEV_MODE', false);
// Developer mode
define('DEV_MODE', false);