aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Apps.php2
-rw-r--r--Zotlabs/Module/New_channel.php20
-rw-r--r--Zotlabs/Module/Oauthinfo.php23
-rw-r--r--Zotlabs/Module/Well_known.php10
4 files changed, 51 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 24cb4a626..2dded1aaa 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -45,6 +45,8 @@ class Apps {
}
}
+ call_hooks('get_system_apps',$ret);
+
return $ret;
}
diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php
index c946961bc..97a46a43e 100644
--- a/Zotlabs/Module/New_channel.php
+++ b/Zotlabs/Module/New_channel.php
@@ -41,7 +41,7 @@ class New_channel extends \Zotlabs\Web\Controller {
$test[] = legal_webbie($x);
// fullname plus random number
$test[] = legal_webbie($x) . mt_rand(1000,9999);
-
+
json_return_and_die(check_webbie($test));
}
@@ -49,7 +49,10 @@ class New_channel extends \Zotlabs\Web\Controller {
require_once('library/urlify/URLify.php');
$result = array('error' => false, 'message' => '');
$n = trim($_REQUEST['nick']);
-
+ if(! $n) {
+ $n = trim($_REQUEST['name']);
+ }
+
$x = false;
if(get_config('system','unicode_usernames')) {
@@ -58,9 +61,20 @@ class New_channel extends \Zotlabs\Web\Controller {
if((! $x) || strlen($x) > 64)
$x = strtolower(\URLify::transliterate($n));
-
+
+
$test = array();
+ // first name
+ if(strpos($x,' '))
+ $test[] = legal_webbie(substr($x,0,strpos($x,' ')));
+ if($test[0]) {
+ // first name plus first initial of last
+ $test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
+ // first name plus random number
+ $test[] = $test[0] . mt_rand(1000,9999);
+ }
+
$n = legal_webbie($x);
if(strlen($n)) {
$test[] = $n;
diff --git a/Zotlabs/Module/Oauthinfo.php b/Zotlabs/Module/Oauthinfo.php
new file mode 100644
index 000000000..2d10913c4
--- /dev/null
+++ b/Zotlabs/Module/Oauthinfo.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Zotlabs\Module;
+
+
+class Oauthinfo extends \Zotlabs\Web\Controller {
+
+
+ function init() {
+
+ $ret = [
+ 'issuer' => z_root(),
+ 'authorization_endpoint' => z_root() . '/authorize',
+ 'token_endpoint' => z_root() . '/token',
+ 'response_types_supported' => [ 'code', 'token', 'id_token', 'code id_token', 'token id_token' ]
+ ];
+
+
+ json_return_and_die($ret);
+ }
+
+
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Well_known.php b/Zotlabs/Module/Well_known.php
index 177de2323..442994b54 100644
--- a/Zotlabs/Module/Well_known.php
+++ b/Zotlabs/Module/Well_known.php
@@ -50,7 +50,15 @@ class Well_known extends \Zotlabs\Web\Controller {
$module = new \Zotlabs\Module\Hostxrd();
$module->init();
break;
-
+
+ case 'oauth-authorization-server':
+ \App::$argc -= 1;
+ array_shift(\App::$argv);
+ \App::$argv[0] = 'oauthinfo';
+ $module = new \Zotlabs\Module\Oauthinfo();
+ $module->init();
+ break;
+
case 'dnt-policy.txt':
echo file_get_contents('doc/dnt-policy.txt');
killme();