PDA

View Full Version : Tiny hack: Custom nopermission message to unactivated users


Mas*Mind
05-25-2001, 10:00 PM
Description: This hack prints a custom message to users that want to take an action they can't because they didn't activated their account yet. This probably saves you alot of emails from users who didn't properly read their activation-email asking you why they can't post while they did register.

VB-Version: Probably every version, certainly every 2.0 version

Instructions:


open (and backup first) admin/functions.php
Do a search for ###################### Start show_nopermission #######################
replace if ($bbuserinfo[userid]==0) {
eval("standarderror(\"".gettemplate("error_nopermission_loggedout")."\");");
} else {
eval("standarderror(\"".gettemplate("error_nopermission_loggedin")."\");");
}
exit;
with if ($bbuserinfo[userid]==0) {
eval("standarderror(\"".gettemplate("error_nopermission_loggedout")."\");");
} else {
if($bbuserinfo[usergroupid] == 3) {
eval("standarderror(\"".gettemplate("error_nopermission_awaiting_moderation")."\");");
}
else {
eval("standarderror(\"".gettemplate("error_nopermission_loggedin")."\");");
}
}
exit;
create a new template called error_nopermission_awaiting_moderation
add the following content in it: You have recently registered at $bbtitle but not yet activated your account. You can find the link to activate your account in your welcome-email.

<p align="center">
<table border="0" bgcolor="#555576" cellpadding="4" cellspacing="1" align="center">
$logincode
</table>
</p>

<p><smallfont>If you didn't received the activation-email <a href="register.php?s=$session[sessionhash]&action=requestemail">click here</a> to resend it. <a href="member.php?s=$session[sessionhash]&action=lostpw">Forgotten your password?</a></smallfont>
save and upload admin/functions.php
enjoy :)

eva2000
05-25-2001, 10:30 PM
great :D

Mas*Mind
05-25-2001, 11:46 PM
For those who allready installed this hack: You might wanna remove the You can activate your account <a href="register.php?s=$session[sessionhash]&a=act&u=$bbuserinfo[userid]&i=$bbuserinfo[joindate]">here</a> in case you deleted the email. bit from your template because it totally defeats the purpose of email-verification :o. Totally forgot about that :D

Put this bit in it instead:

If you didn't received the activation-email <a href="register.php?s=$session[sessionhash]&action=requestemail">click here</a> to resend it.

eva2000
05-25-2001, 11:50 PM
Originally posted by Mas*Mind
because it totally defeats the purpose of email-verification :o. Totally forgot about that :D LOL :D

Mas*Mind
05-26-2001, 10:33 AM
Doesn't anyone (besides eva ;)) find this hack usefull?

eva2000
05-26-2001, 11:41 AM
Originally posted by Mas*Mind
Doesn't anyone (besides eva ;)) find this hack usefull? probably for most people the default template message is sufficient :)

Joshs
05-27-2001, 12:38 AM
I installed it, Thanks!

