appify oauth2

This commit is contained in:
zotlabs 2019-10-09 22:51:48 -07:00
parent d27f9676b8
commit 26109b9643
5 changed files with 43 additions and 4 deletions

View file

@ -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'),

View file

@ -0,0 +1,23 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Libsync;
use Zotlabs\Web\Controller;
class Clients extends Controller {
function get() {
$desc = t('This app allows you to authorize mobile apps using OAuth and OpenID to access your channel.');
if(! Apps::system_app_installed(local_channel(),'Clients')) {
return '<div class="section-content-info-wrapper">' . $desc . '</div>';
}
goaway(z_root() . '/settings/oauth2');
}
}

View file

@ -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(

View file

@ -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' : ''),
);

6
app/client.apd Normal file
View file

@ -0,0 +1,6 @@
version: 1
url: $baseurl/clients
requires: local_channel
name: Clients
photo: icon:ticket
categories: Networking