]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User.php
Merge pull request #4192 from zeroadam/Follow-#3878
[friendica.git] / src / Model / User.php
index f487de7661821b72af445d27b676935d342cf652..c6d6c044d5ca65ccbb0dfb85d26cd52ccb0f9e21 100644 (file)
@@ -16,11 +16,11 @@ use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\Photo;
 use Friendica\Object\Image;
+use Friendica\Util\Crypto;
 use dba;
 use Exception;
 
 require_once 'boot.php';
-require_once 'include/crypto.php';
 require_once 'include/dba.php';
 require_once 'include/enotify.php';
 require_once 'include/network.php';
@@ -198,8 +198,6 @@ class User
                        $password = $password1;
                }
 
-               $tmp_str = $openid_url;
-
                if ($using_invites) {
                        if (!$invite_id) {
                                throw new Exception(t('An invitation is required.'));
@@ -212,7 +210,7 @@ class User
 
                if (!x($username) || !x($email) || !x($nickname)) {
                        if ($openid_url) {
-                               if (!validate_url($tmp_str)) {
+                               if (!validate_url($openid_url)) {
                                        throw new Exception(t('Invalid OpenID url'));
                                }
                                $_SESSION['register'] = 1;
@@ -235,7 +233,7 @@ class User
                        throw new Exception(t('Please enter the required information.'));
                }
 
-               if (!validate_url($tmp_str)) {
+               if (!validate_url($openid_url)) {
                        $openid_url = '';
                }
 
@@ -299,7 +297,7 @@ class User
 
                $return['password'] = $new_password;
 
-               $keys = new_keypair(4096);
+               $keys = Crypto::newKeypair(4096);
                if ($keys === false) {
                        throw new Exception(t('SERIOUS ERROR: Generation of security keys failed.'));
                }
@@ -308,7 +306,7 @@ class User
                $pubkey = $keys['pubkey'];
 
                // Create another keypair for signing/verifying salmon protocol messages.
-               $sres = new_keypair(512);
+               $sres = Crypto::newKeypair(512);
                $sprvkey = $sres['prvkey'];
                $spubkey = $sres['pubkey'];