From 1e68d4fb75b9831ed763328b7982e44d1d4cdc5b Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 13 Jun 2016 19:58:24 -0700 Subject: deprecate the item_id table - replace with iconfig. A possibly useful function in the iconfig class would be a search which takes a service id and type and uid, matches against an item and returns the iid. That could save a bit of code duplication. --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 384376ec5..0ce4ab93e 100755 --- a/boot.php +++ b/boot.php @@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.9' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1176 ); +define ( 'DB_UPDATE_VERSION', 1177 ); /** -- cgit v1.2.3 From dbb0a0283f8398d02d2be92dab182ee5103b3651 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 18 Jun 2016 15:33:47 -0700 Subject: schema changes needed for the caldav client bit --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 0ce4ab93e..764e81292 100755 --- a/boot.php +++ b/boot.php @@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.9' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1177 ); +define ( 'DB_UPDATE_VERSION', 1178 ); /** -- cgit v1.2.3 From 905374c86ef78dd6a2c1f7e37b6d290428e6259e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 19 Jun 2016 21:10:57 -0700 Subject: experimental rtl support; this will probably require a fair bit of work. --- boot.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 764e81292..6cf92d577 100755 --- a/boot.php +++ b/boot.php @@ -771,6 +771,7 @@ class App { public static $groups; public static $language; public static $langsave; + public static $rtl = false; public static $plugins_admin; public static $module_loaded = false; public static $query_string; @@ -2282,6 +2283,12 @@ function construct_page(&$a) { $page = App::$page; $profile = App::$profile; + // There's some experimental support for right-to-left text in the view/php/default.php page template. + // In v1.9 we started providing direction preference in the per language hstrings.php file + // This requires somebody with fluency in a RTL language to make happen + + $page['direction'] = 0; // ((App::$rtl) ? 1 : 0); + header("Content-type: text/html; charset=utf-8"); // security headers - see https://securityheaders.io -- cgit v1.2.3 From 953ac6f3c7a341da2ed78335568b01828e45df46 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 20 Jun 2016 22:03:39 +0200 Subject: last merge from master did reset the std_version to 1.8 - set it back to 1.9 for dev --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index dbfc16dd8..d0d69b358 100755 --- a/boot.php +++ b/boot.php @@ -45,7 +45,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.8' ); +define ( 'STD_VERSION', '1.9' ); define ( 'ZOT_REVISION', '1.1' ); define ( 'DB_UPDATE_VERSION', 1178 ); -- cgit v1.2.3 From e5c66d94f22d0efcdec0796872e9be81bff1bb4e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 23 Jun 2016 05:18:58 -0700 Subject: relocate the cache class --- boot.php | 1 - 1 file changed, 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index d0d69b358..0ece5c39c 100755 --- a/boot.php +++ b/boot.php @@ -34,7 +34,6 @@ require_once('include/text.php'); require_once('include/datetime.php'); require_once('include/language.php'); require_once('include/nav.php'); -require_once('include/cache.php'); require_once('include/permissions.php'); require_once('library/Mobile_Detect/Mobile_Detect.php'); require_once('include/features.php'); -- cgit v1.2.3 From 51e2ef39c221a6f8cd89f8bb9e85a8f374f1fd6c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 23 Jun 2016 18:35:01 -0700 Subject: db update for abconfig transition --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 0ece5c39c..215f25ad2 100755 --- a/boot.php +++ b/boot.php @@ -47,7 +47,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.9' ); define ( 'ZOT_REVISION', '1.1' ); -define ( 'DB_UPDATE_VERSION', 1178 ); +define ( 'DB_UPDATE_VERSION', 1179 ); /** -- cgit v1.2.3 From e6c8de5e4c78a48e4e0fe3e3baebc38d624dce64 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 30 Jun 2016 21:43:00 -0700 Subject: if cron is broken because the entire db or config table is crashed, don't send a cron broken email - because we have no way of limiting it to just one email. We need a working config to do that. --- boot.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 215f25ad2..bad3b2e5d 100755 --- a/boot.php +++ b/boot.php @@ -2457,6 +2457,15 @@ function check_cron_broken() { set_config('system','lastcroncheck',datetime_convert()); return; } + $t = get_config('system','lastcroncheck'); + if($t === false) { + // This is serious. Config storage isn't working. + // We just set lastcroncheck. The system is horked. + // However don't add insult to injury by sending an email + // to the admin every time a page is accessed. + // just quietly + return; + } if($t > datetime_convert('UTC','UTC','now - 3 days')) { // Wait for 3 days before we do anything so as not to swamp the admin with messages -- cgit v1.2.3 From 917a465ccd7dfa4992241b1e5d4418b3a31f1615 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 9 Jul 2016 19:03:29 -0700 Subject: more work on perms --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index bad3b2e5d..6abc4137e 100755 --- a/boot.php +++ b/boot.php @@ -47,7 +47,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.9' ); define ( 'ZOT_REVISION', '1.1' ); -define ( 'DB_UPDATE_VERSION', 1179 ); +define ( 'DB_UPDATE_VERSION', 1180 ); /** -- cgit v1.2.3 From 94bd53c0f1faa333991786684028e347ab17cfb9 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 14 Jul 2016 20:51:15 -0700 Subject: schema updates for zot access tokens --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index bad3b2e5d..6abc4137e 100755 --- a/boot.php +++ b/boot.php @@ -47,7 +47,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.9' ); define ( 'ZOT_REVISION', '1.1' ); -define ( 'DB_UPDATE_VERSION', 1179 ); +define ( 'DB_UPDATE_VERSION', 1180 ); /** -- cgit v1.2.3 From 9048f8cffea94b653e97bed421e2be10c9c6a7d3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jul 2016 14:53:15 +0200 Subject: bump minor version because of jquery update --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 6abc4137e..ee3351cab 100755 --- a/boot.php +++ b/boot.php @@ -44,7 +44,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.9' ); +define ( 'STD_VERSION', '1.9.1' ); define ( 'ZOT_REVISION', '1.1' ); define ( 'DB_UPDATE_VERSION', 1180 ); -- cgit v1.2.3 From acb78205c8d2f1ada41e61783a7b421200e2658b Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 15 Jul 2016 15:30:52 -0700 Subject: login isn't always your email. --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 6abc4137e..f0d82e28d 100755 --- a/boot.php +++ b/boot.php @@ -1703,7 +1703,7 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) { '$logout' => t('Logout'), '$login' => t('Login'), '$form_id' => $form_id, - '$lname' => array('username', t('Email') , '', ''), + '$lname' => array('username', t('Login/Email') , '', ''), '$lpassword' => array('password', t('Password'), '', ''), '$remember_me' => array('remember_me', t('Remember me'), '', '',array(t('No'),t('Yes'))), '$hiddens' => $hiddens, -- cgit v1.2.3 From fc78ba7c2fce72a0ace3a853b782b7fd20c0ff40 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 17 Jul 2016 16:38:21 -0700 Subject: change std_version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index fd9f1752a..b4a54e180 100755 --- a/boot.php +++ b/boot.php @@ -44,7 +44,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.9.1' ); +define ( 'STD_VERSION', '1.10RC' ); define ( 'ZOT_REVISION', '1.1' ); define ( 'DB_UPDATE_VERSION', 1180 ); -- cgit v1.2.3 From 571b8cc85b3a770f16aed021bb39b889e0275ed6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 17 Jul 2016 19:57:19 -0700 Subject: roll version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index fd9f1752a..a967636d2 100755 --- a/boot.php +++ b/boot.php @@ -44,7 +44,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.9.1' ); +define ( 'STD_VERSION', '1.11' ); define ( 'ZOT_REVISION', '1.1' ); define ( 'DB_UPDATE_VERSION', 1180 ); -- cgit v1.2.3 From 3beb94dc522453a0cfbf2705ed335b20aad5bc76 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 18 Jul 2016 13:52:26 +0200 Subject: whitespace --- boot.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index b5740cde5..a967636d2 100755 --- a/boot.php +++ b/boot.php @@ -44,9 +44,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); - define ( 'STD_VERSION', '1.11' ); - define ( 'ZOT_REVISION', '1.1' ); define ( 'DB_UPDATE_VERSION', 1180 ); -- cgit v1.2.3 From 269b3cef726a72460d77d3f533911a05fa78676a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 18 Jul 2016 22:33:26 -0700 Subject: runaway cron emails --- boot.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index a967636d2..08da2a9d6 100755 --- a/boot.php +++ b/boot.php @@ -2457,24 +2457,16 @@ function check_cron_broken() { set_config('system','lastcroncheck',datetime_convert()); return; } - $t = get_config('system','lastcroncheck'); - if($t === false) { - // This is serious. Config storage isn't working. - // We just set lastcroncheck. The system is horked. - // However don't add insult to injury by sending an email - // to the admin every time a page is accessed. - // just quietly - return; - } if($t > datetime_convert('UTC','UTC','now - 3 days')) { // Wait for 3 days before we do anything so as not to swamp the admin with messages return; } + set_config('system','lastcroncheck',datetime_convert()); + if(($d) && ($d > datetime_convert('UTC','UTC','now - 3 days'))) { // Scheduled tasks have run successfully in the last 3 days. - set_config('system','lastcroncheck',datetime_convert()); return; } -- cgit v1.2.3 From a961d5e6c8cd79b375e13a0b3d887e521392f8aa Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 19 Jul 2016 20:49:54 -0700 Subject: permission fixes --- boot.php | 1 + 1 file changed, 1 insertion(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 14284e2f1..de483035e 100755 --- a/boot.php +++ b/boot.php @@ -2449,6 +2449,7 @@ function check_cron_broken() { if((! $d) || ($d < datetime_convert('UTC','UTC','now - 4 hours'))) { Zotlabs\Daemon\Master::Summon(array('Cron')); + set_config('system','lastcron',datetime_convert()); } $t = get_config('system','lastcroncheck'); -- cgit v1.2.3 From 063b4286e7feae472d52e9717ba1bafede48d1b4 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 24 Jul 2016 22:36:37 -0700 Subject: trace log pconfig cache if for some reason it isn't an array --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index de483035e..0ff598b45 100755 --- a/boot.php +++ b/boot.php @@ -765,6 +765,7 @@ class App { public static $pdl = null; // Comanche page description private static $perms = null; // observer permissions private static $widgets = array(); // widgets for this page + public static $config = array(); // config cache public static $session = null; public static $groups; @@ -774,7 +775,6 @@ class App { public static $plugins_admin; public static $module_loaded = false; public static $query_string; - public static $config; // config cache public static $page; public static $profile; public static $user; -- cgit v1.2.3 From 70dae328b5174543363163f8ca1c88c3c0af3cd8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 25 Jul 2016 21:59:52 -0700 Subject: check for new permissions and update channels and connections with defaults if any are found and if there are defaults for any channel roles which are being used on this site. --- boot.php | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 0ff598b45..a6cc23c9f 100755 --- a/boot.php +++ b/boot.php @@ -1551,6 +1551,9 @@ function check_config(&$a) { load_hooks(); + + check_for_new_perms(); + check_cron_broken(); } @@ -2440,6 +2443,67 @@ function cert_bad_email() { } +function check_for_new_perms() { + + $pregistered = get_config('system','perms'); + $pcurrent = array_keys(\Zotlabs\Access\Permissions::Perms()); + + if(! $pregistered) { + set_config('system','perms',$pcurrent); + return; + } + + $found_new_perm = false; + + foreach($pcurrent as $p) { + if(! in_array($p,$pregistered)) { + $found_new_perm = true; + // for all channels + $c = q("select channel_id from channel where true"); + if($c) { + foreach($c as $cc) { + // get the permission role + $r = q("select v from pconfig where uid = %d and cat = 'system' and k = 'permissions_role'", + intval($cc['uid']) + ); + if($r) { + // get a list of connections + $x = q("select abook_xchan from abook where abook_channel = %d and abook_self = 0", + intval($cc['uid']) + ); + // get the permissions role details + $rp = \Zotlabs\Access\PermissionRoles::role_perms($r[0]['v']); + if($rp) { + // set the channel limits if appropriate or 0 + if(array_key_exists('limits',$rp) && array_key_exists($p,$rp['limits'])) { + \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,$rp['limits'][$p]); + } + else { + \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,0); + } + + $set = ((array_key_exists('perms_connect',$rp) && array_key_exists($p,$rp['perms_connect'])) ? true : false); + // foreach connection set to the perms_connect value + if($x) { + foreach($x as $xx) { + set_abconfig($cc['uid'],$xx['abook_xchan'],'my_perms',$p,intval($set)); + } + } + } + } + } + } + } + } + + // We should probably call perms_refresh here, but this should get pushed in 24 hours and there is no urgency + if($found_new_perm) + set_config('system','perms',$pcurrent); + +} + + + /** * @brief Send warnings every 3-5 days if cron is not running. */ -- cgit v1.2.3 From bc74425872704ad955b37de18639ec831a245761 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 28 Jul 2016 16:02:51 -0700 Subject: Revert "Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge" This reverts commit 35f17acb388f68745068d6a60e12c7b777b92282, reversing changes made to 58cf5f310d89026fb526e201c301075725044e48. --- boot.php | 71 +++------------------------------------------------------------- 1 file changed, 3 insertions(+), 68 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index a6cc23c9f..7974ce9ed 100755 --- a/boot.php +++ b/boot.php @@ -44,10 +44,10 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.11' ); +define ( 'STD_VERSION', '1.10RC' ); define ( 'ZOT_REVISION', '1.1' ); -define ( 'DB_UPDATE_VERSION', 1181 ); +define ( 'DB_UPDATE_VERSION', 1180 ); /** @@ -765,7 +765,6 @@ class App { public static $pdl = null; // Comanche page description private static $perms = null; // observer permissions private static $widgets = array(); // widgets for this page - public static $config = array(); // config cache public static $session = null; public static $groups; @@ -775,6 +774,7 @@ class App { public static $plugins_admin; public static $module_loaded = false; public static $query_string; + public static $config; // config cache public static $page; public static $profile; public static $user; @@ -1551,9 +1551,6 @@ function check_config(&$a) { load_hooks(); - - check_for_new_perms(); - check_cron_broken(); } @@ -2443,67 +2440,6 @@ function cert_bad_email() { } -function check_for_new_perms() { - - $pregistered = get_config('system','perms'); - $pcurrent = array_keys(\Zotlabs\Access\Permissions::Perms()); - - if(! $pregistered) { - set_config('system','perms',$pcurrent); - return; - } - - $found_new_perm = false; - - foreach($pcurrent as $p) { - if(! in_array($p,$pregistered)) { - $found_new_perm = true; - // for all channels - $c = q("select channel_id from channel where true"); - if($c) { - foreach($c as $cc) { - // get the permission role - $r = q("select v from pconfig where uid = %d and cat = 'system' and k = 'permissions_role'", - intval($cc['uid']) - ); - if($r) { - // get a list of connections - $x = q("select abook_xchan from abook where abook_channel = %d and abook_self = 0", - intval($cc['uid']) - ); - // get the permissions role details - $rp = \Zotlabs\Access\PermissionRoles::role_perms($r[0]['v']); - if($rp) { - // set the channel limits if appropriate or 0 - if(array_key_exists('limits',$rp) && array_key_exists($p,$rp['limits'])) { - \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,$rp['limits'][$p]); - } - else { - \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,0); - } - - $set = ((array_key_exists('perms_connect',$rp) && array_key_exists($p,$rp['perms_connect'])) ? true : false); - // foreach connection set to the perms_connect value - if($x) { - foreach($x as $xx) { - set_abconfig($cc['uid'],$xx['abook_xchan'],'my_perms',$p,intval($set)); - } - } - } - } - } - } - } - } - - // We should probably call perms_refresh here, but this should get pushed in 24 hours and there is no urgency - if($found_new_perm) - set_config('system','perms',$pcurrent); - -} - - - /** * @brief Send warnings every 3-5 days if cron is not running. */ @@ -2513,7 +2449,6 @@ function check_cron_broken() { if((! $d) || ($d < datetime_convert('UTC','UTC','now - 4 hours'))) { Zotlabs\Daemon\Master::Summon(array('Cron')); - set_config('system','lastcron',datetime_convert()); } $t = get_config('system','lastcroncheck'); -- cgit v1.2.3