[RC1] Registration Auth Code (RAC)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
LoLoGo
Registered User
Posts: 12
Joined: Sat Jul 19, 2008 3:55 pm
Location: Ireland

Re: [RC1] Registration Auth Code (RAC)

Post by LoLoGo » Mon Sep 08, 2008 1:24 pm

Thanks ric323, you're a genius.
I must have changed the file extension on lang_main by accident, doh!
:roll:

It seems to be back working so thank you!
I will just sit back now and see if the RAC Mod does the trick and rids me of those pesky spammers!
:D

Exon_ex
Registered User
Posts: 13
Joined: Sat Oct 23, 2004 3:23 pm

Re: [RC1] Registration Auth Code (RAC)

Post by Exon_ex » Mon Sep 22, 2008 6:38 am

Thank you for the mod, it was extremely helpful :) .

didydog
Registered User
Posts: 4
Joined: Thu Sep 25, 2008 3:36 pm

Re: [RC1] Registration Auth Code (RAC)

Post by didydog » Thu Sep 25, 2008 3:40 pm

Hello, and thanks for creating mods and tutorials for those of us that are just beginning. I attempted to install the RAC mod, but after saving, I got this error message on my page when trying to access it:

Parse error: syntax error, unexpected T_DEC, expecting T_STRING or T_VARIABLE or '$' in /home/palmer15/public_html/discusionforum/language/lang_english/lang_main.php on line 1023

Can you help???

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: [RC1] Registration Auth Code (RAC)

Post by AsciiSector » Thu Sep 25, 2008 4:52 pm

What's on line 1023 of your lang_main.php file?

didydog
Registered User
Posts: 4
Joined: Thu Sep 25, 2008 3:36 pm

Re: [RC1] Registration Auth Code (RAC)

Post by didydog » Thu Sep 25, 2008 7:12 pm

I'll start with line 1023 and give you the rest of the lines in the 'pasted' code.

----># Hint: Change the third definition to say where the code will be displayed. The ---->link is
---# there as a guidelines; you don't necessarily need to use it.
---# You may also change $lang['rac_location'] to a question, to which the code is ---the answer.
---# Examples: http://www.marshalrusty.com/phpBB/spam/description.gif and ---http://www.marshalrusty.com/phpBB/spam/question.gif
---#
// RAC MOD Begin
$lang['rac_incorrect'] = 'The authorization code you have entered is incorrect. The location of the code should be stated on the registration page. Please try again.';
$lang['rac_code'] = 'Authorization Code';
$lang['rac_location'] = 'You can find the auth code on the following page: <a href="http://wwww.yoursite.com">Location Title</a>';
// RAC MOD End

didydog
Registered User
Posts: 4
Joined: Thu Sep 25, 2008 3:36 pm

Re: [RC1] Registration Auth Code (RAC)

Post by didydog » Thu Sep 25, 2008 7:28 pm

Ok, I found the problem --- sorry to waste your time,

But, you know I don't get the captcha, or the auth code field or anything when I register. Check it out, if you don't mind, and see what's wrong.

www.theteenroom.com - this is where one must sign up,

www.theteenroom.com/discusionforum/index.php

I'm so sick of spammers putting their porn and crap on my site!!!! HELP???!!!!!

User avatar
ric323
Former Team Member
Posts: 22908
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: [RC1] Registration Auth Code (RAC)

Post by ric323 » Thu Sep 25, 2008 10:53 pm

didydog wrote:Ok, I found the problem --- sorry to waste your time,

But, you know I don't get the captcha, or the auth code field or anything when I register. Check it out, if you don't mind, and see what's wrong.

http://www.theteenroom.com - this is where one must sign up,

http://www.theteenroom.com/discusionforum/index.php

I'm so sick of spammers putting their porn and crap on my site!!!! HELP???!!!!!
There is no register link on your board. Is it hidden somewhere?

Edit: I found a small "sign up" link on your main page, but that is NOT going to the phpBB register page, so of course the RAC MOD won't affect it!
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

didydog
Registered User
Posts: 4
Joined: Thu Sep 25, 2008 3:36 pm

Re: [RC1] Registration Auth Code (RAC)

Post by didydog » Fri Sep 26, 2008 3:00 pm

Well, the company that developed the site suggested that it be done this way. If you sign up on the index page, then you automatically become a member of the phpboard. I was hoping that adding the mod would create that field. Besides recreating the page, is there anything else that I can do??

chopnation
Registered User
Posts: 2
Joined: Sun Sep 28, 2008 1:14 am
Contact:

