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
<?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: 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
<fieldset style="padding: 10px;">
<legend style="font-weight: bold;">Resend activation link</legend>
<div><br />Fill in the e-mail you used to register and we will resend the activation email.</div>
<form action="$_SERVER[PHP_SELF]" method="post">
Registered E-mail: <input type="text" name="email" size="26" maxlength="60" />&nbsp; <input type="submit"

value="Send" />
</form>
</fieldset>
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 "<br><br><h3>E-mail " . $email . " doesn't appear to be registered in our databases!</h3><br><br><h4>Please click

<a href=''.XOOPS_URL.'/Re-Activation.php'>here</a> to retry.</h4>";
include("footer.php");
exit();
}

// If the e-mail doesn't exist in the database, $getuser returns empty...
if (empty($getuser)) {
echo "<br><br><h3>The e-mail isn't registered in our databases!</h3>";
include("footer.php");
exit();
}
//Verifying if the user is already active...
if($getuser[0]->isActive()){
echo "<br><br><h3>The user ".$getuser[0]->getVar('uname').", registered with e-mail ".$getuser[0]->getVar('email')."

is already active!</h3>";
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 "<br><br><h3>It could not be possible to resend the activation link for ".$getuser[0]->getVar('uname').".

Contact itslbd.com <a href=''.XOOPS_URL.'/modules/contact/'>Contact administrators</a>.</h3>";
include("footer.php");
exit();
} else {
echo "<br><br><h3>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</h3>";
}
}
include("footer.php");
?>

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

thanks for the great hack ...

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
<fieldset style="padding: 10px;">
  <legend style="font-weight: bold;">Resend activation link</legend>
  <div><br />Fill in the e-mail you used to register and we will resend the activation email.</div>
  <form action="
$_SERVER[PHP_SELF]" method="post">
    Registered E-mail: <input type="text" name="email" size="26" maxlength="60" />&nbsp; <input type="submit" 

value="Send" />
  </form>
</fieldset>
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 
"<br><br><h3>E-mail " $email " doesn't appear to be registered in our databases!</h3><br><br>Please click 

<a href=http://yourdomain.com/ActivateResend.php>here</a> to retry."
;
    include(
"footer.php");
    exit();
}

// If the e-mail doesn't exist in the database, $getuser returns empty...
if (empty($getuser)) {
echo 
"<br><br><h3>The e-mail isn't registered in our databases!</h3>";
include(
"footer.php");
    exit();
}
//Verifying if the user is already active...
if($getuser[0]->isActive()){
echo 
"<br><br><h3>The user ".$getuser[0]->getVar('uname').", registered with e-mail ".$getuser[0]->getVar('email').

is already active!</h3>"
;
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 
"<br><br><h3>It could not be possible to resend the activation link for ".$getuser[0]->getVar('uname').". 

Contact the site <a href=http://yourdomain.com/modules/contact_plus/index.php>administrators</a>.</h3>"
;
    include(
"footer.php");
    exit();
    } else {
    echo 
"<br><br><h3>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</h3>"
;
    }
}
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

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

10
khuhner
Re: Resend Activation Email?
  • 2006/10/23 21:34

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


<BUMP>

9
khuhner
Re: Resend Activation Email?
  • 2006/10/4 21:44

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


Quote:

Shine wrote:
Is there a chance you'll update this activao.php file to XOOPS 2.0.13.2 ? Instead of implementing in within xmail?
SOme would like it seperate instead of instaling a whole module.

Grtz., Shine


I'd like this too. I dont want to load an entire module for this one function.

Core XOOPS Developers, has anyone considered implementing this directly into the XOOPS baseline code?

Kurt

8
Shine
Re: Resend Activation Email?
  • 2006/10/3 7:19

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Is there a chance you'll update this activao.php file to XOOPS 2.0.13.2 ? Instead of implementing in within xmail?
SOme would like it seperate instead of instaling a whole module.

Grtz., Shine

7
khuhner
Re: Resend Activation Email?
  • 2006/9/23 22:45

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


Quote:

Shine wrote:
don't know anymore, since it was a long time ago I installed it.
But hey,...just install and try it out yourself and you'll get the answer
Let us know!

Grtz., Shine


Thanks for your suggestions, but this approach merely sends out an email. I need to resend the "activation email" as I dont want to get in the habit of hacking the data base or manually activating these users (and changing their password and sending it to them).

Any other suggestions out there in XOOPS land?

Kurt

6
giba
Re: Resend Activation Email?
  • 2006/9/23 22:39

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


Quote:

Shine wrote:
don't know anymore, since it was a long time ago I installed it.
But hey,...just install and try it out yourself and you'll get the answer
Let us know!

Grtz., Shine


Hi Shine, good memory you have

This hack power action user, is present in version module Xmail

Thanks for you remmember it

5
Shine
Re: Resend Activation Email?
  • 2006/9/23 21:48

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


don't know anymore, since it was a long time ago I installed it.
But hey,...just install and try it out yourself and you'll get the answer
Let us know!

Grtz., Shine

4
khuhner
Re: Resend Activation Email?
  • 2006/9/23 21:17

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


Does that send a generic email or a copy of the activation email?

Kurt

Login

Who's Online

142 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

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

Latest GitHub Commits