View Full Version : Adding Activation Link To Error_NoPermissions Templates
Pezman
05-22-2003, 07:51 PM
I keep running into a bug with vB 2.x.x (I have 2.3.0 currenty installed) and if the email that contains the activation link bounces from their email inbox, there is no way to send it again without manually doing so via the control panel.
I want to add it to my error_nopermission_loggedin and error_nopermission_loggedout templates, so I don't keep doing it manually.
I've tried adding this to the template: <a href="register.php?a=act"> but not matter how many attempts I can't get it or alterations of that URL to work.
Could someone here please tell me how I can have this added to the error page?
I've ran across the template named: activateform and it has EXACTLY what I need, but I can't seem to link to it properly from the error pages.
Here is an example of how people get locked out if the first activation link bounces...
Problem:
User changes Email Address via user CP
- System sends email to user informing them of Address Change and sends activation code so they can verify the change.
- User's inbox is full so message bounces
- User's status is in limbo and set to "Awaiting Email Verification"
User is stuck so they click on "Lost My Password"
- System resends lost password verification request
- User clicks on verification link and system sends another email with the NEW password
- User clicks on the link to change the password back to something he can remember
- System blocks him with the error_nopermission screen because he is still set as "Awaiting Email Verification" from the initial email bounce.
So now the user can't ever get in because the activation code was never properly clicked on due to email failure or user error.
TLDR version:
want to add a link to the ERROR page that allows users to manually send their own ACTIVATION link again via email
filburt1
05-22-2003, 08:02 PM
Try something akin to this:
if ($bbuserinfo['usergroupid'] == 3) // awaiting email conf
{
$useractivation = $DB_site->query_first("SELECT activationid FROM useractivation WHERE userid = " .
$bbuserinfo['userid']);
$extraacttext = "You have not yet activated your account. To do so, click this link: <a href=\"register.php?s=" . $session['sessionhash'] .
"&a=" . $useractivation['activationid'] . "\">activate</a>";
}
else unset($extraacttext);
Then add $extraacttext to the correct template. Of course it makes activation via e-mail completely useless...
Pezman
05-22-2003, 08:10 PM
Can't instead I somehow link to that template called: activationform?
The solution you provided does look like it would work, however it would cut out the mail portion that I do like for security reasons.
Using the above code a user could register with a fake email, get the error page, then click on the link that would appear on the site and poof they are in.
I just need to get people to acitvationform successfully or a system that works similar to activationform template.
Heck, I can't even find a single place that directs users to that template can you?
Fallout2man
05-22-2003, 08:29 PM
I'm just toing to throw out my previous try and have another go.
under this:
if ($url==$HTTP_REFERER) {
$url=urlencode($url);
}
add this
// ############################### start remail ###############################
if ($HTTP_GET_VARS['action']=="remail") {
if ($bbuserinfo[usergroupid]==3) {
$userinfo=$DB_site->query_first("SELECT useractivation.userid,useractivation.activationid, user.username,user.email FROM `useractivation` LEFT JOIN `user` USING(userid) WHERE user.userid='$bbuserinfo[userid]'");
$username=$userinfo[username];
$userid=$userinfo[userid];
$activateid=$userinfo[activationid];
eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");
vbmail($userinfo[email],$subject,$message);
eval("standarderror(\"".gettemplate("remail_confirmed")."\");");
exit;
} elseif ($bbuserinfo[userid]==0) {
eval("standarderror(\"".gettemplate("error_remailogin")."\");");
exit;
} else {
eval("standarderror(\"".gettemplate("error_noremail")."\");");
exit;
}
}
As for the added templates
remail_confirmed:
$username, you have just resent your account activation email. Click <a href="index.php?s=$session[sessionhash]">here</a> to return to the main index.
error_remailogin:
You must be logged in to resend your account activation email.
if you
error_noremail:
Only Users Awaiting Activation can resend their activation email.
Pezman
05-23-2003, 12:03 AM
Nope, no go still.
Any other alternatives someone can come up with?
Logician
05-23-2003, 10:47 AM
Today at 04:03 AM Pezman said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=398719#post398719)
Nope, no go still.
Any other alternatives someone can come up with?
All you have to do is to turn off email confirmation. Because what you are trying to do is no different than turning it off alltogether, so why bother anyway?
If you don't want to turn it off, then try amykhar's hack which automatically sends activation codes Y more times in every X days until they got it.
Pezman
05-23-2003, 05:32 PM
Fallout2man
I get a parse error on line 20
That line is: $username=userinfo[username];
so I changed it to: $username=$userinfo[username];
Notice the $
Now....
The system doesn't send me an email although it says it did. And it says ", you have...l" rather then "Pezman, you have..."
Hellcat
05-25-2003, 05:44 PM
Maybe I found what's going wrong in the script/hack posted above!
Try using $bbuserinfo[...] where it says $userinfo[...].
At least that's the array used by vBulletin's original templates....
Another idea:
Would an external PHP-Script be OK for you?
You could link to that (external, non vB) page which asks for the username and then sends the activation request by itself.
That could be done quite easiely....
Fallout2man
05-27-2003, 07:18 PM
05-23-03 at 11:32 AM Pezman said this in Post #7 (https://vborg.vbsupport.ru/showthread.php?postid=399028#post399028)
Fallout2man
I get a parse error on line 20
That line is: $username=userinfo[username];
so I changed it to: $username=$userinfo[username];
Notice the $
Now....
The system doesn't send me an email although it says it did. And it says ", you have...l" rather then "Pezman, you have..."
Fixed that, also realized the main if statement was off, I was using userid instead of usergroupid like it should've been.
Pezman
05-28-2003, 12:57 AM
Ok....
For anyone who wants to know how to fix this. It is as easy as pie, and I really wish someone could have answered my original question on what used the : activationform template.
I found what uses it and you can install this hack without doing jack!
Just link to register.php?action=requestemail
Easy as pie, hack is complete, install now :)
Koutaru
05-28-2003, 12:59 AM
:) very nice -- Thanks Pezman
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.