11
khuhner
Re: Resend Activation Email?
  • 2006/10/24 0:06

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


OK, I decided to install this file and it seems to be working fine. The one addition I'd like to add is if the user enters an email that is not in the system and they realize they mistyped it, I'd like them to be able to refresh the page and retry. However the script seems to have cached the last email entered.

I've tried
reset ($HTTP_POST_VARS);
reset ($HTTP_GET_VARS);


and it doesnt seem to clear the $email variable.

Thoughts?

Quote:

Shine wrote:
There was a patch/hack named ATIVACAO.PHP

See topic: https://xoops.org/modules/newbb/viewtopic.php?topic_id=29449&viewmode=flat&order=ASC&start=0
Please read carefully.
Perhaps somebody can adjust this script to the latest 2.0.13.2 and 2.0.14+

As far as I know this patch has never been implemented in the core.
You have to consider that: if they fill in the emailaddress but their spamfilter has its setting strong, the same activate email will be deleted by the same spamfilter of the user! So the resend won't make any sence if they don't change their spamfiltersettings.

Grtz., Shine

12
khuhner
Re: Resend Activation Email?
  • 2006/10/24 0:19

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


I cleaned up the file a bit and added a link for users to reload the file in case they entered the wrong email and want to try again.

This should REALLY, REALLY be included in the core! I inserted the link into the Login block as suggested. If it makes it into core, an additional link or code block should be added to the user.php file.


Kurt

Here is the file:

PHP
### ======================================================
### [url=http://www.xoops.net.br/]XOOPS Brasil[/url] - A comunidade diferente!
### ======================================================
### Arquivo para reenvio de Link de Ativação
### Script for resend the activation link
### ======================================================
### Developer: Fernando Santos, fernando@zend.com.br
### Copyright: www.xoops.net.br © 2003-2004
### ------------------------------------------------------
### www.xoops.net.br
### ======================================================
### v.1.0, Sun Dec 19 15:33:59 BRST 2004
### ======================================================

$xoopsOption['pagetype'] = "user";
include 
"mainfile.php";
include 
'header.php';

// Doesn't matter GET or POST
$email = isset($HTTP_GET_VARS['email']) ? trim($HTTP_GET_VARS['email']) : '';
$email = isset($HTTP_POST_VARS['email']) ? trim($HTTP_POST_VARS['email']) : $email;

// If $email is empty, show form for link resend
if ($email == '') {
echo <<< TOPET05

  Resend activation link
  
Fill in the e-mail you used to register and we will resend the activation email.

  $_SERVER[PHP_SELF]" method="post">
    Registered E-mail:   
value="Send" />
  

TOPET05;
  
$email='';
// If $email is not empty, let's verify some things before sending the link
}else{
$myts =& MyTextSanitizer::getInstance();
$member_handler =& xoops_gethandler('member');
// The line below returns an array with all the users registered with the given e-mail, in our case it'll be only the 

$getuser[0]
$getuser =& $member_handler->getUsers(new Criteria('email'$myts->addSlashes($email)));

// If the e-mail doesn't exist in the database, $getuser returns array()...
if ($getuser == array() ) {
    echo 
"

E-mail " $email " doesn't appear to be registered in our databases!



Please click 

here to retry."
;
    include(
"footer.php");
    exit();
}

// If the e-mail doesn't exist in the database, $getuser returns empty...
if (empty($getuser)) {
echo 
"

The e-mail isn't registered in our databases!

"
;
include(
"footer.php");
    exit();
}
//Verifying if the user is already active...
if($getuser[0]->isActive()){
echo 
"

The user ".$getuser[0]->getVar('uname').", registered with e-mail ".$getuser[0]->getVar('email').

is already active!

"
;
include(
"footer.php");
    exit();    
}
//Sending it
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setTemplate('register.tpl');
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
$xoopsMailer->setToUsers($getuser[0]);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf("- Resend - "._US_USERKEYFOR,$getuser[0]->getVar("uname")));
    if ( !
$xoopsMailer->send() ) {
    echo 
"

It could not be possible to resend the activation link for ".$getuser[0]->getVar('uname').". 

Contact the site administrators.

"
;
    include(
"footer.php");
    exit();
    } else {
    echo 
"

The activation link for ".$getuser[0]->getVar('uname')." was resent. If you don't receive 

the e-mail in a few hours, try again or contact the site

"
;
    }
}
include(
"footer.php");
?>



Quote:

