X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fregister.php;h=1963bd7a6023c8b6c67196f95a0d1f7271f8211d;hb=ddaacc1e5334cab25855bb1b73b59b4436877765;hp=4ad84ecd6f872c01da1a6d0ae6b69ba80346c9a5;hpb=3ac5e4508b2c11f04acabbeb50bdbabcc904ec5e;p=friendica.git
diff --git a/mod/register.php b/mod/register.php
index 4ad84ecd6f..1963bd7a60 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -48,8 +48,6 @@ function register_post(&$a) {
}
- require_once('include/user.php');
-
$arr = $_POST;
$arr['blocked'] = $blocked;
@@ -81,25 +79,27 @@ 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 ) ;
- 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
- );
+ // 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
+ );
+ }
}
}
elseif($a->config['register_policy'] == REGISTER_APPROVE) {
@@ -140,7 +140,7 @@ function register_post(&$a) {
'source_link' => $a->get_baseurl()."/admin/users/",
'link' => $a->get_baseurl()."/admin/users/",
'source_photo' => $a->get_baseurl() . "/photo/avatar/".$user['uid'].".jpg",
- 'to_email' => $admin['mail'],
+ 'to_email' => $admin['email'],
'uid' => $admin['uid'],
'language' => ($admin['language']?$admin['language']:'en'))
);
@@ -237,6 +237,9 @@ function register_content(&$a) {
));
}
+ $r = q("SELECT count(*) AS `contacts` FROM `contact`");
+ $passwords = !$r[0]["contacts"];
+
$license = '';
$o = get_markup_template("register.tpl");
@@ -264,6 +267,9 @@ function register_content(&$a) {
'$openid' => $openid_url,
'$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\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,