Mas*Mind
05-28-2001, 06:55 PM
I'm quite surprised this hack isn't that popular. Since I installed this hack I haven't got any email from members who are asking why they can post while they registered just because they didn't read their activation email properly (thus didn't activated their account). Before that I got a couple of them each day... Saves me alot of explanation.

Robert Basil
05-28-2001, 10:49 PM
Mas,

I just added this hack, thanks!

BluSmurf
05-29-2001, 01:41 PM
installed in mine :D cheers!

kirck
06-04-2001, 07:43 PM
I installed it too! Thanks!:D

Devices
06-06-2001, 06:39 PM
So far so good.

This should be very usefull. I am getting loads of emails at the moment from people who can not be bothered to read their emails or they may have not recieved it for some reason. Now they can help themselfs by getting the email resent.

I have added it in and tested it and all seems well.

One thing though which is not this hack but a problem with VB in general.

If you do not allow viewing to unregistered or users awaiting confirmation then they are asked to login when they come to your VB. So they are allowed to login but then get the above permission hack displayed.

When they go to the resend activation email link they just keep getting the same page as they do not have permission to view the remail page ?

Maybe i missed a setting.

Devices
06-06-2001, 07:00 PM
So far so good.

This should be very usefull. I am getting loads of emails at the moment from people who can not be bothered to read their emails or they may have not recieved it for some reason. Now they can help themselfs by getting the email resent.

I have added it in and tested it and all seems well.

One thing though which is not this hack but a problem with VB in general.

If you do not allow viewing to unregistered or users awaiting confirmation then they are asked to login when they come to your VB. So they are allowed to login but then get the above permission hack displayed.

When they go to the resend activation email link they just keep getting the same page as they do not have permission to view the remail page ?

Maybe i missed a setting.

kdog316
06-07-2001, 03:51 AM
ok iget these erorrs after i installed it and now i try to access my board and here is what comes up

Parse error: parse error in ./functions.php on line 1805

Warning: Cannot add header information - headers already sent by (output started at ./functions.php:1805) in ./functions.php on line 1187

Warning: Cannot add header information - headers already sent by (output started at ./functions.php:1805) in ./functions.php on line 1187

Fatal error: Call to undefined function: vbdate() in ./sessions.php on line 354
:confused:

Mas*Mind
06-07-2001, 06:01 AM
you backed up your functions.php right?

Then revert it and apply the changes again...You did something wrong (can't figure out what)

kdog316
06-07-2001, 01:06 PM
it works thanks

Typhon
06-07-2001, 06:10 PM
I'm about to install it.. but I just wanted to let youknwo this is a nice hack... will certainly save me the trouble of resending them manually. Thanks!

daydreamer
06-07-2001, 09:08 PM
Installed the hack. Went to test it, "clicked here" to resend it and got a 404:(

Any ideas?

dd

Mas*Mind
06-07-2001, 09:31 PM
do the same as kdog316: revert and re-apply...

You probably did something wrong...

btw: Since I installed this hack I never got one of those emails again, so it definitely helps :)

daydreamer
06-07-2001, 09:35 PM
DUH!

I didn't change the file extensions to .php3...:rolleyes:

dd

daydreamer
06-07-2001, 11:29 PM
Hello again,

I think this hack may have caused some problems with links on showthread pages such as this:
http://forums.dreamsweb.net/showthread.php3?s=&threadid=12

Notice the "general forums" and "Sales Questions" links at top. The refer to .php33 pages.

Anyone who has installed this hack please check to see if you are having the same problem.

Thankx

dd

daydreamer
06-07-2001, 11:46 PM
DUH! AGAIN... I need some sleep.

Okay, As in my post earlier. I forgot to rename all file extensions to .php3

I am usually very careful when doing so while using Note Tab Lite. Having said that, I rename all to .php33

All is not my fault as that was the first thing I thought of to check, but the program's search feature did not find them. I had to locate them all myself. Only about nine or so.

I will now reinstall Note Tab Lite....

Mods, please delete my post here today :D

dd

Castel
06-08-2001, 03:48 AM
Wow, didn't see this til now. Very useful Mas*Mind, I will install it shortly. Even after adding additional lines to the normal error template I still get mail daily about stuff like this. Great little hack!

Mas*Mind
06-08-2001, 06:55 AM
Glad y'all like it :)

I slightly changed the error_nopermission_awaiting_moderation -template to make it even more clear:

You have recently registered at $bbtitle but not yet activated your account.
You can find the link to activate your account in your welcome-email.
If you didn't received the activation-email or you've allready deleted it, <a href="register.php?s=$session[sessionhash]&action=requestemail&email=$bbuserinfo[email]">click here</a> to resend it to you're email-adress ($bbuserinfo[email]).
If you still don't receive it then, you probably have entered an incorrect addres, you can correct it by editing your <a href="member.php?s=$session[sessionhash]&action=editprofile">profile</a>.

<p align="center">
<table border="0" bgcolor="#555576" cellpadding="4" cellspacing="1" align="center">
$logincode
</table>
</p>

<p><smallfont><a href="member.php?s=$session[sessionhash]&action=lostpw">Forgotten your password?</a></smallfont>

then change

<input type="text" class="bginput" name="email" size="35" maxlength="90">

to

<input type="text" class="bginput" name="email" size="35" maxlength="90" value="$email">

in your activate_requestemail-template

Dakota
06-08-2001, 07:01 AM
I have to say that I like your hack too. Good Job :D

robertusss
06-10-2001, 04:06 PM
great one!

this one must be in 2.1 - no doubt!

Jujubee
07-01-2001, 06:10 AM
Thanks Mas! Was thinking of pouring through the code to get something like this to work, but you've done everything already!

Great stuff. :)

Alex
08-11-2001, 06:51 AM
Just installed it... works like a charm and (my oppinion) is a very helpful thing for User awaiting Email Confirmation. :-)

