From 6e6b268e2523d95624361d29a8bd80b1133aa627 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 23 Jan 2013 21:15:40 -0800 Subject: auto permissions (such as for forums or whatever) - untested but might just work --- mod/settings.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'mod/settings.php') diff --git a/mod/settings.php b/mod/settings.php index d75fe3043..c1380e159 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -14,16 +14,29 @@ function get_theme_config_file($theme){ return null; } -function settings_init(&$a) { +function settings_aside(&$a) { // default is channel settings in the absence of other arguments if(argc() == 1) { + // We are setting these values - don't use the argc(), argv() functions here $a->argc = 2; $a->argv[] = 'channel'; } + $abook_self_id = 0; + + // Retrieve the 'self' address book entry for use in the auto-permissions link + if(local_user()) { + $abk = q("select abook_id from abook where abook_channel = %d and ( abook_flags & %d ) limit 1", + intval(local_user()), + intval(ABOOK_FLAG_SELF) + ); + if($abk) + $abook_self_id = $abk[0]['abook_id']; + } + $tabs = array( array( @@ -74,6 +87,12 @@ function settings_init(&$a) { // 'selected' => '' // ), + array( + 'label' => t('Automatic Permissions (Advanced)'), + 'url' => $a->get_baseurl(true) . '/connections/' . $abook_self_id, + 'selected' => '' + ), + ); -- cgit v1.2.3