From 26109b96431c5c37df12c8f065cd32d9c44d4e07 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 9 Oct 2019 22:51:48 -0700 Subject: [PATCH] appify oauth2 --- Zotlabs/Lib/Apps.php | 1 + Zotlabs/Module/Clients.php | 23 +++++++++++++++++++++++ Zotlabs/Module/Settings/Oauth2.php | 8 +++++++- Zotlabs/Widget/Settings_menu.php | 9 ++++++--- app/client.apd | 6 ++++++ 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 Zotlabs/Module/Clients.php create mode 100644 app/client.apd diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index dfe408e76..be65fe254 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -318,6 +318,7 @@ class Apps { 'Cards' => t('Cards'), 'Calendar' => t('Calendar'), 'Categories' => t('Categories'), + 'Clients' => t('Clients'), 'Admin' => t('Site Admin'), 'Content Filter' => t('Content Filter'), 'Content Import' => t('Content Import'), diff --git a/Zotlabs/Module/Clients.php b/Zotlabs/Module/Clients.php new file mode 100644 index 000000000..7cf8facd4 --- /dev/null +++ b/Zotlabs/Module/Clients.php @@ -0,0 +1,23 @@ +' . $desc . ''; + } + goaway(z_root() . '/settings/oauth2'); + } + + +} diff --git a/Zotlabs/Module/Settings/Oauth2.php b/Zotlabs/Module/Settings/Oauth2.php index 82fc24aef..1c8a10994 100644 --- a/Zotlabs/Module/Settings/Oauth2.php +++ b/Zotlabs/Module/Settings/Oauth2.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Apps; + class Oauth2 { @@ -90,7 +92,11 @@ logger('redirect: ' . $redirect); } function get() { - + + if(! Apps::system_app_installed(local_channel(),'Clients')) { + return; + } + if((argc() > 2) && (argv(2) === 'add')) { $tpl = get_markup_template("settings_oauth2_edit.tpl"); $o .= replace_macros($tpl, array( diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 10580af2d..fe09a1111 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -2,6 +2,9 @@ namespace Zotlabs\Widget; +use App; +use Zotlabs\Lib\Apps; + class Settings_menu { function widget($arr) { @@ -10,7 +13,7 @@ class Settings_menu { return; - $channel = \App::get_channel(); + $channel = App::get_channel(); $abook_self_id = 0; @@ -73,9 +76,9 @@ class Settings_menu { ); } - if(feature_enabled(local_channel(),'oauth2_clients')) { + if(Apps::system_app_installed(local_channel(),'Clients')) { $tabs[] = array( - 'label' => t('OAuth2 apps'), + 'label' => t('Client apps'), 'url' => z_root() . '/settings/oauth2', 'selected' => ((argv(1) === 'oauth2') ? 'active' : ''), ); diff --git a/app/client.apd b/app/client.apd new file mode 100644 index 000000000..6ca7eaa8e --- /dev/null +++ b/app/client.apd @@ -0,0 +1,6 @@ +version: 1 +url: $baseurl/clients +requires: local_channel +name: Clients +photo: icon:ticket +categories: Networking