diff options
-rw-r--r-- | Zotlabs/Module/Permcats.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Tokens.php (renamed from Zotlabs/Module/Settings/Tokens.php) | 36 | ||||
-rw-r--r-- | Zotlabs/Widget/Settings_menu.php | 8 | ||||
-rw-r--r-- | app/tokens.apd | 6 | ||||
-rw-r--r-- | include/features.php | 15 | ||||
-rw-r--r-- | view/tpl/tokens.tpl (renamed from view/tpl/settings_tokens.tpl) | 6 |
6 files changed, 38 insertions, 37 deletions
diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php index 97090067b..3d068862a 100644 --- a/Zotlabs/Module/Permcats.php +++ b/Zotlabs/Module/Permcats.php @@ -14,8 +14,7 @@ class Permcats extends Controller { return; if(! Apps::system_app_installed(local_channel(), 'Permission Categories')) - return - + return; $channel = App::get_channel(); @@ -67,7 +66,6 @@ class Permcats extends Controller { $channel = App::get_channel(); - if(argc() > 1) $name = hex2bin(argv(1)); diff --git a/Zotlabs/Module/Settings/Tokens.php b/Zotlabs/Module/Tokens.php index e59cf8d1c..a791d3f63 100644 --- a/Zotlabs/Module/Settings/Tokens.php +++ b/Zotlabs/Module/Tokens.php @@ -1,16 +1,24 @@ <?php -namespace Zotlabs\Module\Settings; +namespace Zotlabs\Module; +use App; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\Apps; - -class Tokens { +class Tokens extends Controller { function post() { - $channel = \App::get_channel(); + if(! local_channel()) + return; + + if(! Apps::system_app_installed(local_channel(), 'Guest Access')) + return; + + $channel = App::get_channel(); - check_form_security_token_redirectOnErr('/settings/tokens', 'settings_tokens'); + check_form_security_token_redirectOnErr('tokens', 'tokens'); $token_errs = 0; if(array_key_exists('token',$_POST)) { $atoken_id = (($_POST['atoken_id']) ? intval($_POST['atoken_id']) : 0); @@ -81,7 +89,19 @@ class Tokens { function get() { - $channel = \App::get_channel(); + if(! local_channel()) + return; + + if(! Apps::system_app_installed(local_channel(), 'Guest Access')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Guest Access App (Not Installed):</b><br>'; + $o .= t('Create access tokens so that non-members can access private content'); + return $o; + } + + $channel = App::get_channel(); $atoken = null; $atoken_xchan = ''; @@ -144,9 +164,9 @@ class Tokens { - $tpl = get_markup_template("settings_tokens.tpl"); + $tpl = get_markup_template("tokens.tpl"); $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_tokens"), + '$form_security_token' => get_form_security_token("tokens"), '$title' => t('Guest Access Tokens'), '$desc' => $desc, '$desc2' => $desc2, diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 781f3b145..ecf93ec78 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -79,14 +79,6 @@ class Settings_menu { 'selected' => '' ); - if(feature_enabled(local_channel(),'access_tokens')) { - $tabs[] = array( - 'label' => t('Guest Access Tokens'), - 'url' => z_root() . '/settings/tokens', - 'selected' => ((argv(1) === 'tokens') ? 'active' : ''), - ); - } - if($role === false || $role === 'custom') { $tabs[] = array( 'label' => t('Connection Default Permissions'), diff --git a/app/tokens.apd b/app/tokens.apd new file mode 100644 index 000000000..6cb66cbd7 --- /dev/null +++ b/app/tokens.apd @@ -0,0 +1,6 @@ +version: 1 +url: $baseurl/tokens +requires: local_channel +name: Guest Access +photo: icon:user-secret +categories: Access Control diff --git a/include/features.php b/include/features.php index a264ae289..8dcf4517d 100644 --- a/include/features.php +++ b/include/features.php @@ -71,21 +71,6 @@ function get_features($filtered = true, $level = (-1)) { $arr = [ - 'access_control' => [ - t('Access Control and Permissions'), - - [ - 'access_tokens', - t('Access Tokens'), - t('Create access tokens so that non-members can access private content.'), - false, - get_config('feature_lock','access_tokens'), - feature_level('access_tokens',2), - ], - - ], - - // Item tools 'tools' => [ diff --git a/view/tpl/settings_tokens.tpl b/view/tpl/tokens.tpl index 48190c00c..ccb1f8c61 100644 --- a/view/tpl/settings_tokens.tpl +++ b/view/tpl/tokens.tpl @@ -8,7 +8,7 @@ {{$desc}} </div> - <form action="settings/tokens" id="settings-account-form" method="post" autocomplete="off" > + <form action="tokens" id="settings-account-form" method="post" autocomplete="off" > <input type='hidden' name='form_security_token' value='{{$form_security_token}}'> {{if $atoken}}<input type="hidden" name="atoken_id" value="{{$atoken.atoken_id}}" />{{/if}} {{include file="field_input.tpl" field=$name}} @@ -61,8 +61,8 @@ <table id="atoken-index"> {{foreach $tokens as $t}} <tr id="atoken-index-{{$t.atoken_id}}" class="atoken-index-row"> - <td width="99%"><a href="settings/tokens/{{$t.atoken_id}}">{{$t.atoken_name}}</a></td> - <td width="1%" class="atoken-index-tool"><i class="fa fa-trash-o drop-icons" onClick="dropItem('/settings/tokens/{{$t.atoken_id}}/drop', '#atoken-index-{{$t.atoken_id}}')"></i></td> + <td width="99%"><a href="tokens/{{$t.atoken_id}}">{{$t.atoken_name}}</a></td> + <td width="1%" class="atoken-index-tool"><i class="fa fa-trash-o drop-icons" onClick="dropItem('tokens/{{$t.atoken_id}}/drop', '#atoken-index-{{$t.atoken_id}}')"></i></td> </tr> {{/foreach}} </table> |