Firefox PHP

Module: Registration Notification

Posted by Joe Curia 
All files from this thread

File Name File Size   Posted by Date  
registration_notification.zip 3.7 KB open | download Joe Curia 02/16/2009 Read message
Module: Registration Notification
February 16, 2009 10:30PM
This module makes it possible to automatically send a notification email to all administrators (or to a single email address, see the 'settings' dialog of the module) when a new registered user waits for approval. This module was originally coded for 5.1 by zwerfkat, I simply updated one of the api functions that were new to Phorum 5.2. Thanks also go to Maurice Makaay for pointing out the api function so that I only needed a quick copy and paste to get this updated.

Of course, the "Registration Verification" option from the "Admin - General" dialog must be set to "verified by a Moderator".

Language files for Dutch, Dutch_informal and English are included.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald




Edited 1 time(s). Last edit at 02/16/2009 10:33PM by Joe Curia.
Attachments:
open | download - registration_notification.zip (3.7 KB)
Re: Module: Registration Notification
February 16, 2009 10:38PM
Darn, you were a few minutes quicker than me here! Good work.
Luckily, converting the mod wasn't to big of a job ;-)


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Registration Notification
April 29, 2009 07:03AM
We are looking for a module that would notfity the admins when someone registered on forum so we download and installed this module. We tried both admins and single email address however we never get any email notifications when someone registered on forum.

We're looking for something that would notfity to an email address each time someone attempt to register on our forum because we been having some troublemaker that keep getting banned and come back re-registering with a different email address and we want to be alerted each time someone submitted a registeration.

Maybe we missed a setting?

Bill
Re: Module: Registration Notification
April 29, 2009 01:18PM
This module was written to only send notifications if registration requests are moderated. It doesn't sound like you are moderating those requests, just that you want notification. As a quick hack, edit the registration_notification.php file in this module, removing lines as indicated:
<?php

// This module sends a notification email to all administrator(s) by default
// (or to a single email address, see settings) after a new user has registered.

if(!defined("PHORUM")) return;

function phorum_mod_registration_notification ($userdata) {

	$PHORUM=$GLOBALS["PHORUM"];
	if($PHORUM["registration_control"] == PHORUM_REGISTER_VERIFY_MODERATOR ||   <------ REMOVE
     $PHORUM["registration_control"] == PHORUM_REGISTER_VERIFY_BOTH) {  <--------- REMOVE 

		include_once("./include/email_functions.php");
		
	  if(empty($PHORUM["mod_registration_notification"]["registration_notification_email_address"])){
	  	$mail_users = phorum_api_user_list_moderators($PHORUM['forum_id'],false,true);
	  }else {
	  	$mail_users  =  array($PHORUM["mod_registration_notification"]["registration_notification_email_address"]);
	  };
	
	  $mail_data = array(
	      "mailmessage" => $PHORUM["DATA"]["LANG"]["registration_notification"]["Message"],
	      "mailsubject" => $PHORUM["DATA"]["LANG"]["registration_notification"]["Subject"],
	      "useremail"   => $userdata["email"],
	      "forumtitle"  => $PHORUM["title"],
	      "username"    => $userdata["username"],
	      "login_url" 	=> phorum_get_url(PHORUM_LOGIN_ACTION_URL)
	  );
	        
	  phorum_email_user($mail_users, $mail_data);  
	  
  }   <---------------- REMOVE

  return $userdata;
}

?>


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Registration Notification
April 29, 2009 10:45PM
Quote
Joe Curia
This module was written to only send notifications if registration requests are moderated. It doesn't sound like you are moderating those requests, just that you want notification. As a quick hack, edit the registration_notification.php file in this module, removing lines as indicated:
<?php

// This module sends a notification email to all administrator(s) by default
// (or to a single email address, see settings) after a new user has registered.

if(!defined("PHORUM")) return;

