diff options
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | database.sql | 1 | ||||
-rw-r--r-- | include/security.php | 2 | ||||
-rw-r--r-- | mod/settings.php | 6 | ||||
-rw-r--r-- | update.php | 3 | ||||
-rw-r--r-- | view/de/settings.tpl | 8 | ||||
-rw-r--r-- | view/en/settings.tpl | 8 | ||||
-rw-r--r-- | view/fr/settings.tpl | 7 | ||||
-rw-r--r-- | view/it/settings.tpl | 7 | ||||
-rw-r--r-- | view/sv/settings.tpl | 8 | ||||
-rw-r--r-- | view/theme/duepuntozero/style.css | 3 | ||||
-rw-r--r-- | view/theme/loozah/style.css | 3 |
12 files changed, 55 insertions, 3 deletions
@@ -4,7 +4,7 @@ set_time_limit(0); define ( 'FRIENDIKA_VERSION', '2.1.924' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); -define ( 'DB_UPDATE_VERSION', 1043 ); +define ( 'DB_UPDATE_VERSION', 1044 ); define ( 'EOL', "<br />\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 0ecf0ea20..0a718c8c2 100644 --- a/database.sql +++ b/database.sql @@ -375,6 +375,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `sprvkey` text NOT NULL, `verified` tinyint(1) unsigned NOT NULL DEFAULT '0', `blocked` tinyint(1) unsigned NOT NULL DEFAULT '0', + `blockwall` tinyint(1) unsigned NOT NULL DEFAULT '0', `notify-flags` int(11) unsigned NOT NULL DEFAULT '65535', `page-flags` int(11) unsigned NOT NULL DEFAULT '0', `pwdreset` char(255) NOT NULL, diff --git a/include/security.php b/include/security.php index 5e79e1edd..c74a9b4a3 100644 --- a/include/security.php +++ b/include/security.php @@ -25,7 +25,7 @@ function can_write_wall(&$a,$owner) { else { $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `user`.`uid` = `contact`.`uid` WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - AND `readonly` = 0 AND ( `contact`.`rel` IN ( %d , %d ) OR `user`.`page-flags` = %d ) LIMIT 1", + AND `user`.`blockwall` = 0 AND `readonly` = 0 AND ( `contact`.`rel` IN ( %d , %d ) OR `user`.`page-flags` = %d ) LIMIT 1", intval($owner), intval(remote_user()), intval(REL_VIP), diff --git a/mod/settings.php b/mod/settings.php index 85029b3d7..6a2733d7c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -70,6 +70,7 @@ function settings_post(&$a) { $net_publish = (((x($_POST,'profile_in_netdirectory')) && (intval($_POST['profile_in_netdirectory']) == 1)) ? 1: 0); $old_visibility = (((x($_POST,'visibility')) && (intval($_POST['visibility']) == 1)) ? 1 : 0); $page_flags = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0); + $blockwall = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted! $notify = 0; @@ -140,7 +141,7 @@ function settings_post(&$a) { $openidserver = ''; } - $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s' WHERE `uid` = %d LIMIT 1", + $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d WHERE `uid` = %d LIMIT 1", dbesc($username), dbesc($email), dbesc($openid), @@ -157,6 +158,7 @@ function settings_post(&$a) { intval($maxreq), intval($expire), dbesc($openidserver), + intval($blockwall), intval(local_user()) ); if($r) @@ -241,6 +243,7 @@ function settings_content(&$a) { $openid = $a->user['openid']; $maxreq = $a->user['maxreq']; $expire = ((intval($a->user['expire'])) ? $a->user['expire'] : ''); + $blockwall = $a->user['blockwall']; if(! strlen($a->user['timezone'])) $timezone = date_default_timezone_get(); @@ -362,6 +365,7 @@ function settings_content(&$a) { '$sel_notify5' => (($notify & NOTIFY_MAIL) ? ' checked="checked" ' : ''), '$maxreq' => $maxreq, '$expire' => $expire, + '$blockw_checked' => (($blockwall) ? '' : ' checked="checked" ' ), '$theme' => $theme_selector, '$pagetype' => $pagetype )); diff --git a/update.php b/update.php index 0be919f3f..9f94cd511 100644 --- a/update.php +++ b/update.php @@ -407,3 +407,6 @@ function update_1042() { } +function update_1043() { + q("ALTER TABLE `user` ADD `blockwall` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `blocked` "); +} diff --git a/view/de/settings.tpl b/view/de/settings.tpl index 675ef675f..5f700ff8b 100644 --- a/view/de/settings.tpl +++ b/view/de/settings.tpl @@ -89,6 +89,14 @@ $profile_in_net_dir </div> <div id="settings-default-perms-end"></div> +<div id="settings-blockw-wrapper" > +<label id="settings-blockw-label" for="settings-blockw" >Allow friends to post to your profile: </label> +<input type="checkbox" name="blockwall" id="settings-blockw" value="1" $blockw_checked /> +</div> +<div id="settings-blockw-end" ></div> + + + <div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div> <div id="settings-expire-end"></div> diff --git a/view/en/settings.tpl b/view/en/settings.tpl index 39b18c126..45060e1c4 100644 --- a/view/en/settings.tpl +++ b/view/en/settings.tpl @@ -88,6 +88,14 @@ $profile_in_net_dir </div> <div id="settings-default-perms-end"></div> +<div id="settings-blockw-wrapper" > +<label id="settings-blockw-label" for="settings-blockw" >Allow friends to post to your profile: </label> +<input type="checkbox" name="blockwall" id="settings-blockw" value="1" $blockw_checked /> +</div> +<div id="settings-blockw-end" ></div> + + + <div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div> <div id="settings-expire-end"></div> diff --git a/view/fr/settings.tpl b/view/fr/settings.tpl index eb386579f..e0334842a 100644 --- a/view/fr/settings.tpl +++ b/view/fr/settings.tpl @@ -89,6 +89,13 @@ $profile_in_net_dir </div> <div id="settings-default-perms-end"></div> +<div id="settings-blockw-wrapper" > +<label id="settings-blockw-label" for="settings-blockw" >Allow friends to post to your profile: </label> +<input type="checkbox" name="blockwall" id="settings-blockw" value="1" $blockw_checked /> +</div> +<div id="settings-blockw-end" ></div> + + <div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div> <div id="settings-expire-end"></div> diff --git a/view/it/settings.tpl b/view/it/settings.tpl index 87f40f26f..d1e25da81 100644 --- a/view/it/settings.tpl +++ b/view/it/settings.tpl @@ -90,6 +90,13 @@ $profile_in_net_dir </div> <div id="settings-default-perms-end"></div> +<div id="settings-blockw-wrapper" > +<label id="settings-blockw-label" for="settings-blockw" >Allow friends to post to your profile: </label> +<input type="checkbox" name="blockwall" id="settings-blockw" value="1" $blockw_checked /> +</div> +<div id="settings-blockw-end" ></div> + + <div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div> <div id="settings-expire-end"></div> diff --git a/view/sv/settings.tpl b/view/sv/settings.tpl index ea4e2e52c..d5b8d5b3f 100644 --- a/view/sv/settings.tpl +++ b/view/sv/settings.tpl @@ -89,6 +89,14 @@ $profile_in_net_dir </div> <div id="settings-default-perms-end"></div> +<div id="settings-blockw-wrapper" > +<label id="settings-blockw-label" for="settings-blockw" >Allow friends to post to your profile: </label> +<input type="checkbox" name="blockwall" id="settings-blockw" value="1" $blockw_checked /> +</div> +<div id="settings-blockw-end" ></div> + + + <div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div> <div id="settings-expire-end"></div> diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 5db45921a..e4fa1f9d7 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -384,6 +384,7 @@ input#dfrn-url { #settings-nick-end, #settings-defloc-end, #settings-allowloc-end, +#settings-blockw-end, #settings-timezone-end, #settings-theme-end, #settings-password-end, @@ -404,6 +405,7 @@ input#dfrn-url { #settings-nick-label, #settings-defloc-label, #settings-allowloc-label, +#settings-blockw-label, #settings-timezone-label, #settings-theme-label, #settings-password-label, @@ -424,6 +426,7 @@ input#dfrn-url { #settings-nick, #settings-defloc, #settings-allowloc, +#settings-blockw, #timezone-select, #theme-select, #settings-password, diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 0284bdcf8..030b878bf 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -517,6 +517,7 @@ input#dfrn-url { #settings-nick-end, #settings-defloc-end, #settings-allowloc-end, +#settings-blockw-end, #settings-timezone-end, #settings-theme-end, #settings-password-end, @@ -537,6 +538,7 @@ input#dfrn-url { #settings-nick-label, #settings-defloc-label, #settings-allowloc-label, +#settings-blockw-label, #settings-timezone-label, #settings-theme-label, #settings-password-label, @@ -557,6 +559,7 @@ input#dfrn-url { #settings-nick, #settings-defloc, #settings-allowloc, +#settings-blockw, #timezone-select, #theme-select, #settings-password, |