Script Users Register, Login - Validate by administrator

Place for comments, problems, questions, or any issue related to the JavaScript / PHP scripts from this site.
guidovanharten
Posts:5

Script Users Register, Login - Validate by administrator

On this website I found the beautiful Script Users Register, Login, Online

I am looking for an option to add the option that the administrator will agree the subscription of a new user.
How do I create that?

Regards,
Guido

Admin Posts:805
Hello
It is an old script that is no more in development.
If you want the registration to be confirmed by the Administrator, you can make a little changes it the script so, after the user registers the confirmation email will be send to the admin address to validate it. Than, you send manually an email to the user's address to confirm it.
To make this change:

1. Open the "texts.php" file and modify the texts of these properties: mailmsg and mailsent.
For example you can use this:

Code: Select all

'mailmsg'=>" Hello, <br/>
You receive this message because an user have registered on the website %s <br/><br/>
To validate his /her registration, click on the following link (<i>or copy it in the address bar of your browser</i>):<br/><br/>
  <center><b> %s </b></center><br/><br/>
His /Her login data:<br/><br/>
  E-Mail = %s <br/>
  Password = %s <br/>",
'mailsent'=>'<center><h3>Registration performed successfully</h3>The Administrator will validate your registration and he will send you a confirmation email.<br/><br/> After confirmation you can log in.</center>',
2. Delete the link for new confirmation in the "unconfirmed" property (line 243 in texts.php). For example;

Code: Select all

'unconfirmed'=>'<center><h4 class="eror">Registration for <u>%s</u> is unconfirmed.</h4></center>',
3. Open the "class.UsersReg.php" file, and modify the first parameter in the sendMail() function (line 49) to send the email for validation to the admin address.
Change the lines 49-51 with this code:

Code: Select all

if($this->sendMail(ADMINMAIL, ADMINMAIL, $this->site, $subject, $msg)) {
  $msg = sprintf($this->lsite['register']['mailsent'], $email);
}

guidovanharten Posts:5
Hello admin,
Very pity that this script is no more in development.
It seems these modifications works good. Many thanks!
How can I achieve that after validation the system should send a mail to the new user which tells him that his/her account is approved?

After approving the subscription, the webpage said:
Now you can log on the site.
Imho, these text is not right and should be changed onto:
Now the user can log on the site.
Where can I find these string?

Regards,
Guido

Admin Posts:805
If you want to automatically send an email to the user after his account was approved via the confirmation link, open the file "class.UsersRecov.php" and change the code of the lines 96..98 (in the getConfirm() function) with this code:

Code: Select all

$sql ="SELECT name, email, rank FROM `users` WHERE `id`='$id' LIMIT 1";
$redb = $this->sqlExecute($sql);
if($redb[0]['rank']>0){
  $subject ='Account approved';
  $msg ='Hello '. $redb[0]['name'] .',
  Your account on '. $this->site .' it was approved, now you can log on the site.';
  if($this->sendMail($redb[0]['email'], ADMINMAIL, $this->site, $subject, $msg)) $re = $this->lsite['recov']['reconfirm'];
  else $re ='Unable to send confirmation email.';
}
- You can find the texts you want to change in the "texts.php" file.

guidovanharten Posts:5
Thank you very much!
Now I have a great login system.