JJR512
08-11-2001, 04:52 PM
I have taken the liberty of re-wording the new template, as well as adding a new part to it. The re-wording was done to improve the English a bit (and that is not said to be critical). I added a line to say that maybe the user supplied the wrong address, and should contact the webmaster if he/she still does not get the activation email.

You have recently registered at $bbtitle, but have not yet activated your account. You can find the link to activate your account in your welcome-email.

<p align="center">
<table border="0" bgcolor="#555576" cellpadding="4" cellspacing="1" align="center">
$logincode
</table>
</p>

<p><smallfont>If you haven't received the activation email, <a href="register.php?s=$session[sessionhash]&action=requestemail">click here</a> and it will be resent. If you still do not receive the activation email, you may have mistyped your email address. If you suspect you used the incorrect email address, please contact the <a href="mailto:webmaster@jjr512.com">Webmaster</a>. <a href="member.php?s=$session[sessionhash]&action=lostpw">Forgotten your password?</a>

Does anyone know the variable to use for the webmaster email, rather than hard-coding it as I have done?

pran
08-29-2001, 03:02 AM
Thanks Mas*Mind, great hack!

aldamon
08-30-2001, 12:05 PM
Great stuff! Thanks!

MarkB
08-31-2001, 04:31 AM
I finally got around to adding this to my forums, and it's been a godsend. Thanks! :D

web
09-03-2001, 02:42 AM
Nice job. This was the first hack I installed since I start using vBulletin. It works fine with one exception. The link to go to 'profile' and edit the password did not work. It kept returning to the new 'not activated' page. Not a problem, I just removed that portion of the template. I also removed the portion for "forgot password." The user is already logged in, so they could not have forgotten their password ;) .

Thanks for sharing the work and it will definitely save me some time responding to emails and voice mails.

Regards,

web

Grover
09-19-2001, 05:23 AM
Hi Mas*Mind,

Are there plans to release this very useful hack in a future version of Vbulletin? I think that this HAS TO BE part of the standard VBulletin-features in the future: it is one of the most useful (and can I even say: NECESSARY) hacks I have ever seen.

I hope they put it in! It really just saves us so much work........

Grover.

aldamon
10-30-2001, 06:21 PM
Please make sure this works in 2.2.0! This hack is fabulous!!!

ixian
11-28-2001, 04:56 PM
I have tried this over and over and I keep getting an error in functions.php:

Parse error: parse error in /home/httpd/www.mysite/xxx/forums/admin/functions.php on line 2232

Yes, I replaced my actual site with "mysite"

I am using 2.21. I have cut and pasted the code exactly (I use PHPCoder Pro as my text editor, so no extra breaks/crap is inserted) but no go.

Has anyone gotten this to work with 2.21?

stilger
12-05-2001, 05:56 AM
Does anyone know if the hack works in 2.2.1? I have tried to install it but when going to the page after registering to test and see what it would do to a user awaiting registration it automatically activates my account.

cfscfs
12-06-2001, 11:10 AM
It works for me under 2.2.1
So far I havent had any problem at all with it.
(less than one day)