function phorum_mod_registration_notification ($userdata) {

	$PHORUM=$GLOBALS["PHORUM"];
	if($PHORUM["registration_control"] == PHORUM_REGISTER_VERIFY_MODERATOR ||   <------ REMOVE
     $PHORUM["registration_control"] == PHORUM_REGISTER_VERIFY_BOTH) {  <--------- REMOVE 

		include_once("./include/email_functions.php");
		
	  if(empty($PHORUM["mod_registration_notification"]["registration_notification_email_address"])){
	  	$mail_users = phorum_api_user_list_moderators($PHORUM['forum_id'],false,true);
	  }else {
	  	$mail_users  =  array($PHORUM["mod_registration_notification"]["registration_notification_email_address"]);
	  };
	
	  $mail_data = array(
	      "mailmessage" => $PHORUM["DATA"]["LANG"]["registration_notification"]["Message"],
	      "mailsubject" => $PHORUM["DATA"]["LANG"]["registration_notification"]["Subject"],
	      "useremail"   => $userdata["email"],
	      "forumtitle"  => $PHORUM["title"],
	      "username"    => $userdata["username"],
	      "login_url" 	=> phorum_get_url(PHORUM_LOGIN_ACTION_URL)
	  );
	        
	  phorum_email_user($mail_users, $mail_data);  
	  
  }   <---------------- REMOVE

  return $userdata;
}

?>


It works great .. .Thank you ...

But we got one more question, we know we can go to the event logger and whoever registered that we can check thier ip address but we were wondering if it possible to add the ip address into the email message body too?

We changed the lang to "A new user registered on (fourmname)" and it would be nice to add the ip address next to it. We get the time and date from the email itself when it was sent.

Bill
Re: Module: Registration Notification
May 13, 2009 10:07PM
To make my life simpler, I changed the $mail_data line to this:
Language: PHP
"login_url" => $PHORUM[';http_path';]."/admin.php?module=users&user_id=".$userdata["user_id"]."&edit=1"

It gives me a link directly to the admin section of that user so I can approve or deny rather than having me login to the forum.
Re: Module: Registration Notification
July 21, 2009 10:53AM
I hadn't realised this mod was necessary (thought it was part of the Phorum program already) so it has saved a needless query on the forum anyway, as I was busy going through all the options of the program to find out what I needed to change to achieve this.

However, as new users are approved by Moderators (I thought) rather than administrators - perhaps someone can confirm this?

Is there a way of adding multiple email addresses or preferably just saying send to Moderators, rather than (or as well as ) Administrators

Have just put this module live on the system and get the following problems. Anybody have any ideas?

A new user signs up. Creates a profile and presses submit
He then sees the following error
"Fatal error: Cannot redeclare class PHPMailer in /home/fhlinux134/r/domainname.com/user/htdocs/Phorum/mods/smtp_mail/phpmailer/class.phpmailer.php on line 35"

The new user is recorded in the forum but no mail is sent to Admins. I have tried this with an email address as a single address and without one (so it defaults to all admins)

I am running Phorum v5.2.11 with module "Send mail through SMTP" enabled as our system doesn't seem to allow mail sendings not using smtp

Other emails generated by the system seem to be being sent



Edited 1 time(s). Last edit at 07/21/2009 11:34AM by goanstay.
Re: Module: Registration Notification
July 21, 2009 12:29PM
for the error: this change should be enough [trac.phorum.org] or wait for the next phorum release, due these days.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: Registration Notification
July 21, 2009 12:45PM
I had just found that modification (almost by accident)
Thanks Thomas
Re: Module: Registration Notification
November 05, 2009 02:14AM
I installed this mod and changed the code so that I would get notification anytime someone registered ( I don't moderate the registrations). Was still not getting emails. Then I noticed that you were using the smtp mod that I don't use. How would I go about getting this mod to work with the default Phorum mail method?
Sorry, only registered users may post in this forum.

Click here to login