From 2d69b419ff9a0b2186d9479447f75f37b9102fa6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 21 Feb 2018 20:59:30 -0800 Subject: move Zotlabs\Zot\Verify to Zotlabs\Lib\Verify as part of the z6 re-org --- Zotlabs/Lib/Verify.php | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Module/Magic.php | 2 +- Zotlabs/Module/Owa.php | 2 +- Zotlabs/Zot/Verify.php | 63 ------------------------------------------------ 4 files changed, 65 insertions(+), 65 deletions(-) create mode 100644 Zotlabs/Lib/Verify.php delete mode 100644 Zotlabs/Zot/Verify.php (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Verify.php b/Zotlabs/Lib/Verify.php new file mode 100644 index 000000000..8703e29e6 --- /dev/null +++ b/Zotlabs/Lib/Verify.php @@ -0,0 +1,63 @@ + Date: Wed, 21 Feb 2018 21:18:54 -0800 Subject: move dreport from zot to lib --- Zotlabs/Lib/DReport.php | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Zot/DReport.php | 55 ------------------------------------------------- 2 files changed, 55 insertions(+), 55 deletions(-) create mode 100644 Zotlabs/Lib/DReport.php delete mode 100644 Zotlabs/Zot/DReport.php (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php new file mode 100644 index 000000000..a68d6c18f --- /dev/null +++ b/Zotlabs/Lib/DReport.php @@ -0,0 +1,55 @@ +location = $location; + $this->sender = $sender; + $this->recipient = $recipient; + $this->message_id = $message_id; + $this->status = $status; + $this->date = datetime_convert(); + } + + function update($status) { + $this->status = $status; + $this->date = datetime_convert(); + } + + function addto_recipient($name) { + $this->recipient = $this->recipient . ' ' . $name; + } + + function addto_update($status) { + $this->status = $this->status . ' ' . $status; + } + + + function set($arr) { + $this->location = $arr['location']; + $this->sender = $arr['sender']; + $this->recipient = $arr['recipient']; + $this->message_id = $arr['message_id']; + $this->status = $arr['status']; + $this->date = $arr['date']; + } + + function get() { + return array( + 'location' => $this->location, + 'sender' => $this->sender, + 'recipient' => $this->recipient, + 'message_id' => $this->message_id, + 'status' => $this->status, + 'date' => $this->date + ); + } +} diff --git a/Zotlabs/Zot/DReport.php b/Zotlabs/Zot/DReport.php deleted file mode 100644 index c90f4f670..000000000 --- a/Zotlabs/Zot/DReport.php +++ /dev/null @@ -1,55 +0,0 @@ -location = $location; - $this->sender = $sender; - $this->recipient = $recipient; - $this->message_id = $message_id; - $this->status = $status; - $this->date = datetime_convert(); - } - - function update($status) { - $this->status = $status; - $this->date = datetime_convert(); - } - - function addto_recipient($name) { - $this->recipient = $this->recipient . ' ' . $name; - } - - function addto_update($status) { - $this->status = $this->status . ' ' . $status; - } - - - function set($arr) { - $this->location = $arr['location']; - $this->sender = $arr['sender']; - $this->recipient = $arr['recipient']; - $this->message_id = $arr['message_id']; - $this->status = $arr['status']; - $this->date = $arr['date']; - } - - function get() { - return array( - 'location' => $this->location, - 'sender' => $this->sender, - 'recipient' => $this->recipient, - 'message_id' => $this->message_id, - 'status' => $this->status, - 'date' => $this->date - ); - } -} -- cgit v1.2.3 From bb2ec5d8dc93ba81a3c156d647639eea131af5a3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 21 Feb 2018 21:29:55 -0800 Subject: remove the unused ZotDriver and ProtoDriver classes --- Zotlabs/Lib/ProtoDriver.php | 19 ------------------- Zotlabs/Lib/ZotDriver.php | 30 ------------------------------ 2 files changed, 49 deletions(-) delete mode 100644 Zotlabs/Lib/ProtoDriver.php delete mode 100644 Zotlabs/Lib/ZotDriver.php (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/ProtoDriver.php b/Zotlabs/Lib/ProtoDriver.php deleted file mode 100644 index daf887dbb..000000000 --- a/Zotlabs/Lib/ProtoDriver.php +++ /dev/null @@ -1,19 +0,0 @@ - Date: Thu, 22 Feb 2018 12:01:53 +0100 Subject: also sort by id to not make mysql change the queryplan if offset is > 0 after recent index changes --- Zotlabs/Module/Channel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 231146999..3d3eb2a85 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -255,7 +255,7 @@ class Channel extends \Zotlabs\Web\Controller { AND (abook.abook_blocked = 0 or abook.abook_flags is null) AND item.item_wall = 1 $sql_extra $sql_extra2 - ORDER BY created DESC $pager_sql ", + ORDER BY created DESC, id $pager_sql ", intval(\App::$profile['profile_uid']) ); } -- cgit v1.2.3 From 277da4363194bd652918b100b93fdb0a85f9f689 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 22 Feb 2018 20:52:39 -0800 Subject: provide DB compatibility for poll and voting implementations across several platforms --- Zotlabs/Update/_1204.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Zotlabs/Update/_1204.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1204.php b/Zotlabs/Update/_1204.php new file mode 100644 index 000000000..f55526415 --- /dev/null +++ b/Zotlabs/Update/_1204.php @@ -0,0 +1,34 @@ + Date: Thu, 22 Feb 2018 21:45:00 -0800 Subject: cloud 'view-as-tiles' toggle wasn't available (at all) for guests and they are the most likely to prefer that view. Fix that and make tiles the default view for guests, and list mode the default view for the channel owner. --- Zotlabs/Storage/Browser.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index c21b68971..f1c95802b 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -264,7 +264,10 @@ class Browser extends DAV\Browser\Plugin { $this->server->emit('onHTMLActionsPanel', array($parent, &$output, $path)); } - + $deftiles = (($is_owner) ? 0 : 1); + $tiles = ((array_key_exists('cloud_tiles',$_SESSION)) ? intval($_SESSION['cloud_tiles']) : $deftiles); + $_SESSION['cloud_tiles'] = $tiles; + $html .= replace_macros(get_markup_template('cloud.tpl'), array( '$header' => t('Files') . ": " . $this->escapeHTML($path) . "/", '$total' => t('Total'), -- cgit v1.2.3 From 8f95b8a824351d9bfd0542ed90c19d8c4e26239c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 22 Feb 2018 21:54:28 -0800 Subject: handle error logging in on cloud page (post method not implemented), politely ask viewer to refresh the page rather than alert 'unknown error'. --- Zotlabs/Module/Cloud.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cloud.php b/Zotlabs/Module/Cloud.php index 2215507ca..8b5476efc 100644 --- a/Zotlabs/Module/Cloud.php +++ b/Zotlabs/Module/Cloud.php @@ -110,6 +110,9 @@ class Cloud extends \Zotlabs\Web\Controller { elseif($err instanceof \Sabre\DAV\Exception\Forbidden) { notice( t('Permission denied') . EOL); } + elseif($err instanceof \Sabre\DAV\Exception\NotImplemented) { + notice( t('Please refresh page') . EOL); + } else { notice( t('Unknown error') . EOL); } -- cgit v1.2.3 From 1c750dac4187c3872e29c79f0c0856ec8a29331e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 23 Feb 2018 12:58:03 +0100 Subject: fix issues with DB update 1204 --- Zotlabs/Update/_1204.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1204.php b/Zotlabs/Update/_1204.php index f55526415..93c2e4e3f 100644 --- a/Zotlabs/Update/_1204.php +++ b/Zotlabs/Update/_1204.php @@ -7,7 +7,7 @@ class _1204 { function run() { if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { - $r1 = q("ALTER TABLE poll ADD pull_guid text NOT NULL"); + $r1 = q("ALTER TABLE poll ADD poll_guid text NOT NULL"); $r2 = q("create index \"poll_guid_idx\" on poll \"poll_guid\""); $r3 = q("ALTER TABLE poll_elm ADD pelm_guid text NOT NULL"); $r4 = q("create index \"pelm_guid_idx\" on poll_elm \"pelm_guid\""); @@ -17,9 +17,9 @@ class _1204 { $r = ($r1 && $r2 && $r3 && $r4 && $r5 && $r6); } else { - $r1 = q("ALTER TABLE `poll` ADD `pull_guid` VARCHAR(191) NOT NULL, ADD INDEX `poll_guid` (`pull_guid`) "); + $r1 = q("ALTER TABLE `poll` ADD `poll_guid` VARCHAR(191) NOT NULL, ADD INDEX `poll_guid` (`poll_guid`) "); $r2 = q("ALTER TABLE `poll_elm` ADD `pelm_guid` VARCHAR(191) NOT NULL, ADD INDEX `pelm_guid` (`pelm_guid`) "); - $r1 = q("ALTER TABLE `vote` ADD `vote_guid` VARCHAR(191) NOT NULL, ADD INDEX `vote_guid` (`vote_guid`) "); + $r3 = q("ALTER TABLE `vote` ADD `vote_guid` VARCHAR(191) NOT NULL, ADD INDEX `vote_guid` (`vote_guid`) "); $r = ($r1 && $r2 && $r3); } -- cgit v1.2.3 From 048a636315671b7e9aaf9152273d101994e37c43 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 23 Feb 2018 12:44:07 -0800 Subject: Usability and member experience: remove street address info from the default basic profile fields, mention that the site banner can be full HTML, mention on the techlevel setting that this also controls what additional features may be visible. --- Zotlabs/Module/Admin/Site.php | 2 +- Zotlabs/Module/Go.php | 1 + Zotlabs/Module/Settings/Account.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index ca181d5f8..b7c558ce7 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -299,7 +299,7 @@ class Site { '$techlock' => [ 'techlock', t('Lock the technical skill level setting'), get_config('system','techlevel_lock'), t('Members can set their own technical comfort level by default') ], - '$banner' => array('banner', t("Banner/Logo"), $banner, ""), + '$banner' => array('banner', t("Banner/Logo"), $banner, t('Unfiltered HTML/CSS/JS is allowed')), '$admininfo' => array('admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. BBCode can be used here")), '$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), diff --git a/Zotlabs/Module/Go.php b/Zotlabs/Module/Go.php index 2c2dcf460..d23e940c3 100644 --- a/Zotlabs/Module/Go.php +++ b/Zotlabs/Module/Go.php @@ -33,6 +33,7 @@ class Go extends \Zotlabs\Web\Controller { $options = [ 'profile_photo' => t('Upload a profile photo'), + 'cover_photo' => t('Upload a cover photo'), 'profiles' => t('Edit your default profile'), 'suggest' => t('View friend suggestions'), 'directory' => t('View the directory to find other interesting channels'), diff --git a/Zotlabs/Module/Settings/Account.php b/Zotlabs/Module/Settings/Account.php index 18890e89f..9643c5958 100644 --- a/Zotlabs/Module/Settings/Account.php +++ b/Zotlabs/Module/Settings/Account.php @@ -113,7 +113,7 @@ class Account { '$origpass' => array('origpass', t('Current Password'), ' ',''), '$password1'=> array('npassword', t('Enter New Password'), '', ''), '$password2'=> array('confirm', t('Confirm New Password'), '', t('Leave password fields blank unless changing')), - '$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience matched to your comfort level'), $techlevels ], + '$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience and additional features consistent with your comfort level'), $techlevels ], '$techlock' => $techlock, '$submit' => t('Submit'), '$email' => array('email', t('Email Address:'), $email, ''), -- cgit v1.2.3 From 2d91aed183a08a78bc2cc0f3554f3d4c277ae798 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 23 Feb 2018 19:23:17 -0800 Subject: use embed photos javascript widget to select existing photos for profile and cover photos --- Zotlabs/Module/Cover_photo.php | 9 +++++++-- Zotlabs/Module/Embedphotos.php | 2 +- Zotlabs/Module/Import.php | 2 +- Zotlabs/Module/Profile_photo.php | 9 ++++++--- 4 files changed, 15 insertions(+), 7 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index cfb513365..7dd53ab19 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -357,12 +357,17 @@ class Cover_photo extends \Zotlabs\Web\Controller { '$user' => \App::$channel['channel_address'], '$lbl_upfile' => t('Upload File:'), '$lbl_profiles' => t('Select a profile:'), - '$title' => t('Upload Cover Photo'), + '$title' => t('Change Cover Photo'), '$submit' => t('Upload'), '$profiles' => $profiles, + '$embedPhotos' => t('Use a photo from your albums'), + '$embedPhotosModalTitle' => t('Use a photo from your albums'), + '$embedPhotosModalCancel' => t('Cancel'), + '$embedPhotosModalOK' => t('OK'), '$form_security_token' => get_form_security_token("cover_photo"), /// @FIXME - yuk - '$select' => sprintf('%s %s', t('or'), ($newuser) ? '' . t('skip this step') . '' : '' . t('select a photo from your photo albums') . '') + '$select' => t('or select an existing photo'), + )); call_hooks('cover_photo_content_end', $o); diff --git a/Zotlabs/Module/Embedphotos.php b/Zotlabs/Module/Embedphotos.php index 15cc68d7f..bcbb0e116 100644 --- a/Zotlabs/Module/Embedphotos.php +++ b/Zotlabs/Module/Embedphotos.php @@ -53,7 +53,7 @@ class Embedphotos extends \Zotlabs\Web\Controller { } else { json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false)); } - json_return_and_die(array('status' => true, 'photolink' => $photolink)); + json_return_and_die(array('status' => true, 'photolink' => $photolink, 'resource_id' => $resource_id)); } } diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index 2b16ff4e1..36bd72310 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -64,7 +64,7 @@ class Import extends \Zotlabs\Web\Controller { notice( t('Nothing to import.') . EOL); return; } else if(strpos($old_address, '@')) { - // if you copy the identity address from your profile page, make it work for convenience + // if you copy the identity address from your profile page, make it work for convenience - WARNING: this is a utf-8 variant and NOT an ASCII ampersand. Please do not edit. $old_address = str_replace('@', '@', $old_address); } diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index 222b92721..6f517b695 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -441,14 +441,17 @@ class Profile_photo extends \Zotlabs\Web\Controller { '$importfile' => (($importing) ? \App::$data['importfile'] : ''), '$lbl_upfile' => t('Upload File:'), '$lbl_profiles' => t('Select a profile:'), - '$title' => (($importing) ? t('Use Photo for Profile') : t('Upload Profile Photo')), + '$title' => (($importing) ? t('Use Photo for Profile') : t('Change Profile Photo')), '$submit' => (($importing) ? t('Use') : t('Upload')), '$profiles' => $profiles, '$single' => ((count($profiles) == 1) ? true : false), '$profile0' => $profiles[0], + '$embedPhotos' => t('Use a photo from your albums'), + '$embedPhotosModalTitle' => t('Use a photo from your albums'), + '$embedPhotosModalCancel' => t('Cancel'), + '$embedPhotosModalOK' => t('OK'), '$form_security_token' => get_form_security_token("profile_photo"), - // FIXME - yuk - '$select' => sprintf('%s %s', t('or'), ($newuser) ? '' . t('skip this step') . '' : '' . t('select a photo from your photo albums') . '') + '$select' => t('or select an existing photo'), )); call_hooks('profile_photo_content_end', $o); -- cgit v1.2.3 From 59dafb610d049c8b19a038871fa282231f809c93 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 23 Feb 2018 19:36:46 -0800 Subject: style the 'use existing' button a wee bit --- Zotlabs/Module/Cover_photo.php | 2 +- Zotlabs/Module/Profile_photo.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 7dd53ab19..047bcf3d4 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -366,7 +366,7 @@ class Cover_photo extends \Zotlabs\Web\Controller { '$embedPhotosModalOK' => t('OK'), '$form_security_token' => get_form_security_token("cover_photo"), /// @FIXME - yuk - '$select' => t('or select an existing photo'), + '$select' => t('Select existing photo'), )); diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index 6f517b695..c772f0ed3 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -451,7 +451,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { '$embedPhotosModalCancel' => t('Cancel'), '$embedPhotosModalOK' => t('OK'), '$form_security_token' => get_form_security_token("profile_photo"), - '$select' => t('or select an existing photo'), + '$select' => t('Select existing photo'), )); call_hooks('profile_photo_content_end', $o); -- cgit v1.2.3 From e6f9f284bf04f0dc0471fa08d7dac118effe4ccb Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 23 Feb 2018 22:12:29 -0800 Subject: open_pubstream logic was messy and wrong --- Zotlabs/Module/Pubstream.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index af7bc7658..79f205a22 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -12,10 +12,16 @@ class Pubstream extends \Zotlabs\Web\Controller { if($load) $_SESSION['loadtime'] = datetime_convert(); - if((observer_prohibited(true)) || (! (intval(get_config('system','open_pubstream',1))) && get_observer_hash())) { + if((observer_prohibited(true))) { return login(); } + if(! intval(get_config('system','open_pubstream',1))) { + if(! get_observer_hash()) { + return login(); + } + } + $site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false); $net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true); -- cgit v1.2.3 From c618bfc607498998916f01fd9c6985c2ecd47356 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 24 Feb 2018 19:42:39 +0100 Subject: mark connections where we do not have post_comments permissions with an no entry sign. --- Zotlabs/Module/Connections.php | 8 +++++++- Zotlabs/Module/Viewconnections.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php index 255731c9c..55e716ace 100644 --- a/Zotlabs/Module/Connections.php +++ b/Zotlabs/Module/Connections.php @@ -245,6 +245,11 @@ class Connections extends \Zotlabs\Web\Controller { ((intval($rr['abook_blocked'])) ? t('Blocked') : ''), ((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '') ); + + $oneway = false; + if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) { + $oneway = true; + } foreach($status as $str) { if(!$str) @@ -283,7 +288,8 @@ class Connections extends \Zotlabs\Web\Controller { 'ignore_hover' => t('Ignore connection'), 'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false), 'recent_label' => t('Recent activity'), - 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) + 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']), + 'oneway' => $oneway ); } } diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php index 1f9c03751..e024f1c5a 100644 --- a/Zotlabs/Module/Viewconnections.php +++ b/Zotlabs/Module/Viewconnections.php @@ -69,8 +69,13 @@ class Viewconnections extends \Zotlabs\Web\Controller { $contacts = array(); foreach($r as $rr) { + + $oneway = false; + if(! intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { + $oneway = true; + } - $url = chanlink_hash($rr['xchan_hash']); + $url = chanlink_hash($rr['xchan_hash']); if($url) { $contacts[] = array( 'id' => $rr['abook_id'], @@ -83,6 +88,7 @@ class Viewconnections extends \Zotlabs\Web\Controller { 'sparkle' => '', 'itemurl' => $rr['url'], 'network' => '', + 'oneway' => $oneway ); } } -- cgit v1.2.3 From 3153129e2eb968a189a8a7050d06892cbc13c651 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 24 Feb 2018 13:20:59 -0800 Subject: make the profile photo image picker work correctly with multiple profiles. --- Zotlabs/Module/Profile_photo.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index c772f0ed3..44b7c18c6 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -304,7 +304,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { } $channel = \App::get_channel(); - + $pf = 0; $newuser = false; if(argc() == 2 && argv(1) === 'new') @@ -318,8 +318,8 @@ class Profile_photo extends \Zotlabs\Web\Controller { $resource_id = argv(2); - // When using an existing photo, we don't have a dialogue to offer a choice of profiles, - // so it gets attached to the default + + $pf = (($_REQUEST['pf']) ? intval($_REQUEST['pf']) : 0); $c = q("select id, is_default from profile where uid = %d", intval(local_channel()) @@ -331,6 +331,9 @@ class Profile_photo extends \Zotlabs\Web\Controller { $_REQUEST['profile'] = $c[0]['id']; $multi_profiles = false; } + else { + $_REQUEST['profile'] = $pf; + } $r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC", intval(local_channel()), @@ -430,6 +433,16 @@ class Profile_photo extends \Zotlabs\Web\Controller { intval(local_channel()) ); + if($profiles) { + for($x = 0; $x < count($profiles); $x ++) { + $profiles[$x]['selected'] = false; + if($pf && $profiles[$x]['id'] == $pf) + $profiles[$x]['selected'] = true; + if((! $pf) && $profiles[$x]['is_default']) + $profiles[$x]['selected'] = true; + } + } + $importing = ((array_key_exists('importfile',\App::$data)) ? true : false); if(! x(\App::$data,'imagecrop')) { -- cgit v1.2.3 From fed61c082c8f9d6a7673125bd365d44d4b409fa4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 25 Feb 2018 13:00:43 +0100 Subject: do not overwrite abook flags if we are not owner --- Zotlabs/Module/Viewconnections.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php index e024f1c5a..8366e1325 100644 --- a/Zotlabs/Module/Viewconnections.php +++ b/Zotlabs/Module/Viewconnections.php @@ -44,7 +44,7 @@ class Viewconnections extends \Zotlabs\Web\Controller { $sql_extra = ''; if(! $is_owner) { - $abook_flags = " and abook_hidden = 0 "; + $abook_flags .= " and abook_hidden = 0 "; $sql_extra = " and xchan_hidden = 0 "; } -- cgit v1.2.3 From d2ed3a9abbb5c68d1a02eae629bc103aa43a1263 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 25 Feb 2018 21:40:19 -0800 Subject: provide opt-out link and text with notification emails --- Zotlabs/Lib/Enotify.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index c5bc706c2..1461a2e18 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -63,7 +63,9 @@ class Enotify { $thanks = t('Thank You,'); $sitename = get_config('system','sitename'); $site_admin = sprintf( t('%s Administrator'), $sitename); - + $opt_out1 = sprintf( t('This email was sent by %1$s at %2$s.'), t('$Projectname'), \App::get_hostname()); + $opt_out2 = sprintf( t('To stop receiving these messages, please adjust your Notification Settings at %s'), z_root() . '/settings'); + $hopt_out2 = sprintf( t('To stop receiving these messages, please adjust your %s.'), '' . t('Notification Settings') . ''); $sender_name = $product; $hostname = \App::get_hostname(); if(strpos($hostname,':')) @@ -613,6 +615,9 @@ class Enotify { $datarray['titemlink'] = $itemlink; $datarray['thanks'] = $thanks; $datarray['site_admin'] = $site_admin; + $datarray['opt_out1'] = $opt_out1; + $datarray['opt_out2'] = $opt_out2; + $datarray['hopt_out2'] = $hopt_out2; $datarray['title'] = stripslashes($title); $datarray['htmlversion'] = $htmlversion; $datarray['textversion'] = $textversion; @@ -670,6 +675,8 @@ class Enotify { '$hitemlink' => $datarray['hitemlink'], '$thanks' => $datarray['thanks'], '$site_admin' => $datarray['site_admin'], + '$opt_out1' => $datarray['opt_out1'], + '$opt_out2' => $datarray['hopt_out2'], '$title' => $datarray['title'], '$htmlversion' => $datarray['htmlversion'], )); @@ -690,6 +697,8 @@ class Enotify { '$titemlink' => $datarray['titemlink'], '$thanks' => $datarray['thanks'], '$site_admin' => $datarray['site_admin'], + '$opt_out1' => $datarray['opt_out1'], + '$opt_out2' => $datarray['opt_out2'], '$title' => $datarray['title'], '$textversion' => $datarray['textversion'], )); -- cgit v1.2.3 From 51c0e5a988ce3bae025040ab7fa77852eaa3e70d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 26 Feb 2018 09:58:42 +0100 Subject: another DB upgrade to address some long running maintenance queries --- Zotlabs/Update/_1205.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Zotlabs/Update/_1205.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1205.php b/Zotlabs/Update/_1205.php new file mode 100644 index 000000000..5384f183e --- /dev/null +++ b/Zotlabs/Update/_1205.php @@ -0,0 +1,27 @@ + Date: Mon, 26 Feb 2018 20:17:53 +0100 Subject: fix icon position and make string translatable --- Zotlabs/Widget/Notifications.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index d51cb0113..f2619c5cf 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -23,7 +23,8 @@ class Notifications { 'label' => t('Mark all notifications read') ], 'filter' => [ - 'label' => t('Show new posts only') + 'posts_label' => t('Show new posts only'), + 'name_label' => t('Filter by name') ] ]; @@ -41,7 +42,8 @@ class Notifications { 'label' => t('Mark all notifications seen') ], 'filter' => [ - 'label' => t('Show new posts only') + 'posts_label' => t('Show new posts only'), + 'name_label' => t('Filter by name') ] ]; @@ -136,7 +138,8 @@ class Notifications { 'label' => t('Mark all notifications seen') ], 'filter' => [ - 'label' => t('Show new posts only') + 'posts_label' => t('Show new posts only'), + 'name_label' => t('Filter by name') ] ]; } -- cgit v1.2.3 From 87079e8071e491dd6d0bb4a76723b53010fdf509 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 26 Feb 2018 16:39:12 -0800 Subject: require directory servers to be using some modern form of encryption; which means we only currently have 2. --- Zotlabs/Module/Admin/Site.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index b7c558ce7..880dbbe4b 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -220,9 +220,10 @@ class Site { $realm = get_directory_realm(); // directory server should not be set or settable unless we are a directory client + // avoid older redmatrix servers which don't have modern encryption if($dirmode == DIRECTORY_MODE_NORMAL) { - $x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0", + $x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0 and site_project != 'redmatrix'", intval(DIRECTORY_MODE_SECONDARY), intval(DIRECTORY_MODE_PRIMARY), dbesc($realm) -- cgit v1.2.3 From f34e6d897766ab93a0c0dede9d89f5536c4f60e9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 27 Feb 2018 19:15:12 -0800 Subject: move oauth_client management and guest access tokens to features rather than auto-enabling at various feature levels. This involves string changes and should *not* go into 3.2RC. --- Zotlabs/Widget/Settings_menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index e15ed96a5..20241a22f 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -79,7 +79,7 @@ class Settings_menu { 'selected' => '' ); - if(get_account_techlevel() > 0) { + if(feature_enabled(local_channel(),'oauth_clients')) { $tabs[] = array( 'label' => t('Connected apps'), 'url' => z_root() . '/settings/oauth', @@ -87,7 +87,7 @@ class Settings_menu { ); } - if(get_account_techlevel() > 2) { + if(feature_enabled(local_channel(),'access_tokens')) { $tabs[] = array( 'label' => t('Guest Access Tokens'), 'url' => z_root() . '/settings/tokens', -- cgit v1.2.3 From be5187718c0f1791a692b7743aca51ea5f37649e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 27 Feb 2018 19:34:51 -0800 Subject: provide usage hint on addon settings page to save each panel before opening another. [String change, not for 3.2] --- Zotlabs/Module/Settings/Featured.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 9c5a7b16c..3740eddfa 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -62,6 +62,7 @@ class Featured { $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_featured"), '$title' => t('Feature/Addon Settings'), + '$descrip' => t('Please save/submit changes to any panel before opening another.'), '$settings_addons' => $settings_addons )); return $o; -- cgit v1.2.3 From 6c60be9e8d57c26e92f704de0712def767ab8705 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 27 Feb 2018 19:51:29 -0800 Subject: rename Addon/Feature settings to addon settings [string change] --- Zotlabs/Module/Settings/Featured.php | 2 +- Zotlabs/Widget/Settings_menu.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 3740eddfa..1da139206 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -61,7 +61,7 @@ class Featured { $tpl = get_markup_template("settings_addons.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_featured"), - '$title' => t('Feature/Addon Settings'), + '$title' => t('Addon Settings'), '$descrip' => t('Please save/submit changes to any panel before opening another.'), '$settings_addons' => $settings_addons )); diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 20241a22f..455fdcb9b 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -54,7 +54,7 @@ class Settings_menu { } $tabs[] = array( - 'label' => t('Feature/Addon settings'), + 'label' => t('Addon settings'), 'url' => z_root().'/settings/featured', 'selected' => ((argv(1) === 'featured') ? 'active' : ''), ); -- cgit v1.2.3 From 924c8db71206dca0baa1e95c63719205404d5380 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 28 Feb 2018 08:38:56 +0100 Subject: missed some string for translation - update strings --- Zotlabs/Lib/Enotify.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 1461a2e18..61c98c881 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -138,7 +138,7 @@ class Enotify { $itemlink = $params['link']; - $action = 'commented on'; + $action = t('commented on'); if(array_key_exists('item',$params) && in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) { @@ -149,10 +149,10 @@ class Enotify { } if(activity_match($params['verb'], ACTIVITY_LIKE)) - $action = 'liked'; + $action = t('liked'); if(activity_match($params['verb'], ACTIVITY_DISLIKE)) - $action = 'disliked'; + $action = t('disliked'); } -- cgit v1.2.3 From 6593dff9f5b07c76037fa0afc7357089306195c4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 28 Feb 2018 10:21:22 +0100 Subject: missed one index in the last update --- Zotlabs/Update/_1206.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Zotlabs/Update/_1206.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1206.php b/Zotlabs/Update/_1206.php new file mode 100644 index 000000000..bb2000aad --- /dev/null +++ b/Zotlabs/Update/_1206.php @@ -0,0 +1,24 @@ + Date: Wed, 28 Feb 2018 10:28:06 +0100 Subject: typo --- Zotlabs/Update/_1206.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1206.php b/Zotlabs/Update/_1206.php index bb2000aad..351d53ff6 100644 --- a/Zotlabs/Update/_1206.php +++ b/Zotlabs/Update/_1206.php @@ -8,7 +8,7 @@ class _1206 { if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { $r = q("ALTER TABLE item - ADD INDEX uid_resource_type (uid, resource_type), + ADD INDEX uid_resource_type (uid, resource_type) "); if($r) -- cgit v1.2.3 From 7c28a40c3e55ea1d8f248639e578cb41ae17e49f Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Thu, 15 Feb 2018 00:01:11 +0100 Subject: :white_check_mark: Unit Test for HTTPSig. --- Zotlabs/Web/HTTPSig.php | 117 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 87 insertions(+), 30 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php index a27edb73d..9bcc2e5ec 100644 --- a/Zotlabs/Web/HTTPSig.php +++ b/Zotlabs/Web/HTTPSig.php @@ -3,16 +3,24 @@ namespace Zotlabs\Web; /** - * Implements HTTP Signatures per draft-cavage-http-signatures-07 + * @brief Implements HTTP Signatures per draft-cavage-http-signatures-07. + * + * @see https://tools.ietf.org/html/draft-cavage-http-signatures-07 */ - - class HTTPSig { - // See RFC5843 - - static function generate_digest($body,$set = true) { - $digest = base64_encode(hash('sha256',$body,true)); + /** + * @brief RFC5843 + * + * @see https://tools.ietf.org/html/rfc5843 + * + * @param string $body The value to create the digest for + * @param boolean $set (optional, default true) + * If set send a Digest HTTP header + * @return string The generated digest of $body + */ + static function generate_digest($body, $set = true) { + $digest = base64_encode(hash('sha256', $body, true)); if($set) { header('Digest: SHA-256=' . $digest); @@ -40,6 +48,7 @@ class HTTPSig { if(is_array($data) && $data['header']) { if(! $data['success']) return $result; + $h = new \Zotlabs\Web\HTTPHeaders($data['header']); $headers = $h->fetcharr(); $body = $data['body']; @@ -47,7 +56,7 @@ class HTTPSig { else { $headers = []; - $headers['(request-target)'] = + $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI']; foreach($_SERVER as $k => $v) { @@ -78,7 +87,7 @@ class HTTPSig { $result['header_signed'] = true; $signed_headers = $sig_block['headers']; - if(! $signed_headers) + if(! $signed_headers) $signed_headers = [ 'date' ]; $signed_data = ''; @@ -131,7 +140,7 @@ class HTTPSig { if($digest[0] === 'SHA-512') $hashalg = 'sha512'; - // The explode operation will have stripped the '=' padding, so compare against unpadded base64 + // The explode operation will have stripped the '=' padding, so compare against unpadded base64 if(rtrim(base64_encode(hash($hashalg,$body,true)),'=') === $digest[1]) { $result['content_valid'] = true; } @@ -146,7 +155,7 @@ class HTTPSig { if($digest[0] === 'SHA-512') $hashalg = 'sha512'; - // The explode operation will have stripped the '=' padding, so compare against unpadded base64 + // The explode operation will have stripped the '=' padding, so compare against unpadded base64 if(rtrim(base64_encode(hash($hashalg,$_POST['data'],true)),'=') === $digest[1]) { $result['content_valid'] = true; } @@ -155,9 +164,15 @@ class HTTPSig { logger('Content_Valid: ' . (($result['content_valid']) ? 'true' : 'false')); return $result; - } + /** + * @brief + * + * @param string $id + * @return boolean|string + * false if no pub key found, otherwise return the pub key + */ function get_activitypub_key($id) { if(strpos($id,'acct:') === 0) { @@ -180,19 +195,33 @@ class HTTPSig { $j = json_decode($r,true); if($j['id'] !== $id) - return false; + return false; + if(array_key_exists('publicKey',$j) && array_key_exists('publicKeyPem',$j['publicKey'])) { return($j['publicKey']['publicKeyPem']); } } + return false; } - - - - static function create_sig($request,$head,$prvkey,$keyid = 'Key',$send_headers = false,$auth = false,$alg = 'sha256', - $crypt_key = null, $crypt_algo = 'aes256ctr') { + /** + * @brief + * + * @param string $request + * @param array $head + * @param string $prvkey + * @param string $keyid (optional, default 'Key') + * @param boolean $send_headers (optional, default false) + * If set send a HTTP header + * @param boolean $auth (optional, default false) + * @param string $alg (optional, default 'sha256') + * @param string $crypt_key (optional, default null) + * @param string $crypt_algo (optional, default 'aes256ctr') + * @return array + */ + static function create_sig($request, $head, $prvkey, $keyid = 'Key', $send_headers = false, $auth = false, + $alg = 'sha256', $crypt_key = null, $crypt_algo = 'aes256ctr') { $return_headers = []; @@ -212,7 +241,7 @@ class HTTPSig { $x = crypto_encapsulate($headerval,$crypt_key,$crypt_algo); $headerval = 'iv="' . $x['iv'] . '",key="' . $x['key'] . '",alg="' . $x['alg'] . '",data="' . $x['data'] . '"'; } - + if($auth) { $sighead = 'Authorization: Signature ' . $headerval; } @@ -236,12 +265,20 @@ class HTTPSig { else { $return_headers[] = $sighead; } + return $return_headers; } - - - static function sign($request,$head,$prvkey,$alg = 'sha256') { + /** + * @brief + * + * @param string $request + * @param array $head + * @param string $prvkey + * @param string $alg (optional) default 'sha256' + * @return array + */ + static function sign($request, $head, $prvkey, $alg = 'sha256') { $ret = []; @@ -250,27 +287,38 @@ class HTTPSig { if($request) { $headers = '(request-target)' . ': ' . trim($request) . "\n"; $fields = '(request-target)'; - } + } if($head) { foreach($head as $k => $v) { $headers .= strtolower($k) . ': ' . trim($v) . "\n"; if($fields) $fields .= ' '; + $fields .= strtolower($k); } // strip the trailing linefeed $headers = rtrim($headers,"\n"); } - $sig = base64_encode(rsa_sign($headers,$prvkey,$alg)); + $sig = base64_encode(rsa_sign($headers,$prvkey,$alg)); $ret['headers'] = $fields; $ret['signature'] = $sig; - + return $ret; } + /** + * @brief + * + * @param string $header + * @return array associate array with + * - \e string \b keyID + * - \e string \b algorithm + * - \e array \b headers + * - \e string \b signature + */ static function parse_sigheader($header) { $ret = []; @@ -297,12 +345,23 @@ class HTTPSig { } - static function decrypt_sigheader($header,$prvkey = null) { + /** + * @brief + * + * @param string $header + * @param string $prvkey (optional), if not set use site private key + * @return array|string associative array, empty string if failue + * - \e string \b iv + * - \e string \b key + * - \e string \b alg + * - \e string \b data + */ + static function decrypt_sigheader($header, $prvkey = null) { $iv = $key = $alg = $data = null; if(! $prvkey) { - $prvkey = get_config('system','prvkey'); + $prvkey = get_config('system', 'prvkey'); } $matches = []; @@ -319,10 +378,8 @@ class HTTPSig { if($iv && $key && $alg && $data) { return crypto_unencapsulate([ 'iv' => $iv, 'key' => $key, 'alg' => $alg, 'data' => $data ] , $prvkey); } - return ''; + return ''; } } - - -- cgit v1.2.3 From 1c07880c0178bbda875bbe2cda5d19ae7fb5e1c4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 28 Feb 2018 18:01:51 -0800 Subject: important bugfix: if logged in locally and mod_display returns nothing owned by your uid, retry with known public uids rather than issue 'permission denied'. Affects the ability to view search results for otherwise public posts 'in context'. --- Zotlabs/Module/Display.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 11dd0d174..8e8a1ed24 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -215,6 +215,7 @@ class Display extends \Zotlabs\Web\Controller { $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start'])); if($load || ($checkjs->disabled()) || ($module_format !== 'html')) { + $r = null; require_once('include/channel.php'); @@ -235,7 +236,7 @@ class Display extends \Zotlabs\Web\Controller { } } - if($r === null) { + if(! $r) { // in case somebody turned off public access to sys channel content using permissions // make that content unsearchable by ensuring the owner uid can't match @@ -281,7 +282,7 @@ class Display extends \Zotlabs\Web\Controller { } } - if($r === null) { + if(! $r) { // in case somebody turned off public access to sys channel content using permissions // make that content unsearchable by ensuring the owner_xchan can't match if(! perm_is_allowed($sysid,$observer_hash,'view_stream')) -- cgit v1.2.3 From 14e14c6c92dadf4c95900978135a161f5da696d9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 28 Feb 2018 19:49:33 -0800 Subject: provide new member widget which sits beneath the notifications for the first 60 days after an account creation. --- Zotlabs/Module/Go.php | 2 +- Zotlabs/Widget/Newmember.php | 77 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 Zotlabs/Widget/Newmember.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Go.php b/Zotlabs/Module/Go.php index d23e940c3..d33136d9e 100644 --- a/Zotlabs/Module/Go.php +++ b/Zotlabs/Module/Go.php @@ -36,7 +36,7 @@ class Go extends \Zotlabs\Web\Controller { 'cover_photo' => t('Upload a cover photo'), 'profiles' => t('Edit your default profile'), 'suggest' => t('View friend suggestions'), - 'directory' => t('View the directory to find other interesting channels'), + 'directory' => t('View the channel directory'), 'settings' => t('View/edit your channel settings'), 'help' => t('View the site or project documentation'), 'channel/' . $channel['channel_address'] => t('Visit your channel homepage'), diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php new file mode 100644 index 000000000..a3f1126cc --- /dev/null +++ b/Zotlabs/Widget/Newmember.php @@ -0,0 +1,77 @@ + t('Upload profile photo'), + 'cover_photo' => t('Upload cover photo'), + 'profiles' => t('Edit your profile'), + ], + + t('Find and Connect with others'), + [ + 'directory' => t('View the channel directory'), + 'suggest' => t('View friend suggestions'), + 'connections' => t('Manage your connections'), + ], + + t('Communicate'), + [ + 'channel/' . $channel['channel_address'] => t('View your channel homepage'), + 'network' => t('View your network stream'), + ], + + t('Miscellaneous'), + [ + 'settings' => t('Settings'), + 'help' => t('Documentation'), + ] + ]; + + $site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false); + $net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true); + + + // hack to put this in the correct spot of the array + + if($site_firehose || $net_firehose) { + $options[5]['pubstream'] = t('View public stream. Warning: not moderated'); + } + + $o = replace_macros(get_markup_template('new_member.tpl'), [ + '$title' => t('New Member Links'), + '$options' => $options + + ]); + + return $o; + + } + +} + + + -- cgit v1.2.3 From 9672d35d8c614f174b313ef1b631dc189e5ce997 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 28 Feb 2018 20:02:08 -0800 Subject: hide newmember widget if a new account was used to create a clone of an old channel --- Zotlabs/Widget/Newmember.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php index a3f1126cc..898942ccc 100644 --- a/Zotlabs/Widget/Newmember.php +++ b/Zotlabs/Widget/Newmember.php @@ -22,6 +22,12 @@ class Newmember { if(datetime_convert('UTC','UTC',$a['account_created']) < datetime_convert('UTC','UTC', 'now - 60 days')) return EMPTY_STR; + // This could be a new account that was used to clone a very old channel + + $ob = \App::get_observer(); + if($ob && array_key_exists('xchan_name_date',$ob) && $ob['xchan_name_date'] < datetime_convert('UTC','UTC','now - 60 days')) + return EMPTY_STR; + $options = [ t('Profile Creation'), -- cgit v1.2.3 From 2b910eb5aa204e1914c8c73afe369c443bd1ff49 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 28 Feb 2018 20:31:06 -0800 Subject: Create one and only one 'registration successful, check your email' popup. --- Zotlabs/Module/Register.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index c7fa1cee8..5356669e9 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -123,9 +123,6 @@ class Register extends \Zotlabs\Web\Controller { if($policy == REGISTER_OPEN ) { if($email_verify) { $res = verify_email_address($result); - if($res) { - info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ; - } } else { $res = send_register_success_email($result['email'],$result['password']); @@ -133,7 +130,8 @@ class Register extends \Zotlabs\Web\Controller { if($res) { if($invite_code) { info( t('Registration successful. Continue to create your first channel...') . EOL ) ; - } else { + } + else { info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ; } } -- cgit v1.2.3 From 01015bc0d54343831189ce1b09a69b70a6371fd5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 28 Feb 2018 21:15:26 -0800 Subject: several email validation issues --- Zotlabs/Module/Email_validation.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Email_validation.php b/Zotlabs/Module/Email_validation.php index b8bb720cd..c1ba9a01a 100644 --- a/Zotlabs/Module/Email_validation.php +++ b/Zotlabs/Module/Email_validation.php @@ -7,12 +7,11 @@ class Email_validation extends \Zotlabs\Web\Controller { function post() { + $success = false; if($_POST['token']) { // This will redirect internally on success unless the channel is auto_created - if(! account_approve(trim(basename($_POST['token'])))) { - notice('Token verification failed.'); - } - else { + if(account_approve(trim(basename($_POST['token'])))) { + $success = true; if(get_config('system','auto_channel_create')) { $next_page = get_config('system', 'workflow_channel_next', 'profiles'); } @@ -21,7 +20,9 @@ class Email_validation extends \Zotlabs\Web\Controller { } } } - + if(! $success) { + notice( t('Token verification failed.') . EOL); + } } -- cgit v1.2.3 From 93a11ade045bb6767952f5bfdb278b3e9d463d2c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 1 Mar 2018 16:11:30 -0800 Subject: sigh - missed two strings --- Zotlabs/Widget/Newmember.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php index 898942ccc..0279f339f 100644 --- a/Zotlabs/Widget/Newmember.php +++ b/Zotlabs/Widget/Newmember.php @@ -39,7 +39,7 @@ class Newmember { t('Find and Connect with others'), [ - 'directory' => t('View the channel directory'), + 'directory' => t('View the directory'), 'suggest' => t('View friend suggestions'), 'connections' => t('Manage your connections'), ], @@ -64,7 +64,7 @@ class Newmember { // hack to put this in the correct spot of the array if($site_firehose || $net_firehose) { - $options[5]['pubstream'] = t('View public stream. Warning: not moderated'); + $options[5]['pubstream'] = t('View public stream'); } $o = replace_macros(get_markup_template('new_member.tpl'), [ -- cgit v1.2.3 From 1620691cbe076b463e0c86542be8fa5be967ddfe Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 1 Mar 2018 16:38:14 -0800 Subject: add federation property to webfinger --- Zotlabs/Module/Wfinger.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php index 753721d27..81d4beaed 100644 --- a/Zotlabs/Module/Wfinger.php +++ b/Zotlabs/Module/Wfinger.php @@ -123,7 +123,8 @@ class Wfinger extends \Zotlabs\Web\Controller { $result['properties'] = [ 'http://webfinger.net/ns/name' => $r[0]['channel_name'], 'http://xmlns.com/foaf/0.1/name' => $r[0]['channel_name'], - 'https://w3id.org/security/v1#publicKeyPem' => $r[0]['xchan_pubkey'] + 'https://w3id.org/security/v1#publicKeyPem' => $r[0]['xchan_pubkey'], + 'http://purl.org/zot/federation' => 'zot' ]; foreach($aliases as $alias) -- cgit v1.2.3 From dcfe9bc64f822af02021767bf8c70fbe9d847bda Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 2 Mar 2018 01:01:30 -0800 Subject: background work for caldav integration continued, modify mod_follow to allow it to be called from ajax without redirecting. --- Zotlabs/Module/Follow.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Follow.php b/Zotlabs/Module/Follow.php index d8a86d0ce..04ac746cb 100644 --- a/Zotlabs/Module/Follow.php +++ b/Zotlabs/Module/Follow.php @@ -17,15 +17,20 @@ class Follow extends \Zotlabs\Web\Controller { $url = notags(trim($_REQUEST['url'])); $return_url = $_SESSION['return_url']; $confirm = intval($_REQUEST['confirm']); - + $interactive = (($_REQUEST['interactive']) ? intval($_REQUEST['interactive']) : 1); $channel = \App::get_channel(); - $result = new_contact($uid,$url,$channel,true,$confirm); + $result = new_contact($uid,$url,$channel,$interactive,$confirm); if($result['success'] == false) { if($result['message']) notice($result['message']); - goaway($return_url); + if($interactive) { + goaway($return_url); + } + else { + json_return_and_die($result); + } } info( t('Channel added.') . EOL); @@ -53,7 +58,12 @@ class Follow extends \Zotlabs\Web\Controller { if(($can_view_stream) || ($result['abook']['xchan_network'] === 'rss')) \Zotlabs\Daemon\Master::Summon(array('Onepoll',$result['abook']['abook_id'])); - goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1'); + if($interactive) { + goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1'); + } + else { + json_return_and_die([ 'success' => true ]); + } } -- cgit v1.2.3 From 6ee6285670be27bbcf8565dd63af57a93673972b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 2 Mar 2018 10:10:29 +0100 Subject: db update to drop index resource_type. we have uid_resource_type now. --- Zotlabs/Update/_1207.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Zotlabs/Update/_1207.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1207.php b/Zotlabs/Update/_1207.php new file mode 100644 index 000000000..f53bc46ae --- /dev/null +++ b/Zotlabs/Update/_1207.php @@ -0,0 +1,24 @@ + Date: Fri, 2 Mar 2018 11:38:21 +0100 Subject: update DB update 1205 to mitigate ERROR 1069 (42000): Too many keys specified; max 64 keys allowed --- Zotlabs/Update/_1205.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1205.php b/Zotlabs/Update/_1205.php index 5384f183e..968833726 100644 --- a/Zotlabs/Update/_1205.php +++ b/Zotlabs/Update/_1205.php @@ -7,6 +7,17 @@ class _1205 { function run() { if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { + + q("ALTER TABLE item DROP INDEX title"); + q("ALTER TABLE item DROP INDEX body"); + q("ALTER TABLE item DROP INDEX allow_cid"); + q("ALTER TABLE item DROP INDEX allow_gid"); + q("ALTER TABLE item DROP INDEX deny_cid"); + q("ALTER TABLE item DROP INDEX deny_gid"); + q("ALTER TABLE item DROP INDEX item_flags"); + q("ALTER TABLE item DROP INDEX item_restrict"); + q("ALTER TABLE item DROP INDEX aid"); + $r = q("ALTER TABLE item DROP INDEX item_private, ADD INDEX uid_item_private (uid, item_private), -- cgit v1.2.3 From b38ce967f36e0dc5a503fbca9477732cd8967ea6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 2 Mar 2018 12:41:50 -0800 Subject: sort settings/featured --- Zotlabs/Module/Settings/Featured.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 1da139206..542a05363 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -57,7 +57,10 @@ class Featured { } call_hooks('feature_settings', $settings_addons); - + + $this->sortpanels($settings_addons); + + $tpl = get_markup_template("settings_addons.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_featured"), @@ -67,5 +70,15 @@ class Featured { )); return $o; } - -} \ No newline at end of file + + function sortpanels(&$s) { + $a = explode('
',$s); + if($a) { + usort($a,'featured_sort'); + $s = implode('
',$a); + } + } + +} + + -- cgit v1.2.3 From 4c69c5679736bb77d141a528c1e63a80d11c8026 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 2 Mar 2018 14:09:59 -0800 Subject: string change "Channel added" -> "Connection added" --- Zotlabs/Module/Follow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Follow.php b/Zotlabs/Module/Follow.php index 04ac746cb..146c4e564 100644 --- a/Zotlabs/Module/Follow.php +++ b/Zotlabs/Module/Follow.php @@ -33,7 +33,7 @@ class Follow extends \Zotlabs\Web\Controller { } } - info( t('Channel added.') . EOL); + info( t('Connection added.') . EOL); $clone = array(); foreach($result['abook'] as $k => $v) { -- cgit v1.2.3 From ca1022675c84c862e9ae3180a47360040b24e9e2 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 3 Mar 2018 15:19:39 -0800 Subject: There was no pdl for mod_thing; add one because it's only a link away from profile creation and remains on that page until you go elsewhere and new members may need help to find their way out --- Zotlabs/Module/Thing.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php index f816632ab..c3d8ff802 100644 --- a/Zotlabs/Module/Thing.php +++ b/Zotlabs/Module/Thing.php @@ -20,6 +20,11 @@ class Thing extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); + if($_SERVER['REQUEST_METHOD'] === 'GET' && argc() < 2) { + profile_load($channel['channel_address']); + } + + $term_hash = (($_REQUEST['term_hash']) ? $_REQUEST['term_hash'] : ''); $name = escape_tags($_REQUEST['term']); -- cgit v1.2.3 From 471c3c4d068d1c6d4e149098d400d792fb3550a6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 3 Mar 2018 15:52:57 -0800 Subject: add dummy f= arg to suggestion urls, use directory version of suggest for newmember link instead of the suggest module as the UI is prettier. --- Zotlabs/Module/Directory.php | 2 +- Zotlabs/Widget/Newmember.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index b1552a694..85c0be6b6 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -17,7 +17,7 @@ class Directory extends \Zotlabs\Web\Controller { intval(local_channel()), dbesc($_GET['ignore']) ); - goaway(z_root() . '/directory?suggest=1'); + goaway(z_root() . '/directory?f=&suggest=1'); } $observer = get_observer_hash(); diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php index 0279f339f..cdb70e23d 100644 --- a/Zotlabs/Widget/Newmember.php +++ b/Zotlabs/Widget/Newmember.php @@ -39,9 +39,9 @@ class Newmember { t('Find and Connect with others'), [ - 'directory' => t('View the directory'), - 'suggest' => t('View friend suggestions'), - 'connections' => t('Manage your connections'), + 'directory' => t('View the directory'), + 'directory?f=&suggest=1' => t('View friend suggestions'), + 'connections' => t('Manage your connections'), ], t('Communicate'), -- cgit v1.2.3 From be6619d9c06a31fa211c6200aad377d94c1fd0b5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 4 Mar 2018 15:29:10 -0800 Subject: bugfix: unable to reset profile fields to defaults in admin/profs by emptying the textarea --- Zotlabs/Module/Admin/Profs.php | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Profs.php b/Zotlabs/Module/Admin/Profs.php index b3da09cb7..eb2501d43 100644 --- a/Zotlabs/Module/Admin/Profs.php +++ b/Zotlabs/Module/Admin/Profs.php @@ -9,17 +9,37 @@ class Profs { if(array_key_exists('basic',$_REQUEST)) { $arr = explode(',',$_REQUEST['basic']); - for($x = 0; $x < count($arr); $x ++) - if(trim($arr[$x])) - $arr[$x] = trim($arr[$x]); - set_config('system','profile_fields_basic',$arr); - + array_walk($arr,'array_trim'); + $narr = []; + if(count($arr)) { + foreach($arr as $a) { + if(strlen($a)) { + $narr[] = $a; + } + } + } + if(! $narr) + del_config('system','profile_fields_basic'); + else + set_config('system','profile_fields_basic',$narr); + + if(array_key_exists('advanced',$_REQUEST)) { $arr = explode(',',$_REQUEST['advanced']); - for($x = 0; $x < count($arr); $x ++) - if(trim($arr[$x])) - $arr[$x] = trim($arr[$x]); - set_config('system','profile_fields_advanced',$arr); + array_walk($arr,'array_trim'); + $narr = []; + if(count($arr)) { + foreach($arr as $a) { + if(strlen($a)) { + $narr[] = $a; + } + } + } + if(! $narr) + del_config('system','profile_fields_advanced'); + else + set_config('system','profile_fields_advanced',$narr); + } goaway(z_root() . '/admin/profs'); } @@ -98,6 +118,7 @@ class Profs { $basic = ''; $barr = array(); $fields = get_profile_fields_basic(); + if(! $fields) $fields = get_profile_fields_basic(1); if($fields) { -- cgit v1.2.3 From 59a2057fa0faac2db7b36a5d6c40435c6e13d378 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 4 Mar 2018 17:36:52 -0800 Subject: fix some issues with friend suggestions on standalone sites with no 'suggestme' volunteers. This wrongly pulled up a site directory suggesting everybody on the site. While a better outcome than finding nobody, this does not fit with our ethical design goals. If there are no friends of friends, we will only suggest those who volunteer to be on the default suggestion list. Also do not attempt to load poco data from dead sites. --- Zotlabs/Module/Directory.php | 5 +++++ Zotlabs/Module/Sitelist.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index 85c0be6b6..62a1670f9 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -101,6 +101,11 @@ class Directory extends \Zotlabs\Web\Controller { if($suggest) { $r = suggestion_query(local_channel(),get_observer_hash()); + + if(! $r) { + notice( t('No default suggestions were found.') . EOL); + return; + } // Remember in which order the suggestions were $addresses = array(); diff --git a/Zotlabs/Module/Sitelist.php b/Zotlabs/Module/Sitelist.php index e7d4187b7..2ac5ed1b8 100644 --- a/Zotlabs/Module/Sitelist.php +++ b/Zotlabs/Module/Sitelist.php @@ -32,7 +32,7 @@ class Sitelist extends \Zotlabs\Web\Controller { $result = array('success' => false); - $r = q("select count(site_url) as total from site where site_type = %d $sql_extra ", + $r = q("select count(site_url) as total from site where site_type = %d and site_dead = 0 $sql_extra ", intval(SITE_TYPE_ZOT) ); @@ -42,7 +42,7 @@ class Sitelist extends \Zotlabs\Web\Controller { $result['start'] = $start; $result['limit'] = $limit; - $r = q("select * from site where site_type = %d $sql_extra $sql_order $sql_limit", + $r = q("select * from site where site_type = %d and site_dead = 0 $sql_extra $sql_order $sql_limit", intval(SITE_TYPE_ZOT) ); -- cgit v1.2.3 From f0f58dade886d88fc178b78c04e1a4067ddfda04 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 6 Mar 2018 15:31:45 -0800 Subject: federated polls: add poll_author which will be necessary for Diaspora federation --- Zotlabs/Update/_1208.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Zotlabs/Update/_1208.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1208.php b/Zotlabs/Update/_1208.php new file mode 100644 index 000000000..4cbcf4322 --- /dev/null +++ b/Zotlabs/Update/_1208.php @@ -0,0 +1,26 @@ + Date: Wed, 7 Mar 2018 20:29:37 +0100 Subject: we do not support separate mobile themes anymore --- Zotlabs/Module/Admin/Site.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 880dbbe4b..015c6535c 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -24,7 +24,7 @@ class Site { $siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : ''); $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : ''); $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : ''); - $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : ''); +// $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : ''); // $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : ''); $maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0); @@ -122,11 +122,11 @@ class Site { set_config('system','siteinfo',$siteinfo); set_config('system', 'language', $language); set_config('system', 'theme', $theme); - if ( $theme_mobile === '---' ) { - del_config('system', 'mobile_theme'); - } else { - set_config('system', 'mobile_theme', $theme_mobile); - } +// if ( $theme_mobile === '---' ) { +// del_config('system', 'mobile_theme'); +// } else { +// set_config('system', 'mobile_theme', $theme_mobile); +// } // set_config('system','site_channel', $site_channel); set_config('system','maximagesize', $maximagesize); @@ -305,7 +305,7 @@ class Site { '$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - change theme settings"), $theme_choices), - '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), +// '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), // '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), '$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')), '$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), -- cgit v1.2.3 From 17c102ebe115bd8272da830bf9523b691ce115ee Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 7 Mar 2018 21:11:57 +0100 Subject: we need the javascript in the template since strings are involved --- Zotlabs/Module/Cover_photo.php | 6 ++++++ Zotlabs/Module/Profile_photo.php | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 047bcf3d4..2da99b447 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -364,6 +364,12 @@ class Cover_photo extends \Zotlabs\Web\Controller { '$embedPhotosModalTitle' => t('Use a photo from your albums'), '$embedPhotosModalCancel' => t('Cancel'), '$embedPhotosModalOK' => t('OK'), + '$modalchooseimages' => t('Choose images to embed'), + '$modalchoosealbum' => t('Choose an album'), + '$modaldiffalbum' => t('Choose a different album'), + '$modalerrorlist' => t('Error getting album list'), + '$modalerrorlink' => t('Error getting photo link'), + '$modalerroralbum' => t('Error getting album'), '$form_security_token' => get_form_security_token("cover_photo"), /// @FIXME - yuk '$select' => t('Select existing photo'), diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index 44b7c18c6..2ce8686b9 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -463,6 +463,12 @@ class Profile_photo extends \Zotlabs\Web\Controller { '$embedPhotosModalTitle' => t('Use a photo from your albums'), '$embedPhotosModalCancel' => t('Cancel'), '$embedPhotosModalOK' => t('OK'), + '$modalchooseimages' => t('Choose images to embed'), + '$modalchoosealbum' => t('Choose an album'), + '$modaldiffalbum' => t('Choose a different album'), + '$modalerrorlist' => t('Error getting album list'), + '$modalerrorlink' => t('Error getting photo link'), + '$modalerroralbum' => t('Error getting album'), '$form_security_token' => get_form_security_token("profile_photo"), '$select' => t('Select existing photo'), )); -- cgit v1.2.3 From a454aad124f999e59e8bffb625c103b975aef107 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 7 Mar 2018 15:39:14 -0800 Subject: federated polls: GNU-Social requires us to preserve the original order of the poll answers for use in making a vote, unlike diaspora (which selects by guid) and activitypub (which selects by non-localisable text). --- Zotlabs/Update/_1209.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Zotlabs/Update/_1209.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1209.php b/Zotlabs/Update/_1209.php new file mode 100644 index 000000000..5ec449395 --- /dev/null +++ b/Zotlabs/Update/_1209.php @@ -0,0 +1,26 @@ + Date: Wed, 7 Mar 2018 16:59:55 -0800 Subject: hashtag autocomplete --- Zotlabs/Module/Hashtags.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Zotlabs/Module/Hashtags.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Hashtags.php b/Zotlabs/Module/Hashtags.php new file mode 100644 index 000000000..d87a82818 --- /dev/null +++ b/Zotlabs/Module/Hashtags.php @@ -0,0 +1,29 @@ + strtolower($rv['term']) ]; + } + } + logger(print_r($result,true)); + json_return_and_die($result); + } +} \ No newline at end of file -- cgit v1.2.3 From 1700aedbed9050ca2eee621c04c29e5b34150bc5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 7 Mar 2018 17:29:01 -0800 Subject: remove extraneous logging --- Zotlabs/Module/Hashtags.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Hashtags.php b/Zotlabs/Module/Hashtags.php index d87a82818..edb631871 100644 --- a/Zotlabs/Module/Hashtags.php +++ b/Zotlabs/Module/Hashtags.php @@ -8,8 +8,6 @@ class Hashtags extends \Zotlabs\Web\Controller { function init() { $result = []; - logger(print_r($_REQUEST,true)); - $t = escape_tags($_REQUEST['t']); if(! $t) json_return_and_die($result); @@ -23,7 +21,7 @@ class Hashtags extends \Zotlabs\Web\Controller { $result[] = [ 'text' => strtolower($rv['term']) ]; } } - logger(print_r($result,true)); + json_return_and_die($result); } } \ No newline at end of file -- cgit v1.2.3 From 2105cfd433d30e0277e5ae3080cec8620747759a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Mar 2018 10:20:40 +0100 Subject: fix syntax error in postgres update --- Zotlabs/Update/_1204.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1204.php b/Zotlabs/Update/_1204.php index 93c2e4e3f..0b9204b9b 100644 --- a/Zotlabs/Update/_1204.php +++ b/Zotlabs/Update/_1204.php @@ -8,11 +8,11 @@ class _1204 { if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { $r1 = q("ALTER TABLE poll ADD poll_guid text NOT NULL"); - $r2 = q("create index \"poll_guid_idx\" on poll \"poll_guid\""); + $r2 = q("create index \"poll_guid_idx\" on poll (\"poll_guid\")"); $r3 = q("ALTER TABLE poll_elm ADD pelm_guid text NOT NULL"); - $r4 = q("create index \"pelm_guid_idx\" on poll_elm \"pelm_guid\""); + $r4 = q("create index \"pelm_guid_idx\" on poll_elm (\"pelm_guid\")"); $r5 = q("ALTER TABLE vote ADD vote_guid text NOT NULL"); - $r6 = q("create index \"vote_guid_idx\" on vote \"vote_guid\""); + $r6 = q("create index \"vote_guid_idx\" on vote (\"vote_guid\")"); $r = ($r1 && $r2 && $r3 && $r4 && $r5 && $r6); } -- cgit v1.2.3 From a0a1246efb74473269238f7b3e4d35f90c11b49e Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Mar 2018 10:50:03 +0100 Subject: use dbunescbin() for cover photos --- Zotlabs/Module/Cover_photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 2da99b447..56e35f912 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -207,7 +207,7 @@ class Cover_photo extends \Zotlabs\Web\Controller { } } - $imagedata = (($os_storage) ? @file_get_contents($imagedata) : $imagedata); + $imagedata = (($os_storage) ? @file_get_contents(dbunescbin($imagedata)) : dbunescbin($imagedata)); $ph = photo_factory($imagedata, $filetype); if(! $ph->is_valid()) { -- cgit v1.2.3 From cd21519de38bb422d55fdc2d4f9ea01012f4e013 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 10 Mar 2018 21:21:44 +0100 Subject: do not use trim on array --- Zotlabs/Module/Admin/Site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 015c6535c..bfb9be8bd 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -38,7 +38,7 @@ class Site { $site_sellpage = ((x($_POST,'site_sellpage')) ? notags(trim($_POST['site_sellpage'])) : ''); $site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : ''); $frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : ''); - $firstpage = ((x(trim($_POST,'firstpage'))) ? notags(trim($_POST['firstpage'])) : 'profiles'); + $firstpage = ((x($_POST,'firstpage')) ? notags(trim($_POST['firstpage'])) : 'profiles'); $mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0); $directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : ''); $allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : ''); -- cgit v1.2.3 From a417389934933af64e631c6372d410cbf864450a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 10 Mar 2018 13:20:20 -0800 Subject: trim expects error ... in admin/site --- Zotlabs/Module/Admin/Site.php | 12 +++++++++--- Zotlabs/Module/Import.php | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 880dbbe4b..45391a43a 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -14,6 +14,8 @@ class Site { return; } +logger('post: ' . print_r($_POST,true)); + check_form_security_token_redirectOnErr('/admin/site', 'admin_site'); $sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : ''); @@ -38,7 +40,11 @@ class Site { $site_sellpage = ((x($_POST,'site_sellpage')) ? notags(trim($_POST['site_sellpage'])) : ''); $site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : ''); $frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : ''); - $firstpage = ((x(trim($_POST,'firstpage'))) ? notags(trim($_POST['firstpage'])) : 'profiles'); + $first_page = ((x($_POST,'first_page')) ? notags(trim($_POST['first_page'])) : 'profiles'); + // check value after trim + if(! $first_page) { + $first_page = 'profiles'; + } $mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0); $directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : ''); $allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : ''); @@ -82,7 +88,7 @@ class Site { set_config('system', 'maxloadavg', $maxloadavg); set_config('system', 'frontpage', $frontpage); set_config('system', 'sellpage', $site_sellpage); - set_config('system', 'workflow_channel_next', $firstpage); + set_config('system', 'workflow_channel_next', $first_page); set_config('system', 'site_location', $site_location); set_config('system', 'mirror_frontpage', $mirror_frontpage); set_config('system', 'sitename', $sitename); @@ -345,7 +351,7 @@ class Site { '$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')), '$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())), - '$firstpage' => array('firstpage', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Recommend: profiles, go, or settings')), + '$first_page' => array('first_page', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Recommend: profiles, go, or settings')), '$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')), diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index 36bd72310..81c405f00 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -114,15 +114,16 @@ class Import extends \Zotlabs\Web\Controller { return; } - if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) { - $v1 = substr($data['compatibility']['database'],-4); - $v2 = substr(DB_UPDATE_VERSION,-4); - if($v2 > $v1) { - $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 ); - notice($t); - } - - } +// This is only an info message but it is alarming to folks who then report failure with this as the cause, when in fact we ignore this completely. +// if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) { +// $v1 = substr($data['compatibility']['database'],-4); +// $v2 = substr(DB_UPDATE_VERSION,-4); +// if($v2 > $v1) { +// $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 ); +// notice($t); +// } +// +// } if($moving) $seize = 1; -- cgit v1.2.3 From 08d2adddf519117e0cd7c0a97222cac63a431631 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 10 Mar 2018 13:21:22 -0800 Subject: remove debugging --- Zotlabs/Module/Admin/Site.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 45391a43a..2ff5ed9c4 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -14,8 +14,6 @@ class Site { return; } -logger('post: ' . print_r($_POST,true)); - check_form_security_token_redirectOnErr('/admin/site', 'admin_site'); $sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : ''); -- cgit v1.2.3 From 717ae5486806f7f238f6cdafe08c8aefd94056d2 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 11 Mar 2018 16:42:46 -0700 Subject: Setup - .htconfig.php write access is now required for automated installation. [String change - leave in dev for the next release] --- Zotlabs/Module/Setup.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index 8e7fbbddf..a3832d156 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -563,16 +563,20 @@ class Setup extends \Zotlabs\Web\Controller { $status = true; $help = ''; - if( (file_exists('.htconfig.php') && !is_writable('.htconfig.php')) || - (!file_exists('.htconfig.php') && !is_writable('.')) ) { - $status = false; - $help = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL; - $help .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL; - $help .= t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Red top folder.').EOL; - $help .= t('You can alternatively skip this procedure and perform a manual installation. Please see the file "install/INSTALL.txt" for instructions.').EOL; + $fname = '.htconfig.php'; + + if((file_exists($fname) && is_writable($fname)) || + (! (file_exists($fname) && is_writable('.')))) { + $this->check_add($checks, t('.htconfig.php is writable'), $status, true, $help); + return; } - $this->check_add($checks, t('.htconfig.php is writable'), $status, false, $help); + $status = false; + $help = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL; + $help .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL; + $help .= t('Please see install/INSTALL.txt for additional information.'); + + $this->check_add($checks, t('.htconfig.php is writable'), $status, true, $help); } /** -- cgit v1.2.3 From 34399b8b47d9a85eb3c4095392ab994792257d88 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 12 Mar 2018 15:47:33 -0700 Subject: obscure permission issue with custom permissions when using the highly discouraged advisory privacy modes --- Zotlabs/Module/Item.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 3f857030b..fba2ef7a4 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -830,6 +830,12 @@ class Item extends \Zotlabs\Web\Controller { $datarray['plink'] = $plink; $datarray['route'] = $route; + + // A specific ACL over-rides public_policy completely + + if(! empty_acl($datarray)) + $datarray['public_policy'] = ''; + if($iconfig) $datarray['iconfig'] = $iconfig; -- cgit v1.2.3 From ab1d47b36f21e5881900d9d805f4f7876f1c472f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 12 Mar 2018 20:54:55 -0700 Subject: unicode/emoji usernames. Warning: experimental feature, unstable, untested, disabled by default, use at your own risk, may not federate to other platforms and protocols. May not clone correctly. Bug reports which neglect to include detailed roubleshooting information and patches/pull requests will be ignored. --- Zotlabs/Module/Follow.php | 2 +- Zotlabs/Module/New_channel.php | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Follow.php b/Zotlabs/Module/Follow.php index 146c4e564..d441f21d2 100644 --- a/Zotlabs/Module/Follow.php +++ b/Zotlabs/Module/Follow.php @@ -14,7 +14,7 @@ class Follow extends \Zotlabs\Web\Controller { } $uid = local_channel(); - $url = notags(trim($_REQUEST['url'])); + $url = notags(trim(unpunify($_REQUEST['url']))); $return_url = $_SESSION['return_url']; $confirm = intval($_REQUEST['confirm']); $interactive = (($_REQUEST['interactive']) ? intval($_REQUEST['interactive']) : 1); diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index 548f28c4f..ea9f27447 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -16,8 +16,15 @@ class New_channel extends \Zotlabs\Web\Controller { require_once('library/urlify/URLify.php'); $result = array('error' => false, 'message' => ''); $n = trim($_REQUEST['name']); - - $x = strtolower(\URLify::transliterate($n)); + + $x = false; + + if(get_config('system','unicode_usernames')) { + $x = punify(mb_strtolower($n)); + } + + if((! $x) || strlen($x) > 64) + $x = strtolower(\URLify::transliterate($n)); $test = array(); @@ -43,7 +50,14 @@ class New_channel extends \Zotlabs\Web\Controller { $result = array('error' => false, 'message' => ''); $n = trim($_REQUEST['nick']); - $x = strtolower(\URLify::transliterate($n)); + $x = false; + + if(get_config('system','unicode_usernames')) { + $x = punify(mb_strtolower($n)); + } + + if((! $x) || strlen($x) > 64) + $x = strtolower(\URLify::transliterate($n)); $test = array(); -- cgit v1.2.3