stilger
12-06-2001, 12:00 PM
Did you try and register a user then try to log in without activating your account and see if you get the message to click to resend activation code etc?

cfscfs
12-06-2001, 12:32 PM
Yep.
Everything works the way it should.
Created new user and did not activate account.
Than I tried to create a new thread or post a reply, the new message is shown. After clicking on the link I enter my email and I recive a new email with my acctivationcode and I am still listed as"User Awaiting Email Confirmation"

Chris
01-17-2002, 09:20 PM
<i>Doesn't anyone (besides eva ) find this hack usefull?</i>

You saved my day!

Yes, I found it very useful!! Thanks!!!

Shenlong
01-17-2002, 10:08 PM
Parse error: parse error in /usr/home/teleblaze/public_html/phpforums/admin/functions.php on line 792

Fatal error: Call to undefined function: vbdate() in /usr/home/teleblaze/public_html/phpforums/admin/sessions.php on line 357


Plz help, dont know whats wrong

Shenlong
01-17-2002, 10:10 PM
just for ur information, this hack totally ****ed up my forums, i cant even delete stuff in admin cp. so, im ****ed up now (language, sorry, im mad)

Shenlong
01-17-2002, 10:16 PM
sorry, that copy of functions.php I used was totally corrupt, just installed, works WONDERFUL! thanks so much!

Jawelin
01-18-2002, 05:30 PM
Sorry, but don't manage to make 'resend activation' works for group=3 users.... :surprised

.. runnin' 2.2.1

???

Thanks a lot

Stretchr
01-18-2002, 05:59 PM
I believe you want
$contactuslink

Does anyone know the variable to use for the webmaster email, rather than hard-coding it as I have done?

Arathorn
01-18-2002, 06:54 PM
Thanks! This DEFINATELY should be part of the next vb release. Some users can be such a pain.

Jawelin
01-18-2002, 09:09 PM
Originally posted by stilger
Did you try and register a user then try to log in without activating your account and see if you get the message to click to resend activation code etc?
Resend doesn't work for me on 2.2.1 .... :noid: I think the hacked code intercepts the flow before an user could enter the register.php to resend himself the activation email...
Does it ?

mvigod
01-26-2002, 01:59 PM
This little hack is a godsend! :)

Thanks.

Have it on 2.2.1 and the resend email works fine for me...just tested it.

marc

Nam
02-05-2002, 10:17 PM
this doesn't work on 2.2.2, I click on resend, nothing happened, the page flash a bit and go back to the way it is.

Jawelin
02-06-2002, 06:32 AM
Originally posted by mvigod
This little hack is a godsend! :)

Thanks.

Have it on 2.2.1 and the resend email works fine for me...just tested it.

marc
I have email verification and new users moderation.
When a new user clicks 'resend activation', he is shown again the same 'unregistered' page from he came.
:confused:

Mas*Mind
02-12-2002, 10:42 AM
The title says it was meant to be for version 2.2.1, but that's not correct (bug?). If I remember correctly I made it for version 2.01 and since then a couple of thing change. So beware of that! Currently I don't have time and resources to update it, so you have to do it with this I'm afraid

aldamon
03-07-2002, 01:53 PM
Good to go in 2.2.3!

LamBras
03-21-2002, 09:38 AM
Anyone on 2.2.4?
I just installed this hack (which could be my day saver), but I just got

Parse error: parse error in /dvdboard/forum/admin/functions.php on line 1546

Fatal error: Call to undefined function: vbdate() in /dvdboard/forum/admin/sessions.php on line 357

Reverting to default file solves this (of course), templates are all there, /me is clueless.
Thanks for your advice.

LamBras
03-21-2002, 12:58 PM
I just realized that 2.2.4 has this function already built-in.

Use the URL www.yourforum.com/register.php?action=requestemail
You can include this link in a specific errormessage in error_nopermission_loggedin template.

Heineken77
07-15-2002, 01:22 AM
Sweet hack! Thanks :)

sabret00the
06-01-2003, 01:20 PM
very usefull little hack