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