return $default_group;
}
- $user = dba::select('user', ['def_gid'], ['uid' => $uid], ['limit' => 1]);
+ $user = dba::selectFirst('user', ['def_gid'], ['uid' => $uid]);
if (DBM::is_result($user)) {
$default_group = $user["def_gid"];
if (is_object($user_info)) {
$user = (array) $user_info;
} elseif (is_int($user_info)) {
- $user = dba::select('user',
- ['uid', 'password'],
+ $user = dba::selectFirst('user', ['uid', 'password'],
[
'uid' => $user_info,
'blocked' => 0,
'account_expired' => 0,
'account_removed' => 0,
'verified' => 1
- ],
- ['limit' => 1]
+ ]
);
} elseif (is_string($user_info)) {
$user = dba::fetch_first('SELECT `uid`, `password`
$password = $password1;
}
- $tmp_str = $openid_url;
-
if ($using_invites) {
if (!$invite_id) {
throw new Exception(t('An invitation is required.'));
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;
$openid = new \LightOpenID;
$openid->identity = $openid_url;
$openid->returnUrl = System::baseUrl() . '/openid';
- $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson');
- $openid->optional = array('namePerson/first', 'media/image/aspect11', 'media/image/default');
+ $openid->required = ['namePerson/friendly', 'contact/email', 'namePerson'];
+ $openid->optional = ['namePerson/first', 'media/image/aspect11', 'media/image/default'];
try {
$authurl = $openid->authUrl();
} catch (Exception $e) {
throw new Exception(t('Please enter the required information.'));
}
- if (!validate_url($tmp_str)) {
+ if (!validate_url($openid_url)) {
$openid_url = '';
}
if ($insert_result) {
$uid = dba::lastInsertId();
- $user = dba::select('user', [], ['uid' => $uid], ['limit' => 1]);
+ $user = dba::selectFirst('user', [], ['uid' => $uid]);
} else {
throw new Exception(t('An error occurred during registration. Please try again.'));
}
$body = sprintf($body, $username, $sitename);
- return notification(array(
+ return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Registration at %s'), $sitename),
- 'body' => $body));
+ 'body' => $body]);
}
/**
$preamble = sprintf($preamble, $username, $sitename);
$body = sprintf($body, $email, $sitename, $siteurl, $username, $password);
- return notification(array(
+ return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Registration details for %s'), $sitename),
'preamble'=> $preamble,
- 'body' => $body));
+ 'body' => $body]);
}
/**
logger('Removing user: ' . $uid);
- $user = dba::select('user', [], ['uid' => $uid], ['limit' => 1]);
+ $user = dba::selectFirst('user', [], ['uid' => $uid]);
call_hooks('remove_user', $user);