Re: [RC1] Registration Auth Code (RAC)

Post by chopnation » Sun Sep 28, 2008 1:29 am

I would love to get this mod to work, but I must have messed up at some point. After changing the three files in question with NoteTab Light, I uploaded the files via FTP Explorer. I logged out of my account and then tried to register. However, I did not see the RAC text box (I attempted to make it a question relevant to our forum).

After messing with it in effort to try to figure out where I went wrong, I gave up and after a couple of days, noticed that there were no spammers. I again checked the registration page and again, saw no RAC box. Filling out the form, I submitted and did get the page that would tell users that their RAC was incorrect.

That makes me think that there is either an error in the usercp_register.php or profile_add_body.tpl. I downloaded the files directly from the server to attempt to see if during my upload, the server or something messed up the files. It does not appear that way, but here are the relevant codes with what is immediately in front and what is immediately after. Any help would be appreciated.

If you would like to see the board itself... http://www.chopnation.com/bravesboard/index.php

profile_add_body.tpl

Code: Select all

	<tr> 
	  <td class="row1"><span class="gen">{L_CONFIRM_PASSWORD}: * </span><br />
		<span class="gensmall">{L_PASSWORD_CONFIRM_IF_CHANGED}</span></td>
	  <td class="row2"> 
		<input type="password" class="post" style="width: 200px" name="password_confirm" size="25" maxlength="32" value="{PASSWORD_CONFIRM}" />
	  </td>
	</tr>
	<!-- BEGIN switch_user_logged_out -->
	<tr> 
	  <td class="row1"><span class="gen">{L_RAC_CODE}: * </span><br />
		<span class="gensmall">{L_RAC_LOCATION}</span></td>
	  <td class="row2"> 
		<input type="text" class="post" style="width: 200px" name="RAC" size="25" maxlength="32" />
	  </td>
	</tr>
	<!-- END switch_user_logged_out -->
	<!-- Visual Confirmation -->
	<!-- BEGIN switch_confirm -->
	<tr>
		<td class="row1" colspan="2" align="center"><span class="gensmall">{L_CONFIRM_CODE_IMPAIRED}</span><br /><br />{CONFIRM_IMG}<br /><br /></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_CONFIRM_CODE}: * </span><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
	  <td class="row2"><input type="text" class="post" style="width: 200px" name="confirm_code" size="6" maxlength="6" value="" /></td>
	</tr>
usercp_register.php

Code: Select all

	if ( $mode == 'editprofile' )
	{
		if ( $user_id != $userdata['user_id'] )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Wrong_Profile'];
		}
	}
	else if ( $mode == 'register' )
	{
				// RAC MOD Begin
      if ($HTTP_POST_VARS['RAC'] != '1995')
        {
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['rac_incorrect'];
        }
		// RAC MOD End
	if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
		}
	}

	if ($board_config['enable_confirm'] && $mode == 'register')
	{
		if (empty($HTTP_POST_VARS['confirm_id']))
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
		}
and...

Code: Select all

		'L_CONFIRM_CODE'			=> $lang['Confirm_code'],
		'L_CONFIRM_CODE_EXPLAIN'	=> $lang['Confirm_code_explain'],
		// RAC MOD Begin
		'L_RAC_CODE' 		=> $lang['rac_code'],
		'L_RAC_LOCATION'	=> $lang['rac_location'], 
		// RAC MOD End
		'S_ALLOW_AVATAR_UPLOAD' => $board_config['allow_avatar_upload'],
		'S_ALLOW_AVATAR_LOCAL' => $board_config['allow_avatar_local'],
I appreciate any help you may provide.

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: [RC1] Registration Auth Code (RAC)

Post by AsciiSector » Sun Sep 28, 2008 10:14 am

Did you add the RAC mod code to all your profile_add_body.tpl styles and not just your subSilver one?

User avatar
ric323
Former Team Member
Posts: 22908
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: [RC1] Registration Auth Code (RAC)

Post by ric323 » Sun Sep 28, 2008 10:28 am

chopnation wrote:I would love to get this mod to work, but I must have messed up at some point. After changing the three files in question with NoteTab Light, I uploaded the files via FTP Explorer. I logged out of my account and then tried to register. However, I did not see the RAC text box (I attempted to make it a question relevant to our forum).
...
As with any MOD, if you are running a modified style (i.e. NOT the default subSilver style), then any changes to the TPL file have to be made to ALL the style on your board.
You have made the changes to subSilver, but your board defaults to using the "ca_aphrodite" style, so the changes to profile_add_body.tpl must be made in the ca_aphrodite version also.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

