1
coopersita
Modifying new user notifications

I want to add an option to my XOOPS so that if people choose to, they would be notified when someone else from the same location registeres.

I thought the place to do this would be register.php, so towards the end I now have:

if ($xoopsConfigUser['new_user_notify'] == && !empty($xoopsConfigUser['new_user_notify_group'])) {
            
$myts =& MyTextSanitizer::getInstance();
//my code starts here
            
$criteria = new CriteriaCompo();

            
$criteria->add(new Criteria('user_from''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_from'])).'%''LIKE'));

    
        
$foundusers =& $member_handler->getUsers($criteriatrue);
        
        foreach (
array_keys($foundusers) as $j) {
            
$userdata['user_from'] = $foundusers[$j]->getVar("name");
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($userdata['email']);
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
            
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($uname)));
            
$xoopsMailer->send();
            }
            
//end my code
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
            
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($uname)));
            
$xoopsMailer->send();
        }


The code I added is from the member search module. I was wondering if anyone has any ideas on how to fix this...

I guess one of my problems is that I'm using $HTTP_POST_VARS['user_from'] to search for users, but I'm not sure where is the information for the person that is registering stored (which variable), and how to access it.

Any help will be appreciated.

Login

Who's Online

240 user(s) are online (126 user(s) are browsing Support Forums)


Members: 0


Guests: 240


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits