Merge pull request #632 from beardy-unixer/master

Add support for members-only apps menu
This commit is contained in:
friendica 2013-02-27 16:51:56 -08:00
commit 90a596339d
5 changed files with 18 additions and 11 deletions

View File

@ -256,6 +256,7 @@ function admin_page_site_post(&$a){
$thread_allow = ((x($_POST,'thread_allow')) ? True : False); $thread_allow = ((x($_POST,'thread_allow')) ? True : False);
$newuser_private = ((x($_POST,'newuser_private')) ? True : False); $newuser_private = ((x($_POST,'newuser_private')) ? True : False);
$enotify_no_content = ((x($_POST,'enotify_no_content')) ? True : False); $enotify_no_content = ((x($_POST,'enotify_no_content')) ? True : False);
$private_addons = ((x($_POST,'private_addons')) ? True : False);
$no_multi_reg = ((x($_POST,'no_multi_reg')) ? True : False); $no_multi_reg = ((x($_POST,'no_multi_reg')) ? True : False);
$no_openid = !((x($_POST,'no_openid')) ? True : False); $no_openid = !((x($_POST,'no_openid')) ? True : False);
@ -283,7 +284,6 @@ function admin_page_site_post(&$a){
$temppath = ((x($_POST,'temppath')) ? notags(trim($_POST['temppath'])) : ''); $temppath = ((x($_POST,'temppath')) ? notags(trim($_POST['temppath'])) : '');
$basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : ''); $basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : '');
$singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : ''); $singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : '');
if($ssl_policy != intval(get_config('system','ssl_policy'))) { if($ssl_policy != intval(get_config('system','ssl_policy'))) {
if($ssl_policy == SSL_POLICY_FULL) { if($ssl_policy == SSL_POLICY_FULL) {
q("update `contact` set q("update `contact` set
@ -387,6 +387,7 @@ function admin_page_site_post(&$a){
set_config('system','dfrn_only', $dfrn_only); set_config('system','dfrn_only', $dfrn_only);
set_config('system','ostatus_disabled', $ostatus_disabled); set_config('system','ostatus_disabled', $ostatus_disabled);
set_config('system','diaspora_enabled', $diaspora_enabled); set_config('system','diaspora_enabled', $diaspora_enabled);
set_config('config','private_addons', $private_addons);
set_config('system','new_share', $new_share); set_config('system','new_share', $new_share);
set_config('system','hide_help', $hide_help); set_config('system','hide_help', $hide_help);
@ -397,7 +398,6 @@ function admin_page_site_post(&$a){
set_config('system','temppath', $temppath); set_config('system','temppath', $temppath);
set_config('system','basepath', $basepath); set_config('system','basepath', $basepath);
info( t('Site settings updated.') . EOL); info( t('Site settings updated.') . EOL);
goaway($a->get_baseurl(true) . '/admin/site' ); goaway($a->get_baseurl(true) . '/admin/site' );
return; // NOTREACHED return; // NOTREACHED
@ -509,6 +509,7 @@ function admin_page_site(&$a) {
'$thread_allow' => array('thread_allow', t("Allow threaded items"), get_config('system','thread_allow'), t("Allow infinite level threading for items on this site.")), '$thread_allow' => array('thread_allow', t("Allow threaded items"), get_config('system','thread_allow'), t("Allow infinite level threading for items on this site.")),
'$newuser_private' => array('newuser_private', t("Private posts by default for new users"), get_config('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")), '$newuser_private' => array('newuser_private', t("Private posts by default for new users"), get_config('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")),
'$enotify_no_content' => array('enotify_no_content', t("Don't include post content in email notifications"), get_config('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")), '$enotify_no_content' => array('enotify_no_content', t("Don't include post content in email notifications"), get_config('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")),
'$private_addons' => array('private_addons', t("Disallow public access to addons listed in the apps menu."), get_config('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")),
'$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")), '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")),
'$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")), '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")),
@ -532,7 +533,6 @@ function admin_page_site(&$a) {
'$lockpath' => array('lockpath', t("Path for lock file"), get_config('system','lockpath'), "The lock file is used to avoid multiple pollers at one time. Only define a folder here."), '$lockpath' => array('lockpath', t("Path for lock file"), get_config('system','lockpath'), "The lock file is used to avoid multiple pollers at one time. Only define a folder here."),
'$temppath' => array('temppath', t("Temp path"), get_config('system','temppath'), "If you have a restricted system where the webserver can't access the system temp path, enter another path here."), '$temppath' => array('temppath', t("Temp path"), get_config('system','temppath'), "If you have a restricted system where the webserver can't access the system temp path, enter another path here."),
'$basepath' => array('basepath', t("Base path to installation"), get_config('system','basepath'), "If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."), '$basepath' => array('basepath', t("Base path to installation"), get_config('system','basepath'), "If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
'$form_security_token' => get_form_security_token("admin_site"), '$form_security_token' => get_form_security_token("admin_site"),
)); ));

View File

@ -1,7 +1,14 @@
<?php <?php
function apps_content(&$a) { function apps_content(&$a) {
$title = t('Applications'); $privateaddons = get_config('config','private_addons');
if ($privateaddons === "1") {
if((! (local_user()))) {
info( t("You must be logged in to use addons. "));
return;};
}
$title = t('Applications');
if(count($a->apps)==0) if(count($a->apps)==0)
notice( t('No installed applications.') . EOL); notice( t('No installed applications.') . EOL);

View File

@ -85,7 +85,7 @@
{{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$newuser_private }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$enotify_no_content }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$enotify_no_content }}{{ endinc }}
{{ inc field_checkbox.tpl with $field=$private_addons }}{{ endinc }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div> <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
<h3>$advanced</h3> <h3>$advanced</h3>

View File

@ -90,7 +90,7 @@
{{include file="field_checkbox.tpl" field=$thread_allow}} {{include file="field_checkbox.tpl" field=$thread_allow}}
{{include file="field_checkbox.tpl" field=$newuser_private}} {{include file="field_checkbox.tpl" field=$newuser_private}}
{{include file="field_checkbox.tpl" field=$enotify_no_content}} {{include file="field_checkbox.tpl" field=$enotify_no_content}}
{{include file="field_checkbox.tpl" field=$private_addons}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div> <div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
<h3>{{$advanced}}</h3> <h3>{{$advanced}}</h3>

View File

@ -75,7 +75,7 @@
<td class='register_date'>{{$u.register_date}}</td> <td class='register_date'>{{$u.register_date}}</td>
<td class='login_date'>{{$u.login_date}}</td> <td class='login_date'>{{$u.login_date}}</td>
<td class='lastitem_date'>{{$u.lastitem_date}}</td> <td class='lastitem_date'>{{$u.lastitem_date}}</td>
<td class='login_date'>{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.accountexpired}}{{$account_expired}}{{/if}}</td> <td class='login_date'>{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}</td>
<td class="checkbox"> <td class="checkbox">
{{if $u.is_admin}} {{if $u.is_admin}}
&nbsp; &nbsp;