chopnation
Registered User
Posts: 2
Joined: Sun Sep 28, 2008 1:14 am
Contact:

Re: [RC1] Registration Auth Code (RAC)

Post by chopnation » Mon Sep 29, 2008 12:36 am

Ah, yes, it's always something dumb. :lol:

Okay, now I got something else wrong. I changed the ca_aphrodite one and went through it. The only odd thing was that it asked the RAC twice (as in the same question twice followed by the confirmation visual code). However, it registered the account. Via the admintoolkit, I deleted the account rather than confirm the e-mail (which wasn't sent to a real e-mail account anyway).

I then, as was suggested previously, changed the rest of the profile_add_body.tpl's. Now, when I log out and try to register, I get...

Code: Select all

Could not delete stale confirm data

DEBUG MODE

SQL Error : 2006 MySQL server has gone away

DELETE FROM bravesbb_confirm WHERE session_id NOT IN ('00007f095039fe36963ec1809c781ca5',

...(numbers/code continue for a great many lines)
What did I do wrong and can I fix it?

http://www.chopnation.com/bravesboard/p ... greed=true

bobfather
Registered User
Posts: 2
Joined: Fri Oct 03, 2008 8:44 pm

Re: [RC1] Registration Auth Code (RAC)

Post by bobfather » Fri Oct 03, 2008 8:55 pm

I'm having trouble with this code and I get the following error. any help would be greatly appreciated!
I'm using phpbb2 and not using SubSilver but modified the correct "profile_add_body.tpl" file.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/sdunc3/public_html/includes/usercp_register.php on line 1205
lines 1195 through 1215 are posted:

Code: Select all

		'L_ITEMS_REQUIRED' => $lang['Items_required'],
		'L_REGISTRATION_INFO' => $lang['Registration_info'],
		'L_PROFILE_INFO' => $lang['Profile_info'],
		'L_PROFILE_INFO_NOTICE' => $lang['Profile_info_warn'],
		'L_EMAIL_ADDRESS' => $lang['Email_address'],

		'L_CONFIRM_CODE_IMPAIRED'	=> sprintf($lang['Confirm_code_impaired'], '<a href="mailto:' . $board_config['board_email'] . '">', '</a>'), 
		'L_CONFIRM_CODE'			=> $lang['Confirm_code'], 
		'L_CONFIRM_CODE_EXPLAIN'	=> $lang
// RAC MOD Begin
		'L_RAC_CODE' 		=> $lang['rac_code'],
		'L_RAC_LOCATION'	=> $lang['rac_location'], 
		// RAC MOD End

['Confirm_code_explain'], 

		'S_ALLOW_AVATAR_UPLOAD' => $board_config['allow_avatar_upload'],
		'S_ALLOW_AVATAR_LOCAL' => $board_config['allow_avatar_local'],
		'S_ALLOW_AVATAR_REMOTE' => $board_config['allow_avatar_remote'],
		'S_HIDDEN_FIELDS' => $s_hidden_fields,
		'S_FORM_ENCTYPE' => $form_enctype,

User avatar
momentum
Registered User
Posts: 1505
Joined: Thu Sep 20, 2007 4:07 am
Location: Melbourne, Australia

Re: [RC1] Registration Auth Code (RAC)

Post by momentum » Fri Oct 03, 2008 9:26 pm

You've made an error in one of your edits.

this...

Code: Select all

      'L_CONFIRM_CODE_EXPLAIN'   => $lang
// RAC MOD Begin
      'L_RAC_CODE'       => $lang['rac_code'],
      'L_RAC_LOCATION'   => $lang['rac_location'],
      // RAC MOD End

['Confirm_code_explain'],
should look like this...

Code: Select all

      'L_CONFIRM_CODE_EXPLAIN'	=> $lang['Confirm_code_explain'],
      // RAC MOD Begin
      'L_RAC_CODE'       => $lang['rac_code'],
      'L_RAC_LOCATION'   => $lang['rac_location'],
      // RAC MOD End
Craig.
QOTY: phpBB is free, good hosting is not. - robert (Lumpy Burgertushie)

bobfather
Registered User
Posts: 2
Joined: Fri Oct 03, 2008 8:44 pm

Re: [RC1] Registration Auth Code (RAC)

Post by bobfather » Fri Oct 03, 2008 10:26 pm

thanks for your help craig. i really appreciate it!

Post Reply

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 5 guests

cron