mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:35:19 +00:00
appify oauth2
This commit is contained in:
parent
d27f9676b8
commit
26109b9643
5 changed files with 43 additions and 4 deletions
|
@ -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'),
|
||||
|
|
23
Zotlabs/Module/Clients.php
Normal file
23
Zotlabs/Module/Clients.php
Normal 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');
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Module\Settings;
|
||||
|
||||
use Zotlabs\Lib\Apps;
|
||||
|
||||
|
||||
class Oauth2 {
|
||||
|
||||
|
@ -91,6 +93,10 @@ 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(
|
||||
|
|
|
@ -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
6
app/client.apd
Normal file
|
@ -0,0 +1,6 @@
|
|||
version: 1
|
||||
url: $baseurl/clients
|
||||
requires: local_channel
|
||||
name: Clients
|
||||
photo: icon:ticket
|
||||
categories: Networking
|
Loading…
Reference in a new issue