aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-09-26 22:24:36 +0200
committerMario Vavti <mario@mariovavti.com>2018-09-26 22:24:36 +0200
commite3c04b1fd0f441e0042e218f47696b1bfad26c73 (patch)
tree0ab92edb30c9f0cb89dfe962350b4667c6e7db5f /Zotlabs
parenta7948d7bfee1c0c8c9f1a731aabdc636c280bff0 (diff)
downloadvolse-hubzilla-e3c04b1fd0f441e0042e218f47696b1bfad26c73.tar.gz
volse-hubzilla-e3c04b1fd0f441e0042e218f47696b1bfad26c73.tar.bz2
volse-hubzilla-e3c04b1fd0f441e0042e218f47696b1bfad26c73.zip
guest access app
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Permcats.php4
-rw-r--r--Zotlabs/Module/Tokens.php (renamed from Zotlabs/Module/Settings/Tokens.php)36
-rw-r--r--Zotlabs/Widget/Settings_menu.php8
3 files changed, 29 insertions, 19 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'),