]> git.mxchange.org Git - friendica.git/commitdiff
user pref -> block remote wall posting
authorFriendika <info@friendika.com>
Mon, 21 Mar 2011 00:54:50 +0000 (17:54 -0700)
committerFriendika <info@friendika.com>
Mon, 21 Mar 2011 00:54:50 +0000 (17:54 -0700)
12 files changed:
boot.php
database.sql
include/security.php
mod/settings.php
update.php
view/de/settings.tpl
view/en/settings.tpl
view/fr/settings.tpl
view/it/settings.tpl
view/sv/settings.tpl
view/theme/duepuntozero/style.css
view/theme/loozah/style.css

index e28d00946645b26b5e7a170fad4bed06b96743c3..81794af91eceb53785b1a8becbe8800bc63aa0fd 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -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' );
index 0ecf0ea200e006e842a2bba5d562e77a3ed5ed5b..0a718c8c22713affb4c8c2328939e872adc8293b 100644 (file)
@@ -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,
index 5e79e1edd5f0017424777df1206ce2d3eee96617..c74a9b4a3cbe26d8ba919b6c44155e78612591db 100644 (file)
@@ -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),
index 85029b3d729fd2d16391b4b62741cece0c881daf..6a2733d7c9fc6a40075d8fea29e39e44e1c91d24 100644 (file)
@@ -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
        ));
index 0be919f3f1f3fe75664f3a44d2cd2629d97c11c2..9f94cd511b6e59d48f319fe2bef56fb4a71d8455 100644 (file)
@@ -407,3 +407,6 @@ function update_1042() {
 }
 
 
+function update_1043() {
+       q("ALTER TABLE `user` ADD `blockwall` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `blocked` ");
+}
index 675ef675f581b022941ebce27c1ab6d3404ebe0e..5f700ff8bd1ff7c3b4c7e142b490079e52b1ed94 100644 (file)
@@ -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>
 
index 39b18c12621e55bb67dde4155f841888d7921be4..45060e1c47c4dc410695894cbdb623f773150904 100644 (file)
@@ -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>
 
index eb386579f0b72aaa9c7af9655f3a9381861acd2a..e0334842a2241043dc72470284eed413a45d2c14 100644 (file)
@@ -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>
 
index 87f40f26fc57f42f22f10011d80980655a66f4e6..d1e25da81cb8ca8474bd9ff7ded92e09bc8aa977 100644 (file)
@@ -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>
 
index ea4e2e52c87a2d0123a915afa837ffb234f3f12c..d5b8d5b3f1ec97ec0f5bea05364d663b8f6d9a02 100644 (file)
@@ -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>
 
index 5db45921adda412dd8e1050aea52d819c6b3544b..e4fa1f9d7e0fb3b93c3866bee59ed4cfca8a9f02 100644 (file)
@@ -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,
index 0284bdcf866e76903e013fa057fbfb9b8bf67a88..030b878bfe2f9b7ee16157076e07fa4fb343d6ce 100644 (file)
@@ -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,