diff options
author | Mario <mario@mariovavti.com> | 2024-03-24 09:58:21 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-24 09:58:21 +0000 |
commit | a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3 (patch) | |
tree | e156db21df2251b8c67e61453c8f4af9f9460d2f /Zotlabs/Module/Regdir.php | |
parent | ecdd9a4d6edd769a3e2c3b0604e4637d94fa1a51 (diff) | |
parent | 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 (diff) | |
download | volse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.tar.gz volse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.tar.bz2 volse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.zip |
Merge branch 'deprecate-include-config-in-core' into 'dev'
Deprecate *_config() functions in core.
See merge request hubzilla/core!2114
Diffstat (limited to 'Zotlabs/Module/Regdir.php')
-rw-r--r-- | Zotlabs/Module/Regdir.php | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/Zotlabs/Module/Regdir.php b/Zotlabs/Module/Regdir.php index e49f89231..70e021715 100644 --- a/Zotlabs/Module/Regdir.php +++ b/Zotlabs/Module/Regdir.php @@ -1,6 +1,7 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Config; use Zotlabs\Lib\Zotfinger; use Zotlabs\Web\Controller; @@ -13,55 +14,55 @@ use Zotlabs\Web\Controller; * We would then need a flag in the site table to indicate that they've been * validated by the PRIMARY directory for that realm. Sites claiming to be PRIMARY * but are not the realm PRIMARY will be marked invalid. - * + * * @param App &$a */ class Regdir extends Controller { function init() { - + $result = array('success' => false); - + $url = $_REQUEST['url']; $access_token = $_REQUEST['t']; $valid = 0; - + // we probably don't need the realm as we will find out in the probe. // What we may want to do is throw an error if you're trying to register in a different realm // so this configuration issue can be discovered. - + $realm = $_REQUEST['realm']; if(! $realm) $realm = DIRECTORY_REALM; - + if($realm === DIRECTORY_REALM) { $valid = 1; } else { - $token = get_config('system','realm_token'); + $token = Config::Get('system','realm_token'); if($token && $access_token != $token) { $result['message'] = 'This realm requires an access token'; return; } $valid = 1; } - - $dirmode = intval(get_config('system','directory_mode')); - + + $dirmode = intval(Config::Get('system','directory_mode')); + if ($dirmode == DIRECTORY_MODE_NORMAL) { $ret['message'] = t('This site is not a directory server'); json_return_and_die($ret); } - + $m = null; if ($url) { $m = parse_url($url); - + if ((! $m) || (! z_dns_check($m['host']))) { $result['message'] = 'unparseable url'; json_return_and_die($result); } - + $j = Zotfinger::exec($url); if($j) { $result['success'] = true; @@ -79,7 +80,7 @@ class Regdir extends Controller { } else { - + if ($dirmode == DIRECTORY_MODE_STANDALONE) { $r = array(array('site_url' => z_root())); } else { @@ -93,7 +94,7 @@ class Regdir extends Controller { $result['directories'] = array(); foreach ($r as $rr) $result['directories'][] = $rr['site_url']; - + json_return_and_die($result); } } |