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() {
|
function __construct() {
|
||||||
|
|
||||||
global $default_timezone;
|
// we'll reset this after we read our config file
|
||||||
$this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
date_default_timezone_set($this->timezone);
|
|
||||||
|
|
||||||
$this->config = array('system'=>array());
|
$this->config = array('system'=>array());
|
||||||
$this->page = array();
|
$this->page = array();
|
||||||
|
@ -6,7 +6,7 @@ require_once('boot.php');
|
|||||||
|
|
||||||
function cli_startup() {
|
function cli_startup() {
|
||||||
|
|
||||||
global $a, $db;
|
global $a, $db, $default_timezone;
|
||||||
|
|
||||||
if(is_null($a)) {
|
if(is_null($a)) {
|
||||||
$a = new App;
|
$a = new App;
|
||||||
@ -14,6 +14,10 @@ function cli_startup() {
|
|||||||
|
|
||||||
if(is_null($db)) {
|
if(is_null($db)) {
|
||||||
@include(".htconfig.php");
|
@include(".htconfig.php");
|
||||||
|
|
||||||
|
$a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
||||||
|
date_default_timezone_set($a->timezone);
|
||||||
|
|
||||||
require_once('include/dba/dba_driver.php');
|
require_once('include/dba/dba_driver.php');
|
||||||
$db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data);
|
$db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data);
|
||||||
unset($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);
|
call_hooks('get_role_perms',$ret);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -27,6 +27,10 @@ $a->install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? fal
|
|||||||
|
|
||||||
@include(".htconfig.php");
|
@include(".htconfig.php");
|
||||||
|
|
||||||
|
$a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
||||||
|
date_default_timezone_set($a->timezone);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Try to open the database;
|
* Try to open the database;
|
||||||
|
Reference in New Issue
Block a user