From a9da370c0bf5777a0345744667240ef0c615dcaa Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Apr 2021 14:57:16 +0000 Subject: register: cleanup template --- include/js_strings.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/js_strings.php b/include/js_strings.php index e06e105fd..25b73d71e 100644 --- a/include/js_strings.php +++ b/include/js_strings.php @@ -116,6 +116,10 @@ function js_strings() { '$allday' => t('All day','calendar'), // mod cloud - '$download_info' => t('Please stand by while your download is being prepared.') + '$download_info' => t('Please stand by while your download is being prepared.'), + + // mod register + '$email_not_valid' => t('Email address not valid') + )); } -- cgit v1.2.3 From 01b081d809d128e0922fb404921f452c51c2ddb2 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 9 Apr 2021 09:49:36 +0000 Subject: register: only return verified registrations in get_pending_accounts(), more invite handling fixes --- include/account.php | 5 ++--- include/js_strings.php | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/account.php b/include/account.php index 10131c5d4..f7e2c7e32 100644 --- a/include/account.php +++ b/include/account.php @@ -1271,9 +1271,8 @@ function get_pending_accounts() { // better useability at the moment to tell all (ACCOUNT_PENDING >= 0) instead of (> 0 for those need approval) - $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, - CASE (reg_flags & %d) WHEN 0 THEN 1 WHEN 1 THEN 0 END AS reg_vfd - FROM register WHERE reg_vital = 1 AND (reg_flags & %d) >= 0", + $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id + FROM register WHERE reg_vital = 1 AND (reg_flags & %d) = 0 AND (reg_flags & %d) >= 0", intval(ACCOUNT_UNVERIFIED), intval(ACCOUNT_PENDING) ); diff --git a/include/js_strings.php b/include/js_strings.php index 25b73d71e..ed73b0420 100644 --- a/include/js_strings.php +++ b/include/js_strings.php @@ -119,7 +119,8 @@ function js_strings() { '$download_info' => t('Please stand by while your download is being prepared.'), // mod register - '$email_not_valid' => t('Email address not valid') + '$email_not_valid' => t('Email address not valid'), + '$email_required' => t('Required') )); } -- cgit v1.2.3 From e193b6d870482da0d499e886f6add31bdc7c9d5a Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 10 Apr 2021 08:00:03 +0000 Subject: feature level is deprecated --- include/features.php | 73 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 37 deletions(-) (limited to 'include') diff --git a/include/features.php b/include/features.php index e1457604b..584d9cdfb 100644 --- a/include/features.php +++ b/include/features.php @@ -146,40 +146,40 @@ function get_features($filtered = true, $level = (-1)) { t('Conversation'), /* disable until we agree on how to implemnt this in zot6/activitypub [ - 'commtag', - t('Community Tagging'), + 'commtag', + t('Community Tagging'), t('Ability to tag existing posts'), false, get_config('feature_lock','commtag'), ], */ [ - 'emojis', - t('Emoji Reactions'), + 'emojis', + t('Emoji Reactions'), t('Add emoji reaction ability to posts'), true, get_config('feature_lock','emojis'), ], [ - 'dislike', - t('Dislike Posts'), + 'dislike', + t('Dislike Posts'), t('Ability to dislike posts/comments'), false, get_config('feature_lock','dislike'), ], [ - 'star_posts', - t('Star Posts'), + 'star_posts', + t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, get_config('feature_lock','star_posts'), ], - + [ - 'reply_to', - t('Reply on comment'), + 'reply_to', + t('Reply on comment'), t('Ability to reply on selected comment'), false, get_config('feature_lock','reply_to'), @@ -211,60 +211,59 @@ function get_features($filtered = true, $level = (-1)) { t('Add categories to your posts'), false, get_config('feature_lock','categories'), - feature_level('categories',1), ], [ - 'large_photos', - t('Large Photos'), + 'large_photos', + t('Large Photos'), t('Include large (1024px) photo thumbnails in posts. If not enabled, use small (640px) photo thumbnails'), false, get_config('feature_lock','large_photos'), ], [ - 'content_encrypt', - t('Even More Encryption'), + 'content_encrypt', + t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key'), false, get_config('feature_lock','content_encrypt'), ], [ - 'disable_comments', - t('Disable Comments'), + 'disable_comments', + t('Disable Comments'), t('Provide the option to disable comments for a post'), false, get_config('feature_lock','disable_comments'), ], [ - 'delayed_posting', - t('Delayed Posting'), + 'delayed_posting', + t('Delayed Posting'), t('Allow posts to be published at a later date'), false, get_config('feature_lock','delayed_posting'), ], - [ + [ 'content_expire', t('Content Expiration'), - t('Remove posts/comments and/or private messages at a future time'), - false, + t('Remove posts/comments and/or private messages at a future time'), + false, get_config('feature_lock','content_expire'), ], [ - 'suppress_duplicates', - t('Suppress Duplicate Posts/Comments'), + 'suppress_duplicates', + t('Suppress Duplicate Posts/Comments'), t('Prevent posts with identical content to be published with less than two minutes in between submissions.'), true, get_config('feature_lock','suppress_duplicates'), ], [ - 'auto_save_draft', - t('Auto-save drafts of posts and comments'), + 'auto_save_draft', + t('Auto-save drafts of posts and comments'), t('Automatically saves post and comment drafts in local browser storage to help prevent accidental loss of compositions'), true, get_config('feature_lock','auto_save_draft'), @@ -277,8 +276,8 @@ function get_features($filtered = true, $level = (-1)) { t('Manage'), [ - 'nav_channel_select', - t('Navigation Channel Select'), + 'nav_channel_select', + t('Navigation Channel Select'), t('Change channels directly from within the navigation dropdown menu'), false, get_config('feature_lock','nav_channel_select'), @@ -307,8 +306,8 @@ function get_features($filtered = true, $level = (-1)) { ], [ - 'savedsearch', - t('Saved Searches'), + 'savedsearch', + t('Saved Searches'), t('Save search terms for re-use'), false, get_config('feature_lock','savedsearch') @@ -339,8 +338,8 @@ function get_features($filtered = true, $level = (-1)) { ], [ - 'forums_tab', - t('Forum Filter'), + 'forums_tab', + t('Forum Filter'), t('Ability to display only posts of a specific forum'), false, get_config('feature_lock','forums_tab') @@ -401,8 +400,8 @@ function get_features($filtered = true, $level = (-1)) { [ 'multi_profiles', t('Multiple Profiles'), - t('Ability to create multiple profiles'), - false, + t('Ability to create multiple profiles'), + false, get_config('feature_lock','multi_profiles') ] @@ -426,7 +425,7 @@ function get_features($filtered = true, $level = (-1)) { for($y = 0; $y < count($arr[$k]); $y ++) { $disabled = false; if(is_array($arr[$k][$y])) { - if($arr[$k][$y][4] !== false) { + if($arr[$k][$y][4] !== false) { $disabled = true; } if(! $disabled) { @@ -446,7 +445,7 @@ function get_features($filtered = true, $level = (-1)) { return $narr; } - + function get_module_features($module) { $features = get_features(false); return $features[$module]; -- cgit v1.2.3 From f0e5ce7fd1dae13cc257a8a860fccbc294530776 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 10 Apr 2021 20:44:04 +0000 Subject: register: more work on ui/ux --- include/account.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/account.php b/include/account.php index f7e2c7e32..939a4344e 100644 --- a/include/account.php +++ b/include/account.php @@ -1241,20 +1241,20 @@ function zar_register_dutystate( $now=NULL, $day=NULL ) { $atform = $isduty ? '' : 'disabled'; $utc_now = datetime_convert(date_default_timezone_get(), 'UTC', $now, 'c'); - $nowfmt = t('Registration is currently') - . ' (' . $utc_now . ') ' - . $dutyis . '.
'; - + $nowfmt = ''; if (!$isduty) { + $nowfmt = t('Registration is currently'); + $nowfmt .= ' (' . $utc_now . ') '; + $nowfmt .= $dutyis . ',
'; + $pernext = zarIsDuty($day, $now, 'nextOpen'); $week_days = ['','monday','tuesday','wednesday','thursday','friday','saturday','sunday']; $utc_next_open = datetime_convert(date_default_timezone_get(), 'UTC', $week_days[$pernext[0]] . ' ' . $pernext[1], 'c'); if (is_array($pernext)) { - $nowfmt .= t('Next opens') . ' ' - . '' . $utc_next_open . '.'; - + $nowfmt .= t('please come back'); + $nowfmt .= ' ' . $utc_next_open . '.'; } } return array( 'isduty' => $isduty, 'nowfmt' => $nowfmt, 'atform' => $atform); -- cgit v1.2.3 From 16cc695115688b04dae1b3ab97aef149b17bc7e4 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 11 Apr 2021 15:47:42 +0000 Subject: fix regression finding bookmarks --- include/text.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 1eaa890e0..6e6e1fc38 100644 --- a/include/text.php +++ b/include/text.php @@ -874,11 +874,7 @@ function get_tags($s) { // ignore anything in [color= ], because it may contain color codes which are mistaken for tags $s = preg_replace('/\[color=(.*?)\]/sm','',$s); - // skip anchors in URL - $s = preg_replace('/\[url=(.*?)\]/sm','',$s); - // match any double quoted tags - if(preg_match_all('/([@#\!]\"\;.*?\"\;)/',$s,$match)) { foreach($match[1] as $mtch) { $ret[] = $mtch; @@ -891,7 +887,6 @@ function get_tags($s) { } // match bracket mentions - if(preg_match_all('/([@!]\!?\{.*?\})/',$s,$match)) { foreach($match[1] as $mtch) { $ret[] = $mtch; @@ -900,7 +895,6 @@ function get_tags($s) { // Pull out single word tags. These can be @nickname, @first_last // and #hash tags. - if(preg_match_all('/(? Date: Wed, 14 Apr 2021 11:01:34 +0000 Subject: use protect_sprintf() on query strings --- include/text.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 6e6e1fc38..749e1fd70 100644 --- a/include/text.php +++ b/include/text.php @@ -3717,7 +3717,7 @@ function get_forum_channels($uid) { $xc = ids_to_querystr($x1,'xchan',true); - $x2 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'tag_deliver' and v = '1' and xchan in (" . $xc . ") ", + $x2 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'tag_deliver' and v = '1' and xchan in (" . protect_sprintf($xc) . ") ", intval($uid) ); @@ -3725,7 +3725,7 @@ function get_forum_channels($uid) { $sql_extra = (($xf) ? ' and not xchan in (' . $xf . ')' : ''); // private forums - $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") $sql_extra ", + $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . protect_sprintf($xc) . ") $sql_extra ", intval(local_channel()) ); if($x3) { @@ -3733,7 +3733,7 @@ function get_forum_channels($uid) { } // public forums with no permission to post - $x4 = q("select xchan from abconfig left join xchan on xchan = xchan_hash where chan = %d and cat = 'their_perms' and k in ('post_wall', 'tag_deliver') and v = '0' and xchan in (" . $xc . ") and xchan_pubforum = 1 $sql_extra ", + $x4 = q("select xchan from abconfig left join xchan on xchan = xchan_hash where chan = %d and cat = 'their_perms' and k in ('post_wall', 'tag_deliver') and v = '0' and xchan in (" . protect_sprintf($xc) . ") and xchan_pubforum = 1 $sql_extra ", intval(local_channel()) ); if($x4) { @@ -3742,7 +3742,7 @@ function get_forum_channels($uid) { } - $sql_extra_1 = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 "); + $sql_extra_1 = (($xf) ? " and ( xchan_hash in (" . protect_sprintf($xf) . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 "); $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_addr, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra_1 order by xchan_name", intval($uid) -- cgit v1.2.3 From e35ab97b7ecbd96e11883bc194bfe9fb5a72e7f2 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 14 Apr 2021 19:40:51 +0000 Subject: register: provide a possibility to leave a message id registration is by approval --- include/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/account.php b/include/account.php index 939a4344e..991e799b5 100644 --- a/include/account.php +++ b/include/account.php @@ -1271,7 +1271,7 @@ function get_pending_accounts() { // better useability at the moment to tell all (ACCOUNT_PENDING >= 0) instead of (> 0 for those need approval) - $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id + $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, reg_stuff FROM register WHERE reg_vital = 1 AND (reg_flags & %d) = 0 AND (reg_flags & %d) >= 0", intval(ACCOUNT_UNVERIFIED), intval(ACCOUNT_PENDING) -- cgit v1.2.3 From 88f7c2041d74d82db5c84b45f30e1eb64dfcc216 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 16 Apr 2021 18:13:20 +0000 Subject: register: add option to show all register entries --- include/account.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/account.php b/include/account.php index 991e799b5..a7a87f331 100644 --- a/include/account.php +++ b/include/account.php @@ -1261,7 +1261,7 @@ function zar_register_dutystate( $now=NULL, $day=NULL ) { } -function get_pending_accounts() { +function get_pending_accounts($get_all = false) { /* get pending */ // [hilmar -> @@ -1271,9 +1271,13 @@ function get_pending_accounts() { // better useability at the moment to tell all (ACCOUNT_PENDING >= 0) instead of (> 0 for those need approval) + $sql_extra = " AND (reg_flags & " . ACCOUNT_UNVERIFIED . ") = 0 "; + + if($get_all) + $sql_extra = ''; + $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, reg_stuff - FROM register WHERE reg_vital = 1 AND (reg_flags & %d) = 0 AND (reg_flags & %d) >= 0", - intval(ACCOUNT_UNVERIFIED), + FROM register WHERE reg_vital = 1 $sql_extra AND (reg_flags & %d) >= 0", intval(ACCOUNT_PENDING) ); -- cgit v1.2.3