aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-01 19:47:10 -0700
committerfriendica <info@friendica.com>2012-11-01 19:47:10 -0700
commit3bf5677797a6a40dacac2ddcbe9271aea508e421 (patch)
treefa7e37883391fa81af4bfe5601cfaeca15aac39e /mod
parent1021a4d4763974c3c40f40a0ca9682f1fcc3f6ee (diff)
downloadvolse-hubzilla-3bf5677797a6a40dacac2ddcbe9271aea508e421.tar.gz
volse-hubzilla-3bf5677797a6a40dacac2ddcbe9271aea508e421.tar.bz2
volse-hubzilla-3bf5677797a6a40dacac2ddcbe9271aea508e421.zip
settings page channel permissions front-end (needs back-end still)
Diffstat (limited to 'mod')
-rw-r--r--mod/manage.php2
-rw-r--r--mod/new_channel.php3
-rw-r--r--mod/settings.php44
3 files changed, 47 insertions, 2 deletions
diff --git a/mod/manage.php b/mod/manage.php
index ac4454567..040857f5e 100644
--- a/mod/manage.php
+++ b/mod/manage.php
@@ -33,7 +33,7 @@ function manage_content(&$a) {
$channels = null;
if(local_user()) {
- $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel.channel_account_id = %d ",
+ $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel.channel_account_id = %d order by channel_name ",
intval(get_account_id())
);
diff --git a/mod/new_channel.php b/mod/new_channel.php
index e815b2a73..4067d84d3 100644
--- a/mod/new_channel.php
+++ b/mod/new_channel.php
@@ -17,7 +17,8 @@ function new_channel_init(&$a) {
$test = array();
// first name
- $test[] = legal_webbie(substr($x,0,strpos($x,' ')));
+ if(strpos($x,' '))
+ $test[] = legal_webbie(substr($x,0,strpos($x,' ')));
if($test[0]) {
// first name plus first initial of last
$test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
diff --git a/mod/settings.php b/mod/settings.php
index a9f625056..5cf820005 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -660,6 +660,10 @@ function settings_content(&$a) {
if(argv(1) === 'channel') {
require_once('include/acl_selectors.php');
+ require_once('include/permissions.php');
+
+
+
$p = q("SELECT * FROM `profile` WHERE `is_default` = 1 AND `uid` = %d LIMIT 1",
intval(local_user())
@@ -671,6 +675,40 @@ function settings_content(&$a) {
$channel = $a->get_channel();
+
+ global $global_perms;
+
+ $perms = perms_text();
+ $permiss = array();
+
+ $perm_cats = array(
+ array( t('Only those you allow'), PERMS_SPECIFIC),
+ array( t('Anybody in your address book'), PERMS_CONTACTS),
+ array( t('Anybody on this hub/website'), PERMS_SITE),
+ array( t('Anybody in the network'), PERMS_NETWORK),
+ array( t('Anybody'), PERMS_PUBLIC)
+ );
+
+
+ foreach($perms as $k => $perm) {
+
+ $permiss[$k] = array(
+ 'key' => $k,
+ 'label' => $perm,
+ 'fields' => array()
+ );
+ $column = $global_perms[$k][0];
+ foreach($perm_cats as $cat) {
+ $permiss[$k]['fields'][] = array( $column, $cat[0], $cat[1], '', (($channel[$column] == $cat[1]) ? '1' : ''));
+ }
+
+ }
+
+
+logger('permiss: ' . print_r($permiss,true));
+
+
+
$username = $channel['channel_name'];
$email = $a->account['account_email'];
$nickname = $channel['channel_address'];
@@ -819,6 +857,10 @@ function settings_content(&$a) {
'network_only' => array('expire_network_only', t("Only expire posts by others:"), $expire_network_only, '', array(t('No'),t('Yes'))),
);
+
+
+
+
require_once('include/group.php');
$group_select = mini_group_select(local_user(),$a->user['def_gid']);
@@ -845,6 +887,8 @@ function settings_content(&$a) {
'$h_prv' => t('Security and Privacy Settings'),
+ '$permiss_arr' => $permiss,
+
'$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), $maxreq ,t("\x28to prevent spam abuse\x29")),
'$permissions' => t('Default Post Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),