X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fregister.php;h=4c4fcc2af12e7b980bcc3a7b4ec6c658ab87c7f1;hb=ed6ada0da571ac88b039a162601ac172c3680710;hp=4c0860e6e3f3362a9ace2b2a732886114e95a85b;hpb=c311db4420d40af0d5b6a7c44d29a3156683765a;p=friendica.git
diff --git a/mod/register.php b/mod/register.php
index 4c0860e6e3..4c4fcc2af1 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -79,26 +79,31 @@ function register_post(&$a) {
set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
}
- $res = send_register_open_eml(
- $user['email'],
- $a->config['sitename'],
- $a->get_baseurl(),
- $user['username'],
- $result['password']);
-
- if($res) {
- info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
+ // Only send a password mail when the password wasn't manually provided
+ if (!x($_POST,'password1') OR !x($_POST,'confirm')) {
+ $res = send_register_open_eml(
+ $user['email'],
+ $a->config['sitename'],
+ $a->get_baseurl(),
+ $user['username'],
+ $result['password']);
+
+ if($res) {
+ info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
+ goaway(z_root());
+ } else {
+ notice(
+ sprintf(
+ t('Failed to send email message. Here your accout details:
login: %s
password: %s
You can change your password after login.'),
+ $user['email'],
+ $result['password']
+ ). EOL
+ );
+ }
+ } else {
+ info( t('Registration successful.') . EOL ) ;
goaway(z_root());
}
- else {
- notice(
- sprintf(
- t('Failed to send email message. Here your accout details:
login: %s
password: %s
You can change your password after login.'),
- $user['email'],
- $result['password']
- ). EOL
- );
- }
}
elseif($a->config['register_policy'] == REGISTER_APPROVE) {
if(! strlen($a->config['admin_email'])) {
@@ -235,6 +240,9 @@ function register_content(&$a) {
));
}
+ $r = q("SELECT count(*) AS `contacts` FROM `contact`");
+ $passwords = !$r[0]["contacts"];
+
$license = '';
$o = get_markup_template("register.tpl");
@@ -260,8 +268,11 @@ function register_content(&$a) {
'$fillext' => $fillext,
'$oidlabel' => $oidlabel,
'$openid' => $openid_url,
- '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\x29" . ': '),
+ '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
'$addrlabel' => t('Your Email Address: '),
+ '$passwords' => $passwords,
+ '$password1' => array('password1', t('New Password:'), '', t('Leave empty for an auto generated password.')),
+ '$password2' => array('confirm', t('Confirm:'), '', ''),
'$nickdesc' => str_replace('$sitename',$a->get_hostname(),t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'nickname@$sitename\'.')),
'$nicklabel' => t('Choose a nickname: '),
'$photo' => $photo,