]> git.mxchange.org Git - friendica.git/blobdiff - mod/regmod.php
Merge pull request #3965 from tobiasd/20171126-docGettingStarted
[friendica.git] / mod / regmod.php
index 3c860120882fd0d54f071f9e48b9fa92bec00174..6d76e7ea7eb7f8814d892283ace04fa144782aac 100644 (file)
@@ -1,6 +1,10 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\Config;
+use Friendica\Core\System;
+use Friendica\Core\Worker;
+use Friendica\Database\DBM;
 
 require_once('include/enotify.php');
 require_once('include/user.php');
@@ -14,7 +18,7 @@ function user_allow($hash) {
        );
 
 
-       if (! dbm::is_result($register)) {
+       if (! DBM::is_result($register)) {
                return false;
        }
 
@@ -22,7 +26,7 @@ function user_allow($hash) {
                intval($register[0]['uid'])
        );
 
-       if (! dbm::is_result($user)) {
+       if (! DBM::is_result($user)) {
                killme();
        }
 
@@ -38,10 +42,10 @@ function user_allow($hash) {
        $r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
                intval($user[0]['uid'])
        );
-       if (dbm::is_result($r) && $r[0]['net-publish']) {
-               $url = App::get_baseurl() . '/profile/' . $user[0]['nickname'];
-               if ($url && strlen(get_config('system','directory'))) {
-                       proc_run(PRIORITY_LOW, "include/directory.php", $url);
+       if (DBM::is_result($r) && $r[0]['net-publish']) {
+               $url = System::baseUrl() . '/profile/' . $user[0]['nickname'];
+               if ($url && strlen(Config::get('system','directory'))) {
+                       Worker::add(PRIORITY_LOW, "Directory", $url);
                }
        }
 
@@ -50,7 +54,7 @@ function user_allow($hash) {
        send_register_open_eml(
                $user[0]['email'],
                $a->config['sitename'],
-               App::get_baseurl(),
+               System::baseUrl(),
                $user[0]['username'],
                $register[0]['password']);
 
@@ -74,7 +78,7 @@ function user_deny($hash) {
                dbesc($hash)
        );
 
-       if (!dbm::is_result($register)) {
+       if (!DBM::is_result($register)) {
                return false;
        }
 
@@ -118,13 +122,13 @@ function regmod_content(App $a) {
 
        if ($cmd === 'deny') {
                user_deny($hash);
-               goaway(App::get_baseurl()."/admin/users/");
+               goaway(System::baseUrl()."/admin/users/");
                killme();
        }
 
        if ($cmd === 'allow') {
                user_allow($hash);
-               goaway(App::get_baseurl()."/admin/users/");
+               goaway(System::baseUrl()."/admin/users/");
                killme();
        }
 }