khuhner wrote:
OK, I decided to install this file and it seems to be working fine. The one addition I'd like to add is if the user enters an email that is not in the system and they realize they mistyped it, I'd like them to be able to refresh the page and retry. However the script seems to have cached the last email entered.

I've tried
reset ($HTTP_POST_VARS);
reset ($HTTP_GET_VARS);


and it doesnt seem to clear the $email variable.

Thoughts?

Quote:

Shine wrote:
There was a patch/hack named ATIVACAO.PHP

See topic: https://xoops.org/modules/newbb/viewtopic.php?topic_id=29449&viewmode=flat&order=ASC&start=0
Please read carefully.
Perhaps somebody can adjust this script to the latest 2.0.13.2 and 2.0.14+

As far as I know this patch has never been implemented in the core.
You have to consider that: if they fill in the emailaddress but their spamfilter has its setting strong, the same activate email will be deleted by the same spamfilter of the user! So the resend won't make any sence if they don't change their spamfiltersettings.

Grtz., Shine

13
sohrab
Re: Resend Activation Email?
  • 2007/4/26 9:03

  • sohrab

  • Just popping in

  • Posts: 9

  • Since: 2007/3/17


OK, Installed this hack works great,
(by khuhner on 2006/10/24 1:19:43)
xoops 2.0.16 + heavy hacks...

Noticed one small syntx error in the code and added xoops-ulr(instead of yourdomain.com)..

Attached the modified one..just upload and add link into login blocks.

could not attach but here it is,

====================================re-activate.php
### ======================================================
### XOOPS Brasil - A comunidade diferente!
### ======================================================
### Arquivo para reenvio de Link de Ativação
### Script for resend the activation link
### ======================================================
### Developer: Fernando Santos, fernando@zend.com.br
### Copyright: http://www.xoops.net.br © 2003-2004
### ------------------------------------------------------
### http://www.xoops.net.br
### ======================================================
### v.1.0, Sun Dec 19 15:33:59 BRST 2004
### ======================================================

$xoopsOption['pagetype'] = "user";
include "mainfile.php";
include 'header.php';

// Doesn't matter GET or POST
$email = isset($HTTP_GET_VARS['email']) ? trim($HTTP_GET_VARS['email']) : '';
$email = isset($HTTP_POST_VARS['email']) ? trim($HTTP_POST_VARS['email']) : $email;

// If $email is empty, show form for link resend
if ($email == '') {
echo <<< TOPET05

Resend activation link

Fill in the e-mail you used to register and we will resend the activation email.


Registered E-mail:  
value="Send" />


TOPET05;
$email='';
// If $email is not empty, let's verify some things before sending the link
}else{
$myts =& MyTextSanitizer::getInstance();
$member_handler =& xoops_gethandler('member');
// The line below returns an array with all the users registered with the given e-mail, in our case it'll be only the

$getuser[0];
$getuser =& $member_handler->getUsers(new Criteria('email', $myts->addSlashes($email)));

// If the e-mail doesn't exist in the database, $getuser returns array()...
if ($getuser == array() ) {
echo "

E-mail " . $email . " doesn't appear to be registered in our databases!



Please click

here to retry.

";
include("footer.php");
exit();
}

// If the e-mail doesn't exist in the database, $getuser returns empty...
if (empty($getuser)) {
echo "

The e-mail isn't registered in our databases!

";
include("footer.php");
exit();
}
//Verifying if the user is already active...
if($getuser[0]->isActive()){
echo "

The user ".$getuser[0]->getVar('uname').", registered with e-mail ".$getuser[0]->getVar('email')."

is already active!

";
include("footer.php");
exit();
}
//Sending it
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setTemplate('register.tpl');
$xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
$xoopsMailer->assign('SITEURL', XOOPS_URL."/");
$xoopsMailer->setToUsers($getuser[0]);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf("- Resend - "._US_USERKEYFOR,$getuser[0]->getVar("uname")));
if ( !$xoopsMailer->send() ) {
echo "

It could not be possible to resend the activation link for ".$getuser[0]->getVar('uname').".

Contact itslbd.com Contact administrators.

";
include("footer.php");
exit();
} else {
echo "

The activation link for ".$getuser[0]->getVar('uname')." was resent. If you don't receive

the e-mail in a few hours, try again or contact the site

";
}
}
include("footer.php");
?>

=============================================

thanks for the great hack ...

Login

Who's Online

380 user(s) are online (296 user(s) are browsing Support Forums)


Members: 0


Guests: 380


more...

Donat-O-Meter

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

Latest GitHub Commits