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 'include/network.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 (!validate_url($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 (!validate_url($openid_url)) {
+ if (!Network::isUrlValid($openid_url)) {
$openid_url = '';
}
}
}
- if (!allowed_email($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) || !validate_email($email)) {
+ if (!valid_email($email) || !Network::isEmailDomainValid($email)) {
throw new Exception(L10n::t('Not a valid email address.'));
}
$nickname = $data['nickname'] = strtolower($nickname);
if (!preg_match('/^[a-z0-9][a-z0-9\_]*$/', $nickname)) {
- throw new Exception(L10n::t('Your "nickname" can only contain "a-z", "0-9" and "_".'));
+ throw new Exception(L10n::t('Your nickname can only contain a-z, 0-9 and _.'));
}
// Check existing and deleted accounts for this nickname.
'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 = avatar_img($email);
+ $photo = Network::lookupAvatarByEmail($email);
}
// unless there is no avatar-addon loaded
$photo_failure = false;
$filename = basename($photo);
- $img_str = fetch_url($photo, true);
+ $img_str = Network::fetchUrl($photo, true);
// guess mimetype from headers or filename
$type = Image::guessType($photo, true);
Login Name: %1$s
Password: %5$s
- You may change your password from your account "Settings" page after logging
+ You may change your password from your account Settings page after logging
in.
Please take a few moments to review the other account settings on that page.
You may also wish to add some basic information to your default profile
- (on the "Profiles" page) so that other people can easily find you.
+ ' . "\x28" . 'on the "Profiles" page' . "\x29" . ' so that other people can easily find you.
We recommend setting your full name, adding a profile photo,
- adding some profile "keywords" (very useful in making new friends) - and
+ adding some profile keywords ' . "\x28" . 'very useful in making new friends' . "\x29" . ' - and
perhaps what country you live in; if you do not wish to be more specific
than that.
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