use Friendica\Core\Addon;
use Friendica\Core\Config;
-use Friendica\Core\PConfig;
use Friendica\Core\L10n;
+use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Photo;
use Friendica\Object\Image;
use Friendica\Util\Crypto;
+use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use dba;
use Exception;
+use LightOpenID;
require_once 'boot.php';
require_once 'include/dba.php';
require_once 'include/enotify.php';
-require_once 'library/openid.php';
require_once 'include/text.php';
/**
* @brief This class handles User related functions
if (!x($username) || !x($email) || !x($nickname)) {
if ($openid_url) {
- if (!Network::validateURL($openid_url)) {
+ if (!Network::isUrlValid($openid_url)) {
throw new Exception(L10n::t('Invalid OpenID url'));
}
$_SESSION['register'] = 1;
$_SESSION['openid'] = $openid_url;
- $openid = new \LightOpenID;
+ $openid = new LightOpenID;
$openid->identity = $openid_url;
$openid->returnUrl = System::baseUrl() . '/openid';
$openid->required = ['namePerson/friendly', 'contact/email', 'namePerson'];
throw new Exception(L10n::t('Please enter the required information.'));
}
- if (!Network::validateURL($openid_url)) {
+ if (!Network::isUrlValid($openid_url)) {
$openid_url = '';
}
}
}
- if (!Network::allowedEmail($email)) {
+ if (!Network::isEmailDomainAllowed($email)) {
throw new Exception(L10n::t('Your email domain is not among those allowed on this site.'));
}
- if (!valid_email($email) || !Network::validateEmail($email)) {
+ if (!valid_email($email) || !Network::isEmailDomainValid($email)) {
throw new Exception(L10n::t('Not a valid email address.'));
}
'verified' => $verified,
'blocked' => $blocked,
'timezone' => 'UTC',
- 'register_date' => datetime_convert(),
+ 'register_date' => DateTimeFormat::utcNow(),
'default-location' => ''
]);
// if we have no OpenID photo try to look up an avatar
if (!strlen($photo)) {
- $photo = Network::avatarImg($email);
+ $photo = Network::lookupAvatarByEmail($email);
}
// unless there is no avatar-addon loaded
$photo_failure = false;
$filename = basename($photo);
- $img_str = Network::fetchURL($photo, true);
+ $img_str = Network::fetchUrl($photo, true);
// guess mimetype from headers or filename
$type = Image::guessType($photo, true);
dba::insert('userd', ['username' => $user['nickname']]);
// The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
- dba::update('user', ['account_removed' => true, 'account_expires_on' => datetime_convert()], ['uid' => $uid]);
+ dba::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utcNow()], ['uid' => $uid]);
Worker::add(PRIORITY_HIGH, "Notifier", "removeme", $uid);
// Send an update to the directory