From 660079bd2a4a6dcb54390a4c2f22bbc7a0633fd4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 26 Jan 2018 12:16:47 -0800 Subject: Issue with configurable site age limit, vagueness when informing about email validation policy; added email validation resend ability and the option to input a verification code at a webpage though both require additional work to provide these abilities. --- Zotlabs/Module/Register.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index deaee31bf..1cb3bab91 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -217,6 +217,9 @@ class Register extends \Zotlabs\Web\Controller { $privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : ""); $perm_roles = \Zotlabs\Access\PermissionRoles::roles(); + + // A new account will not have a techlevel, but accounts can also be created by the administrator. + if((get_account_techlevel() < 4) && $privacy_role !== 'custom') unset($perm_roles[t('Other')]); @@ -231,15 +234,17 @@ class Register extends \Zotlabs\Web\Controller { // Configurable whether to restrict age or not - default is based on international legal requirements // This can be relaxed if you are on a restricted server that does not share with public servers - if(get_config('system','no_age_restriction')) + if(get_config('system','no_age_restriction')) { $label_tos = sprintf( t('I accept the %s for this website'), $toslink); - else + } + else { $age = get_config('system','minimum_age'); if(!$age) { $age = 13; } $label_tos = sprintf( t('I am over %s years of age and accept the %s for this website'), $age, $toslink); - + } + $enable_tos = 1 - intval(get_config('system','no_termsofservice')); $email = array('email', t('Your email address'), ((x($_REQUEST,'email')) ? strip_tags(trim($_REQUEST['email'])) : "")); @@ -255,6 +260,7 @@ class Register extends \Zotlabs\Web\Controller { $auto_create = (get_config('system','auto_channel_create') ? true : false); $default_role = get_config('system','default_permissions_role'); + $email_verify = get_config('system','verify_email'); require_once('include/bbcode.php'); @@ -278,7 +284,7 @@ class Register extends \Zotlabs\Web\Controller { '$pass1' => $password, '$pass2' => $password2, '$submit' => t('Register'), - '$verify_note' => t('This site may require email verification after submitting this form. If you are returned to a login page, please check your email for instructions.') + '$verify_note' => (($email_verify) ? t('This site requires email verification. After completing this form, please check your email for further instructions.') : ''), )); return $o; -- cgit v1.2.3 From bd0f63980ba0d0e606f2dd7a65313f7e150d330a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 27 Jan 2018 12:51:48 -0800 Subject: Usability improvements to registration/verification workflow. This requires additional testing. --- Zotlabs/Module/Email_resend.php | 48 +++++++++++++++++++++++++++++++++++++ Zotlabs/Module/Email_validation.php | 38 +++++++++++++++++++++++++++++ Zotlabs/Module/Register.php | 6 +++-- 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 Zotlabs/Module/Email_resend.php create mode 100644 Zotlabs/Module/Email_validation.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Email_resend.php b/Zotlabs/Module/Email_resend.php new file mode 100644 index 000000000..367593b55 --- /dev/null +++ b/Zotlabs/Module/Email_resend.php @@ -0,0 +1,48 @@ + 1) { + $result = false; + $email = hex2bin(argv(1)); + + if($email) { + $result = verify_email_address( [ 'resend' => true, 'email' => $email ] ); + } + + if($result) { + notice(t('Email verification resent')); + } + else { + notice(t('Unable to resend email verification message.')); + } + + return; + + } + + // @todo - one can provide a form here to resend the mail + // after directing to here if a succesful login was attempted from an unverified address. + + + } + +} \ No newline at end of file diff --git a/Zotlabs/Module/Email_validation.php b/Zotlabs/Module/Email_validation.php new file mode 100644 index 000000000..4cc016847 --- /dev/null +++ b/Zotlabs/Module/Email_validation.php @@ -0,0 +1,38 @@ + 1) { + $email = hex2bin(argv(1)); + } + + $o = replace_macros(get_markup_template('email_validation.tpl'), [ + '$title' => t('Email Verification Required'), + '$desc' => sprintf( t('A verification token was sent to your email address [%s]. Enter that token here to complete the account verification step. Please allow a few minutes for delivery, and check your spam folder if you do not see the message.'),$email), + '$resend' => t('Resend Email'), + '$email' => bin2hex($email), + '$submit' => t('Submit'), + '$token' => [ 'token', t('Validation token'),'','' ], + ]); + + return $o; + + } + +} \ No newline at end of file diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index 1cb3bab91..c7fa1cee8 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -150,9 +150,11 @@ class Register extends \Zotlabs\Web\Controller { } if($email_verify) { - goaway(z_root()); + goaway(z_root() . '/email_validation/' . bin2hex($result['email'])); } - + + // fall through and authenticate if no approvals or verifications were required. + authenticate_success($result['account'],null,true,false,true); $new_channel = false; -- cgit v1.2.3 From 2e4e56f7cc696b2c52014f0050294826caa74d7d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 27 Jan 2018 22:23:47 +0100 Subject: if startpage is /hq redirect all notifications links to /hq and minor notifications and hq fixes --- Zotlabs/Module/Hq.php | 2 ++ Zotlabs/Widget/Notifications.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index a9c3bb8e2..c305fdb3b 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -29,6 +29,8 @@ class Hq extends \Zotlabs\Web\Controller { ); } + killme(); + } function get($update = 0, $load = false) { diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 5a0c1f3d5..322a7b60a 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -145,7 +145,8 @@ class Notifications { '$module' => \App::$module, '$notifications' => $notifications, '$no_notifications' => t('Sorry, you have got no notifications at the moment'), - '$loading' => t('Loading') + '$loading' => t('Loading'), + '$startpage' => get_pconfig(local_channel(), 'system', 'startpage') )); return $o; -- cgit v1.2.3 From d99a51e5b7748115bab218db31b9675fb31b1de8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 27 Jan 2018 13:41:37 -0800 Subject: typo --- Zotlabs/Module/Email_resend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Email_resend.php b/Zotlabs/Module/Email_resend.php index 367593b55..8c0fbad2f 100644 --- a/Zotlabs/Module/Email_resend.php +++ b/Zotlabs/Module/Email_resend.php @@ -11,7 +11,7 @@ class Email_resend extends \Zotlabs\Web\Controller { if($_POST['token']) { if(! account_approve(trim($_POST['token']))) { - notice('Token verification failed.') + notice('Token verification failed.'); } } -- cgit v1.2.3 From 69099a2732b749b4e370e16523152068e15cbd6f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 27 Jan 2018 14:16:52 -0800 Subject: registration testing --- Zotlabs/Module/Email_resend.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Email_resend.php b/Zotlabs/Module/Email_resend.php index 8c0fbad2f..921d2819a 100644 --- a/Zotlabs/Module/Email_resend.php +++ b/Zotlabs/Module/Email_resend.php @@ -7,8 +7,6 @@ class Email_resend extends \Zotlabs\Web\Controller { function post() { - - if($_POST['token']) { if(! account_approve(trim($_POST['token']))) { notice('Token verification failed.'); @@ -35,7 +33,7 @@ class Email_resend extends \Zotlabs\Web\Controller { notice(t('Unable to resend email verification message.')); } - return; + goaway(z_root() . '/email_validation/' . bin2hex($email)); } -- cgit v1.2.3 From 6c4054c20bf2e9c843b065318dd252233513f201 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 27 Jan 2018 23:55:44 +0100 Subject: fix syntax error --- Zotlabs/Module/Email_resend.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Email_resend.php b/Zotlabs/Module/Email_resend.php index 367593b55..57a82ebda 100644 --- a/Zotlabs/Module/Email_resend.php +++ b/Zotlabs/Module/Email_resend.php @@ -11,7 +11,7 @@ class Email_resend extends \Zotlabs\Web\Controller { if($_POST['token']) { if(! account_approve(trim($_POST['token']))) { - notice('Token verification failed.') + notice(t('Token verification failed.')); } } @@ -45,4 +45,4 @@ class Email_resend extends \Zotlabs\Web\Controller { } -} \ No newline at end of file +} -- cgit v1.2.3 From 21f464a5577e84b808fd56efdc49117a64c8dc30 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 27 Jan 2018 15:20:43 -0800 Subject: Guranteed somebody will paste the verification link and not the token, especially before all the translations are completed. But even then... --- Zotlabs/Module/Email_validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Email_validation.php b/Zotlabs/Module/Email_validation.php index 4cc016847..162501140 100644 --- a/Zotlabs/Module/Email_validation.php +++ b/Zotlabs/Module/Email_validation.php @@ -8,7 +8,7 @@ class Email_validation extends \Zotlabs\Web\Controller { function post() { if($_POST['token']) { - if(! account_approve(trim($_POST['token']))) { + if(! account_approve(trim(basename($_POST['token'])))) { notice('Token verification failed.'); } } -- cgit v1.2.3 From a86b260f736cd7298d5d160c658bb9405ad3f69f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 28 Jan 2018 12:09:47 +0100 Subject: query optimisations for notifications - use a specific index only --- Zotlabs/Module/Hq.php | 6 ++++-- Zotlabs/Module/Ping.php | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index c305fdb3b..c46695b65 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -51,9 +51,11 @@ class Hq extends \Zotlabs\Web\Controller { $item_normal = item_normal(); $item_normal_update = item_normal_update(); + $use_index = db_use_index('created'); + if(! $item_hash) { - $r = q("SELECT mid FROM item - WHERE uid = %d + $r = q("SELECT mid FROM item $use_index + WHERE uid = %d $item_normal AND mid = parent_mid ORDER BY created DESC LIMIT 1", intval(local_channel()) diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index a3f6cdfec..f8399d871 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -320,7 +320,9 @@ class Ping extends \Zotlabs\Web\Controller { if(argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) { $result = array(); - $r = q("SELECT * FROM item + $use_index = db_use_index('uid_item_unseen'); + + $r = q("SELECT * FROM item $use_index WHERE item_unseen = 1 and uid = %d $item_normal AND author_xchan != '%s' ORDER BY created DESC limit 300", @@ -492,8 +494,10 @@ class Ping extends \Zotlabs\Web\Controller { $t3 = dba_timer(); if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) { + + $use_index = db_use_index('uid_item_unseen'); - $r = q("SELECT id, item_wall FROM item + $r = q("SELECT id, item_wall FROM item $use_index WHERE item_unseen = 1 and uid = %d $item_normal AND author_xchan != '%s'", -- cgit v1.2.3 From 82f19e6278fd79c03dfbcd4007bf4321466485a6 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sun, 28 Jan 2018 21:38:25 +0100 Subject: Fix a PHP7.2 warning when a channel has no cards. --- Zotlabs/Module/Cards.php | 79 +++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 38 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index 22c5d673c..8eff6c80d 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -9,18 +9,22 @@ require_once('include/acl_selectors.php'); class Cards extends \Zotlabs\Web\Controller { function init() { - + if(argc() > 1) $which = argv(1); else return; - + profile_load($which); - + } - + + /** + * {@inheritDoc} + * @see \Zotlabs\Web\Controller::get() + */ function get($update = 0, $load = false) { - + if(observer_prohibited(true)) { return login(); } @@ -31,13 +35,13 @@ class Cards extends \Zotlabs\Web\Controller { return; } - if(! feature_enabled(\App::$profile_uid,'cards')) { + if(! feature_enabled(\App::$profile_uid, 'cards')) { return; } nav_set_selected(t('Cards')); - head_add_link([ + head_add_link([ 'rel' => 'alternate', 'type' => 'application/json+oembed', 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string), @@ -46,48 +50,48 @@ class Cards extends \Zotlabs\Web\Controller { $category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : ''); - + if($category) { - $sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY)); + $sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY)); } $which = argv(1); - + $selected_card = ((argc() > 2) ? argv(2) : ''); $_SESSION['return_url'] = \App::$query_string; - + $uid = local_channel(); $owner = \App::$profile_uid; $observer = \App::get_observer(); - + $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); - - if(! perm_is_allowed($owner,$ob_hash,'view_pages')) { + + if(! perm_is_allowed($owner, $ob_hash, 'view_pages')) { notice( t('Permission denied.') . EOL); return; } - + $is_owner = ($uid && $uid == $owner); - + $channel = channelx_by_n($owner); if($channel) { - $channel_acl = array( + $channel_acl = [ 'allow_cid' => $channel['channel_allow_cid'], 'allow_gid' => $channel['channel_allow_gid'], 'deny_cid' => $channel['channel_deny_cid'], 'deny_gid' => $channel['channel_deny_gid'] - ); + ]; } else { $channel_acl = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ]; } - - if(perm_is_allowed($owner,$ob_hash,'write_pages')) { + + if(perm_is_allowed($owner, $ob_hash, 'write_pages')) { $x = [ 'webpage' => ITEM_TYPE_CARD, @@ -95,9 +99,9 @@ class Cards extends \Zotlabs\Web\Controller { 'content_label' => t('Add Card'), 'button' => t('Create'), 'nickname' => $channel['channel_address'], - 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] + 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'acl' => (($is_owner) ? populate_acl($channel_acl, false, + 'acl' => (($is_owner) ? populate_acl($channel_acl, false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''), 'permissions' => $channel_acl, 'showacl' => (($is_owner) ? true : false), @@ -110,7 +114,7 @@ class Cards extends \Zotlabs\Web\Controller { 'layoutselect' => false, 'expanded' => false, 'novoting' => false, - 'catsenabled' => feature_enabled($owner,'categories'), + 'catsenabled' => feature_enabled($owner, 'categories'), 'bbco_autocomplete' => 'bbcode', 'bbcode' => true ]; @@ -119,14 +123,14 @@ class Cards extends \Zotlabs\Web\Controller { $x['title'] = $_REQUEST['title']; if($_REQUEST['body']) $x['body'] = $_REQUEST['body']; - $editor = status_editor($a,$x); + $editor = status_editor($a, $x); } else { $editor = ''; } - - + + $sql_extra = item_permissions_sql($owner); if($selected_card) { @@ -137,9 +141,9 @@ class Cards extends \Zotlabs\Web\Controller { $sql_extra .= "and item.id = " . intval($r[0]['iid']) . " "; } } - - $r = q("select * from item - where item.uid = %d and item_type = %d + + $r = q("select * from item + where item.uid = %d and item_type = %d $sql_extra order by item.created desc", intval($owner), intval(ITEM_TYPE_CARD) @@ -149,9 +153,10 @@ class Cards extends \Zotlabs\Web\Controller { and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 and item.item_blocked = 0 "; + $items_result = []; if($r) { - $parents_str = ids_to_querystr($r,'id'); + $parents_str = ids_to_querystr($r, 'id'); $items = q("SELECT item.*, item.id AS item_id FROM item @@ -164,24 +169,22 @@ class Cards extends \Zotlabs\Web\Controller { if($items) { xchan_query($items); $items = fetch_post_tags($items, true); - $items = conv_sort($items,'updated'); + $items_result = conv_sort($items, 'updated'); } - else - $items = []; } $mode = 'cards'; - - $content = conversation($items,$mode,false,'traditional'); + + $content = conversation($items_result, $mode, false, 'traditional'); $o = replace_macros(get_markup_template('cards.tpl'), [ '$title' => t('Cards'), '$editor' => $editor, '$content' => $content, - '$pager' => alt_pager($a,count($items)) + '$pager' => alt_pager($a, count($items_result)) ]); - return $o; - } + return $o; + } } -- cgit v1.2.3 From c3e365ef4718e4c9d06eb962cb3deeb9fb39a2d9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 28 Jan 2018 15:56:31 -0800 Subject: Surface the ability to change the landing page after channel creation and create a 'go' module to present several possible things to do at this point. Change the default from 'settings' to 'profiles' so that the focus is more on you rather than the software configuration. --- Zotlabs/Module/Admin/Site.php | 3 ++ Zotlabs/Module/Go.php | 66 ++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Module/New_channel.php | 4 +-- 3 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 Zotlabs/Module/Go.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 037f49277..52b36e03e 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -38,6 +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'); $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'])) : ''); @@ -80,6 +81,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', 'site_location', $site_location); set_config('system', 'mirror_frontpage', $mirror_frontpage); set_config('system', 'sitename', $sitename); @@ -340,6 +342,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')), '$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')), diff --git a/Zotlabs/Module/Go.php b/Zotlabs/Module/Go.php new file mode 100644 index 000000000..2c2dcf460 --- /dev/null +++ b/Zotlabs/Module/Go.php @@ -0,0 +1,66 @@ + t('Upload a profile photo'), + 'profiles' => t('Edit your default profile'), + 'suggest' => t('View friend suggestions'), + 'directory' => t('View the directory to find other interesting channels'), + 'settings' => t('View/edit your channel settings'), + 'help' => t('View the site or project documentation'), + 'channel/' . $channel['channel_address'] => t('Visit your channel homepage'), + 'connections' => t('View your connections and/or add somebody whose address you already know'), + 'network' => t('View your personal stream (this may be empty until you add some connections)'), + + ]; + + $site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false); + $net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true); + + if($site_firehose || $net_firehose) { + $options['pubstream'] = t('View the public stream. Warning: this content is not moderated'); + } + + $o = replace_macros(get_markup_template('go.tpl'), [ + '$title' => $title, + '$m' => $m, + '$m1' => $m1, + '$options' => $options + + ]); + + return $o; + + } + +} \ No newline at end of file diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index 2b73fa191..9f2fea802 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -89,9 +89,7 @@ class New_channel extends \Zotlabs\Web\Controller { change_channel($result['channel']['channel_id']); - if(! strlen($next_page = get_config('system','workflow_channel_next'))) - $next_page = 'settings'; - + $next_page = get_config('system', 'workflow_channel_next', 'profiles'); goaway(z_root() . '/' . $next_page); } -- cgit v1.2.3 From 56d1614ea6ddfd72df1241a7f2cbe927e38e2a8b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 28 Jan 2018 20:35:05 -0800 Subject: provide a default video image if nothing else is available. Allow sites to change it. --- Zotlabs/Module/Linkinfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 78c34583e..3392e4114 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -120,9 +120,9 @@ class Linkinfo extends \Zotlabs\Web\Controller { $siteinfo = self::parseurl_getsiteinfo($url); - // If this is a Red site, use zrl rather than url so they get zids sent to them by default + // If the site uses this platform, use zrl rather than url so they get zids sent to them by default - if( x($siteinfo,'generator') && (strpos($siteinfo['generator'], \Zotlabs\Lib\System::get_platform_name() . ' ') === 0)) + if(is_matrix_url($url)) $template = str_replace('url','zrl',$template); if($siteinfo["title"] == "") { -- cgit v1.2.3 From e4eff6a32bd6b9907c5c1a4454e5861f3712d380 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 29 Jan 2018 02:41:45 -0800 Subject: fix workflow for form based email validation when auto_channel_create is in effect. Eventually we will need to rework the workflow logic because it is getting a bit tangled. --- Zotlabs/Module/Email_validation.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Email_validation.php b/Zotlabs/Module/Email_validation.php index 162501140..b8bb720cd 100644 --- a/Zotlabs/Module/Email_validation.php +++ b/Zotlabs/Module/Email_validation.php @@ -8,9 +8,18 @@ class Email_validation extends \Zotlabs\Web\Controller { function post() { 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(get_config('system','auto_channel_create')) { + $next_page = get_config('system', 'workflow_channel_next', 'profiles'); + } + if($next_page) { + goaway(z_root() . '/' . $next_page); + } + } } } -- cgit v1.2.3 From 8d479aa1c74169e5b39d6409582c87e59a82d692 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 29 Jan 2018 16:58:55 -0800 Subject: redirect to the email_validation page if login was attempted after account creation but prior to successful verification. This presents the link to resend the verification email and/or allows you to enter it. --- Zotlabs/Module/Item.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index ad829137a..db2d64d70 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -753,6 +753,7 @@ class Item extends \Zotlabs\Web\Controller { if ((! $plink) && ($item_thread_top)) { $plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid; + $plink = substr($plink,0,190); } $datarray['aid'] = $channel['channel_account_id']; -- cgit v1.2.3 From 668f56807ad8bde45a2ed679eb3c97c632b6fb2f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 29 Jan 2018 17:43:11 -0800 Subject: unable to delete accounts using tickboxes on admin/accounts - make all the action names consistent --- Zotlabs/Module/Admin/Accounts.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Accounts.php b/Zotlabs/Module/Admin/Accounts.php index 2043550fc..8925ffff1 100644 --- a/Zotlabs/Module/Admin/Accounts.php +++ b/Zotlabs/Module/Admin/Accounts.php @@ -16,6 +16,9 @@ class Accounts { */ function post() { + +logger('post: ' . print_r($_POST,true)); + $pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() ); $users = ( x($_POST, 'user') ? $_POST['user'] : array() ); $blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() ); @@ -24,7 +27,7 @@ class Accounts { // change to switch structure? // account block/unblock button was submitted - if (x($_POST, 'page_users_block')) { + if (x($_POST, 'page_accounts_block')) { for ($i = 0; $i < count($users); $i++) { // if account is blocked remove blocked bit-flag, otherwise add blocked bit-flag $op = ($blocked[$i]) ? '& ~' : '| '; @@ -43,13 +46,13 @@ class Accounts { notice( sprintf( tt("%s account deleted", "%s accounts deleted", count($users)), count($users)) ); } // registration approved button was submitted - if (x($_POST, 'page_users_approve')) { + if (x($_POST, 'page_accounts_approve')) { foreach ($pending as $hash) { account_allow($hash); } } // registration deny button was submitted - if (x($_POST, 'page_users_deny')) { + if (x($_POST, 'page_accounts_deny')) { foreach ($pending as $hash) { account_deny($hash); } -- cgit v1.2.3 From 0e2c539d93e36db0b095e1dcd5080ce2b5fec1d7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 29 Jan 2018 19:57:43 -0800 Subject: remove logging --- Zotlabs/Module/Admin/Accounts.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Accounts.php b/Zotlabs/Module/Admin/Accounts.php index 8925ffff1..2e417edd1 100644 --- a/Zotlabs/Module/Admin/Accounts.php +++ b/Zotlabs/Module/Admin/Accounts.php @@ -17,8 +17,6 @@ class Accounts { function post() { -logger('post: ' . print_r($_POST,true)); - $pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() ); $users = ( x($_POST, 'user') ? $_POST['user'] : array() ); $blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() ); -- cgit v1.2.3