allow custom role permissions and fix site timezone.
This commit is contained in:
parent
5292e3a100
commit
f8468b4c3a
6
boot.php
6
boot.php
@ -716,10 +716,8 @@ class App {
|
||||
|
||||
function __construct() {
|
||||
|
||||
global $default_timezone;
|
||||
$this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
||||
|
||||
date_default_timezone_set($this->timezone);
|
||||
// we'll reset this after we read our config file
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
$this->config = array('system'=>array());
|
||||
$this->page = array();
|
||||
|
@ -6,7 +6,7 @@ require_once('boot.php');
|
||||
|
||||
function cli_startup() {
|
||||
|
||||
global $a, $db;
|
||||
global $a, $db, $default_timezone;
|
||||
|
||||
if(is_null($a)) {
|
||||
$a = new App;
|
||||
@ -14,6 +14,10 @@ function cli_startup() {
|
||||
|
||||
if(is_null($db)) {
|
||||
@include(".htconfig.php");
|
||||
|
||||
$a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
||||
date_default_timezone_set($a->timezone);
|
||||
|
||||
require_once('include/dba/dba_driver.php');
|
||||
$db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_port, $db_user, $db_pass, $db_data);
|
||||
|
@ -722,6 +722,11 @@ function get_role_perms($role) {
|
||||
|
||||
}
|
||||
|
||||
$x = get_config('system','role_perms');
|
||||
// let system settings over-ride any or all
|
||||
if($x && is_array($x) && array_key_exists($role,$x))
|
||||
$ret = array_merge($ret,$x[$role]);
|
||||
|
||||
call_hooks('get_role_perms',$ret);
|
||||
|
||||
return $ret;
|
||||
|
Reference in New Issue
Block a user