diff options
author | friendica <info@friendica.com> | 2014-09-29 23:36:41 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-09-29 23:36:41 -0700 |
commit | f8468b4c3aeeb51f485c6bb7107f5b64a9643c85 (patch) | |
tree | 9665491010508ed70be7fc9e1b8fca0b7e5227f5 | |
parent | 5292e3a100dd8da20865167e59f859a528676df7 (diff) | |
download | volse-hubzilla-f8468b4c3aeeb51f485c6bb7107f5b64a9643c85.tar.gz volse-hubzilla-f8468b4c3aeeb51f485c6bb7107f5b64a9643c85.tar.bz2 volse-hubzilla-f8468b4c3aeeb51f485c6bb7107f5b64a9643c85.zip |
allow custom role permissions and fix site timezone.
-rwxr-xr-x | boot.php | 6 | ||||
-rw-r--r-- | include/cli_startup.php | 6 | ||||
-rw-r--r-- | include/permissions.php | 5 | ||||
-rwxr-xr-x | index.php | 4 |
4 files changed, 16 insertions, 5 deletions
@@ -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(); diff --git a/include/cli_startup.php b/include/cli_startup.php index 6bd4e7520..f90a75cd1 100644 --- a/include/cli_startup.php +++ b/include/cli_startup.php @@ -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); diff --git a/include/permissions.php b/include/permissions.php index 438b807d0..61ac8aea3 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -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; @@ -27,6 +27,10 @@ $a->install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? fal @include(".htconfig.php"); +$a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC'); +date_default_timezone_set($a->timezone); + + /** * * Try to open the database; |