aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-04 00:52:34 -0800
committerfriendica <info@friendica.com>2014-02-04 00:52:34 -0800
commitd8f16442a1ca7d0be18dedd52c0f4eb339ba19b6 (patch)
tree60cff2d8d21741cbfc9093a467238af44c45c282
parent1572403e980b013e211de1d317631551dfe5f304 (diff)
downloadvolse-hubzilla-d8f16442a1ca7d0be18dedd52c0f4eb339ba19b6.tar.gz
volse-hubzilla-d8f16442a1ca7d0be18dedd52c0f4eb339ba19b6.tar.bz2
volse-hubzilla-d8f16442a1ca7d0be18dedd52c0f4eb339ba19b6.zip
bookmark permissions
-rwxr-xr-xboot.php3
-rw-r--r--include/permissions.php1
-rw-r--r--install/database.sql2
-rw-r--r--install/update.php10
-rw-r--r--mod/settings.php6
-rw-r--r--version.inc2
-rw-r--r--view/js/mod_connedit.js1
-rw-r--r--view/js/mod_settings.js4
8 files changed, 25 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index 18a4ff888..faae00273 100755
--- a/boot.php
+++ b/boot.php
@@ -46,7 +46,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1095 );
+define ( 'DB_UPDATE_VERSION', 1096 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -270,6 +270,7 @@ define ( 'PERMS_W_STORAGE', 0x02000);
define ( 'PERMS_R_PAGES', 0x04000);
define ( 'PERMS_W_PAGES', 0x08000);
define ( 'PERMS_A_REPUBLISH', 0x10000);
+define ( 'PERMS_A_BOOMARK', 0x20000);
// General channel permissions
diff --git a/include/permissions.php b/include/permissions.php
index 1b11dfb87..060ed841c 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -29,6 +29,7 @@ function get_perms() {
'write_pages' => array('channel_w_pages', intval(PERMS_W_PAGES), false, t('Can edit my "public" pages'), ''),
'republish' => array('channel_a_republish', intval(PERMS_A_REPUBLISH), false, t('Can source my "public" posts in derived channels'), t('Somewhat advanced - very useful in open communities')),
+ 'bookmark' => array('channel_a_bookmark', intval(PERMS_A_BOOKMARK), false, t('Can send me bookmarks'), ''),
'delegate' => array('channel_a_delegate', intval(PERMS_A_DELEGATE), false, t('Can administer my channel resources'), t('Extremely advanced. Leave this alone unless you know what you are doing')),
);
$ret = array('global_permissions' => $global_perms);
diff --git a/install/database.sql b/install/database.sql
index c89e4cef2..86531a415 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -177,6 +177,7 @@ CREATE TABLE IF NOT EXISTS `channel` (
`channel_r_pages` int(10) unsigned NOT NULL DEFAULT '128',
`channel_w_pages` int(10) unsigned NOT NULL DEFAULT '128',
`channel_a_republish` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_a_bookmark` int(10) unsigned NOT NULL DEFAULT '128',
PRIMARY KEY (`channel_id`),
UNIQUE KEY `channel_address_unique` (`channel_address`),
KEY `channel_account_id` (`channel_account_id`),
@@ -211,6 +212,7 @@ CREATE TABLE IF NOT EXISTS `channel` (
KEY `channel_w_pages` (`channel_w_pages`),
KEY `channel_deleted` (`channel_deleted`),
KEY `channel_a_republish` (`channel_a_republish`),
+ KEY `channel_a_bookmark` (`channel_a_bookmark`),
KEY `channel_dirdate` (`channel_dirdate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/install/update.php b/install/update.php
index e8b6d37f6..93442a81f 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1095 );
+define( 'UPDATE_VERSION' , 1096 );
/**
*
@@ -1069,3 +1069,11 @@ ADD INDEX ( `cr_expire` )");
return UPDATE_FAILED;
}
+function update_r1095() {
+ $r = q("ALTER TABLE `channel` ADD `channel_a_bookmark` INT UNSIGNED NOT NULL DEFAULT '128',
+ADD INDEX ( `channel_a_bookmark` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
diff --git a/mod/settings.php b/mod/settings.php
index 38b1d6fdf..7889538f3 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -306,6 +306,7 @@ function settings_post(&$a) {
$arr['channel_r_pages'] = (($_POST['view_pages']) ? $_POST['view_pages'] : 0);
$arr['channel_w_pages'] = (($_POST['write_pages']) ? $_POST['write_pages'] : 0);
$arr['channel_a_republish'] = (($_POST['republish']) ? $_POST['republish'] : 0);
+ $arr['channel_a_bookmark'] = (($_POST['bookmark']) ? $_POST['bookmark'] : 0);
$defperms = 0;
if(x($_POST['def_view_stream']))
@@ -342,6 +343,8 @@ function settings_post(&$a) {
$defperms += $_POST['def_write_pages'];
if(x($_POST['def_republish']))
$defperms += $_POST['def_republish'];
+ if(x($_POST['def_bookmark']))
+ $defperms += $_POST['def_bookmark'];
$notify = 0;
@@ -399,7 +402,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','hide_online_status',$hide_presence);
- $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d, channel_allow_cid = '%s', channel_allow_gid = '%s', channel_deny_cid = '%s', channel_deny_gid = '%s' where channel_id = %d limit 1",
+ $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d, channel_a_bookmark = %d, channel_allow_cid = '%s', channel_allow_gid = '%s', channel_deny_cid = '%s', channel_deny_gid = '%s' where channel_id = %d limit 1",
dbesc($username),
intval($pageflags),
dbesc($timezone),
@@ -426,6 +429,7 @@ function settings_post(&$a) {
intval($arr['channel_r_pages']),
intval($arr['channel_w_pages']),
intval($arr['channel_a_republish']),
+ intval($arr['channel_a_bookmark']),
dbesc($str_contact_allow),
dbesc($str_group_allow),
dbesc($str_contact_deny),
diff --git a/version.inc b/version.inc
index 09dce8eca..6140d2174 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-02-03.577
+2014-02-04.578
diff --git a/view/js/mod_connedit.js b/view/js/mod_connedit.js
index 51dbcf4bf..6bb39fb7a 100644
--- a/view/js/mod_connedit.js
+++ b/view/js/mod_connedit.js
@@ -17,6 +17,7 @@ function connectFullShare() {
$('#me_id_perms_chat').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_republish').attr('checked','checked');
+ $('#me_id_perms_bookmark').attr('checked','checked');
}
function connectCautiousShare() {
diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js
index 1c411113e..7ede7fb73 100644
--- a/view/js/mod_settings.js
+++ b/view/js/mod_settings.js
@@ -43,6 +43,7 @@ function channel_privacy_macro(n) {
$('#id_write_pages option').eq(0).attr('selected','selected');
$('#id_delegate option').eq(0).attr('selected','selected');
$('#id_republish option').eq(0).attr('selected','selected');
+ $('#id_bookmark option').eq(0).attr('selected','selected');
$('#id_profile_in_directory_onoff .off').removeClass('hidden');
$('#id_profile_in_directory_onoff .on').addClass('hidden');
$('#id_profile_in_directory').val(0);
@@ -65,6 +66,7 @@ function channel_privacy_macro(n) {
$('#id_write_pages option').eq(1).attr('selected','selected');
$('#id_delegate option').eq(0).attr('selected','selected');
$('#id_republish option').eq(0).attr('selected','selected');
+ $('#id_bookmark option').eq(0).attr('selected','selected');
$('#id_profile_in_directory_onoff .off').removeClass('hidden');
$('#id_profile_in_directory_onoff .on').addClass('hidden');
$('#id_profile_in_directory').val(0);
@@ -87,6 +89,7 @@ function channel_privacy_macro(n) {
$('#id_write_pages option').eq(0).attr('selected','selected');
$('#id_delegate option').eq(0).attr('selected','selected');
$('#id_republish option').eq(1).attr('selected','selected');
+ $('#id_bookmark option').eq(1).attr('selected','selected');
$('#id_profile_in_directory_onoff .on').removeClass('hidden');
$('#id_profile_in_directory_onoff .off').addClass('hidden');
$('#id_profile_in_directory').val(1);
@@ -109,6 +112,7 @@ function channel_privacy_macro(n) {
$('#id_write_pages option').eq(2).attr('selected','selected');
$('#id_delegate option').eq(0).attr('selected','selected');
$('#id_republish option').eq(4).attr('selected','selected');
+ $('#id_bookmark option').eq(4).attr('selected','selected');
$('#id_profile_in_directory_onoff .on').removeClass('hidden');
$('#id_profile_in_directory_onoff .off').addClass('hidden');
$('#id_profile_in_directory').val(1);