]> git.mxchange.org Git - friendica.git/commitdiff
Update function calls to use Model\User and Object\Contact
authorHypolite Petovan <mrpetovan@gmail.com>
Mon, 4 Dec 2017 03:29:06 +0000 (22:29 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Mon, 4 Dec 2017 03:29:06 +0000 (22:29 -0500)
mod/admin.php
mod/register.php
mod/regmod.php
src/Worker/CronJobs.php

index d73ac23fd0ef9fb954b095622d8e00519164b1c7..1b6975ab899f7544ca145cb9596d6087a28ba03f 100644 (file)
@@ -1466,9 +1466,7 @@ function admin_page_users_post(App $a)
        check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
 
        if (!($nu_name === "") && !($nu_email === "") && !($nu_nickname === "")) {
-               require_once 'include/user.php';
-
-               $result = create_user(array('username' => $nu_name, 'email' => $nu_email,
+               $result = User::create(array('username' => $nu_name, 'email' => $nu_email,
                        'nickname' => $nu_nickname, 'verified' => 1, 'language' => $nu_language));
                if (!$result['success']) {
                        notice($result['message']);
index 8645ecb9ce28b5904aef55049dc4e90a9019aa93..4f6dedd24bc7293fcd911b7bc60d06a5c1f817dc 100644 (file)
@@ -5,8 +5,8 @@ use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
+use Friendica\Model\User;
 
-require_once('include/user.php');
 require_once 'include/enotify.php';
 require_once 'include/bbcode.php';
 
@@ -61,7 +61,7 @@ function register_post(App $a) {
        $arr['verified'] = $verified;
        $arr['language'] = get_browser_language();
 
-       $result = create_user($arr);
+       $result = User::create($arr);
 
        if(! $result['success']) {
                notice($result['message']);
@@ -89,7 +89,7 @@ function register_post(App $a) {
 
                // Only send a password mail when the password wasn't manually provided
                if (!x($_POST,'password1') || !x($_POST,'confirm')) {
-                       $res = send_register_open_eml(
+                       $res = User::sendRegisterOpenEmail(
                                $user['email'],
                                $a->config['sitename'],
                                System::baseUrl(),
@@ -159,7 +159,7 @@ function register_post(App $a) {
                        ));
                }
                // send notification to the user, that the registration is pending
-               send_register_pending_eml(
+               User::sendRegisterPendingEmail(
                                $user['email'],
                                $a->config['sitename'],
                                $user['username']);
index 7fce6914f2f17ae5f94a34f96783a968d3148291..2c5d61059ac9aaf25411e195ec70399e37a928cd 100644 (file)
@@ -6,8 +6,6 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 
-require_once('include/user.php');
-
 require_once 'include/enotify.php';
 
 function user_allow($hash)
@@ -52,7 +50,7 @@ function user_allow($hash)
 
        push_lang($register[0]['language']);
 
-       send_register_open_eml(
+       User::sendRegisterOpenEmail(
                $user[0]['email'],
                $a->config['sitename'],
                System::baseUrl(),
index a59cd4f9f1b6e1970370efd45023fe51912d5e07..7df7d030cbd15da10c656e77d946139bb0dcd4b7 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\Config;
 use Friendica\Database\DBM;
 use Friendica\Model\GlobalContact;
 use Friendica\Network\Probe;
+use Friendica\Object\Contact;
 use Friendica\Protocol\PortableContact;
 use dba;
 
@@ -263,8 +264,8 @@ class CronJobs
                $r = q("SELECT `uid` FROM `user` WHERE NOT EXISTS (SELECT `uid` FROM `contact` WHERE `contact`.`uid` = `user`.`uid` AND `contact`.`self`)");
                if (DBM::is_result($r)) {
                        foreach ($r AS $user) {
-                               user_create_self_contact($user['uid']);
                                logger('Create missing self contact for user ' . $user['uid']);
+                               Contact::createSelfFromUserId($user['uid']);
                        }
                }