diff --git a/Zotlabs/Lib/IConfig.php b/Zotlabs/Lib/IConfig.php index 9ddd6df6c..4710b4e3e 100644 --- a/Zotlabs/Lib/IConfig.php +++ b/Zotlabs/Lib/IConfig.php @@ -123,11 +123,11 @@ class IConfig { return $value; } - if(intval($item)) + if(intval($item)) { $iid = intval($item); - - if(! $iid) + } else { return false; + } if(self::Get($item, $family, $key) === false) { $r = q("insert into iconfig( iid, cat, k, v, sharing ) values ( %d, '%s', '%s', '%s', %d ) ", @@ -174,11 +174,11 @@ class IConfig { return true; } - if(intval($item)) + if(intval($item)) { $iid = intval($item); - - if(! $iid) + } else { return false; + } return q("delete from iconfig where iid = %d and cat = '%s' and k = '%s' ", intval($iid), diff --git a/Zotlabs/Lib/JcsEddsa2022.php b/Zotlabs/Lib/JcsEddsa2022.php index 0a164ab7b..4a9885553 100644 --- a/Zotlabs/Lib/JcsEddsa2022.php +++ b/Zotlabs/Lib/JcsEddsa2022.php @@ -62,14 +62,16 @@ class JcsEddsa2022 { try { $result = sodium_crypto_sign_verify_detached($base58->decode($encodedSignature), $optionsHash . $dataHash, (new Multibase())->decode($publicKey, true)); + + logger('SignatureVerify (eddsa-jcs-2022) ' . (($result) ? 'true' : 'false')); + + return $result; } catch (\Exception $e) { logger('verify exception:' . $e->getMessage()); } - logger('SignatureVerify (eddsa-jcs-2022) ' . (($result) ? 'true' : 'false')); - - return $result; + return false; } public function signableData($data) { diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index cf9278f5e..216bc7c37 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -437,9 +437,7 @@ class Acl extends \Zotlabs\Web\Controller { if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) { $url = z_root() . '/dirsearch'; - } - - if(! $url) { + } else { $directory = Libzotdir::find_upstream_directory($dirmode); $url = $directory['url'] . '/dirsearch'; } diff --git a/Zotlabs/Module/Activity.php b/Zotlabs/Module/Activity.php index 64da2586b..a86b4aa7b 100644 --- a/Zotlabs/Module/Activity.php +++ b/Zotlabs/Module/Activity.php @@ -210,7 +210,7 @@ class Activity extends Controller { // Give ocap tokens priority if ($ob_authorize) { - $sql_extra = " and item.uid = " . intval($token['uid']) . " "; + $sql_extra = " and item.uid = " . intval($item_uid) . " "; } else { $sql_extra = item_permissions_sql(0); diff --git a/Zotlabs/Module/Admin/Account_edit.php b/Zotlabs/Module/Admin/Account_edit.php index 35a15133f..cdfe7d761 100644 --- a/Zotlabs/Module/Admin/Account_edit.php +++ b/Zotlabs/Module/Admin/Account_edit.php @@ -55,11 +55,10 @@ class Account_edit { function get() { - if(argc() > 2) - $account_id = argv(2); + $account_id = intval(argv(2)); $x = q("select * from account where account_id = %d limit 1", - intval($account_id) + $account_id ); if(! $x) { diff --git a/Zotlabs/Module/Admin/Accounts.php b/Zotlabs/Module/Admin/Accounts.php index 179c8a60a..3c5fbc5ac 100644 --- a/Zotlabs/Module/Admin/Accounts.php +++ b/Zotlabs/Module/Admin/Accounts.php @@ -203,7 +203,6 @@ class Accounts { $t = get_markup_template('admin_accounts.tpl'); $o = replace_macros($t, array( // strings // - '$debug' => $debug, '$title' => t('Administration'), '$page' => t('Accounts'), '$submit' => t('Submit'), @@ -263,7 +262,7 @@ class Accounts { if ($zarop && $zarat >= 0 && $zarse && $zarse == $_SESSION[self::MYP]['h'][$zarat]) { - // + $rc = 0; if ($zarop == 'd') { $rd = q("UPDATE register SET reg_vital = 0 WHERE reg_id = %d AND SUBSTR(reg_hash,1,4) = '%s' ", intval($_SESSION[self::MYP]['i'][$zarat]), @@ -279,7 +278,6 @@ class Accounts { intval($_SESSION[self::MYP]['i'][$zarat]), dbesc($_SESSION[self::MYP]['h'][$zarat]) ); - $rc = 0; $rs = q("SELECT * from register WHERE reg_id = %d ", intval($_SESSION[self::MYP]['i'][$zarat]) ); diff --git a/Zotlabs/Module/Apporder.php b/Zotlabs/Module/Apporder.php index 579ca738c..6b1a2bc0a 100644 --- a/Zotlabs/Module/Apporder.php +++ b/Zotlabs/Module/Apporder.php @@ -32,6 +32,9 @@ class Apporder extends \Zotlabs\Web\Controller { $syslist = Zlib\Apps::app_order(local_channel(),$syslist, $l); + $navbar_apps = []; + $nav_apps = []; + foreach($syslist as $app) { if($l === 'nav_pinned_app') { $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order-pinned'); diff --git a/Zotlabs/Module/Block.php b/Zotlabs/Module/Block.php index d0fed44fe..49f64b712 100644 --- a/Zotlabs/Module/Block.php +++ b/Zotlabs/Module/Block.php @@ -7,63 +7,63 @@ require_once('include/conversation.php'); class Block extends \Zotlabs\Web\Controller { function init() { - + $which = argv(1); $profile = 0; profile_load($which,$profile); - + if(\App::$profile['profile_uid']) head_set_icon(\App::$profile['thumb']); - + } - - + + function get() { - + if(! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'view_pages')) { notice( t('Permission denied.') . EOL); return; } - + if(argc() < 3) { notice( t('Invalid item.') . EOL); return; } - + $channel_address = argv(1); $page_id = argv(2); - + $u = q("select channel_id from channel where channel_address = '%s' limit 1", dbesc($channel_address) ); - + if(! $u) { notice( t('Channel not found.') . EOL); return; } - + if($_REQUEST['rev']) $revision = " and revision = " . intval($_REQUEST['rev']) . " "; else $revision = " order by revision desc "; - + require_once('include/security.php'); $sql_options = item_permissions_sql($u[0]['channel_id']); - + $r = q("select item.* from item left join iconfig on item.id = iconfig.iid - where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and iconfig.k = 'BUILDBLOCK' and + where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and iconfig.k = 'BUILDBLOCK' and item_type = %d $sql_options $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), intval(ITEM_TYPE_BLOCK) ); - + if(! $r) { - + // Check again with no permissions clause to see if it is a permissions issue - + $x = q("select item.* from item left join iconfig on item.id = iconfig.iid - where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and iconfig.k = 'BUILDBLOCK' and + where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and iconfig.k = 'BUILDBLOCK' and item_type = %d $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), @@ -78,13 +78,12 @@ class Block extends \Zotlabs\Web\Controller { } return; } - + xchan_query($r); $r = fetch_post_tags($r,true); - - $o .= prepare_page($r[0]); - return $o; - + + return prepare_page($r[0]); + } - + } diff --git a/Zotlabs/Module/Cal.php b/Zotlabs/Module/Cal.php index 70d8aa755..69fce9287 100644 --- a/Zotlabs/Module/Cal.php +++ b/Zotlabs/Module/Cal.php @@ -136,15 +136,13 @@ class Cal extends Controller { } $html = ''; + $tz = get_iconfig($rr, 'event', 'timezone', 'UTC'); + if (x($_GET,'id')) { $rr['timezone'] = $tz; $html = format_event_html($rr); } - $tz = get_iconfig($rr, 'event', 'timezone'); - if(! $tz) - $tz = 'UTC'; - $events[] = array( 'calendar_id' => 'channel_calendar', 'rw' => true, diff --git a/view/tpl/admin_accounts.tpl b/view/tpl/admin_accounts.tpl index b346152f5..58116dd1b 100644 --- a/view/tpl/admin_accounts.tpl +++ b/view/tpl/admin_accounts.tpl @@ -5,7 +5,6 @@