[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.
hippychic
Registered User
Posts: 4
Joined: Fri Dec 28, 2007 10:52 am

Re: [RC1] Registration Auth Code (RAC)

Post by hippychic » Fri Dec 28, 2007 11:04 am

I added the mod, it works fine but..

at the top of the registration page shows the error message [Your answer for the authorisation question is incorrect. Please try again.], before filling in the registration form. It does show up with the error when placing an incorrect answer, denying access so I know this works well.

Can you assist me in correcting this minor glitch, to remove the error from the registration page.
Last edited by hippychic on Sat Dec 29, 2007 8:30 pm, edited 1 time in total.

gomaria
Registered User
Posts: 17
Joined: Wed Apr 11, 2007 8:54 am

Re: [RC1] help unconfuse me.

Post by gomaria » Sat Dec 29, 2007 4:50 am

I downloaded the RAC MOD instructions and read them.

It says "If you wish to make it even simpler, you may change the $lang['rac_location'] (below) to a question,
such as "How many fingers do people have?" or "What color is the sky?" and make the RAC code the answer."

That's what I want to do.

So, do I follow the steps as outlined in the instructions?

Do I just modify the $lang['rac_location']?

OR do I do both or none of the above :mrgreen:

hippychic
Registered User
Posts: 4
Joined: Fri Dec 28, 2007 10:52 am

Re: [RC1] Registration Auth Code (RAC)

Post by hippychic » Sat Dec 29, 2007 6:28 am

hippychic wrote:at the top of the registration page shows the error message [Your answer for the authorisation question is incorrect. Please try again.], before filling in the registration form. It does show up with the error when placing an incorrect answer, denying access so I know this works
I corrected this, by altering the includes/usercp_register.php I had mistakenly placed it under "if ( $mode == 'register' )" not "else if ( $mode == 'register' )
{"
as found further down the page.

One happy hippy now is spam free. Thanks for this great mod.

hippychic
Registered User
Posts: 4
Joined: Fri Dec 28, 2007 10:52 am

Re: [RC1] help unconfuse me.

Post by hippychic » Sat Dec 29, 2007 6:42 am

gomaria wrote: It says "If you wish to make it even simpler, you may change the $lang['rac_location'] (below) to a question,
such as "How many fingers do people have?" or "What color is the sky?" and make the RAC code the answer."
To make mine a question I altered the following, plus keeping the other pages as directed

includes/usercp_register.php
alter to:
// RAC MOD Begin
if ($HTTP_POST_VARS['RAC'] != 'blue')
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['rac_incorrect'];
}
// RAC MOD End

language/lang_english/lang_main.php
alter to:
// RAC MOD Begin
$lang['rac_incorrect'] = 'Your answer for the authorization question is incorrect. Please try again.';
$lang['rac_code'] = 'Authorization Question';
$lang['rac_location'] = 'What color is the sky? (all in lower case)';
// RAC MOD End

gomaria
Registered User
Posts: 17
Joined: Wed Apr 11, 2007 8:54 am

Re: [RC1] Registration Auth Code (RAC)

Post by gomaria » Sat Dec 29, 2007 11:04 am

So if I understand your answer....

I just have to change those two parts and not follow the rest of the MODs instruction?

gomaria
Registered User
Posts: 17
Joined: Wed Apr 11, 2007 8:54 am

Re: [RC1] Registration Auth Code (RAC)

Post by gomaria » Sat Dec 29, 2007 11:38 am

To hippie's instructions this also needs fixing... for the question you want to appear. This part of the code allows the question to actually appear on the form. So there are three things to change...



templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<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>

#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- 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 -->


URIKA We have lift off! Thanks everyone for your help! Now I'm going to see what else I need to change :)

hippychic
Registered User
Posts: 4
Joined: Fri Dec 28, 2007 10:52 am

Re: [RC1] Registration Auth Code (RAC)

Post by hippychic » Sat Dec 29, 2007 8:29 pm

The full details to change to a question

We shall use for an example 'what color is the sky?' with the answer 'blue'

Files To Edit: includes/usercp_register.php
language/lang_english/lang_main.php
templates/subSilver/profile_add_body.tpl

-----[ OPEN ]------------------------------------------
includes/usercp_register.php

-----[ FIND ]------------------------------------------
else if ( $mode == 'register' )
{

-----[ AFTER, ADD ]------------------------------------------

// RAC MOD Begin
if ($HTTP_POST_VARS['RAC'] != 'blue')
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['rac_incorrect'];
}
// RAC MOD End


-----[ FIND ]------------------------------------------
'L_CONFIRM_CODE_EXPLAIN' => $lang['Confirm_code_explain'],


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

-----[ SAVE/CLOSE FILE ]------------------------------------------
-----[ OPEN ]------------------------------------------

language/lang_english/lang_main.php


-----[ FIND ]------------------------------------------

//
// That's all, Folks!
// -------------------------------------------------


-----[ BEFORE, ADD ]------------------------------------------
// RAC MOD Begin
$lang['rac_incorrect'] = 'Your answer for the authorization question is incorrect. Please try again.';
$lang['rac_code'] = 'Authorization Question';
$lang['rac_location'] = 'What color is the sky? (all in lower case)';
// RAC MOD End


-----[ SAVE/CLOSE FILE ]------------------------------------------
-----[ OPEN ]------------------------------------------

templates/subSilver/profile_add_body.tpl


-----[ FIND ]------------------------------------------

<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>


-----[ AFTER, ADD ]------------------------------------------

<!-- 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 -->


-----[ SAVE/CLOSE FILE ]------------------------------------------

NapoLoso
Registered User
Posts: 12
Joined: Tue Sep 26, 2006 5:58 pm
Location: Orange County, California
Contact:

Re: [RC1] Registration Auth Code (RAC)

Post by NapoLoso » Sun Dec 30, 2007 6:16 am

Hello,
I think this is a great MOD, I tried installing it but I'm having some issues. I followed the steps carefully described in the rac.mod which i opened with WordPad. Here's an copy of what my code looks like.

First step says to do this:

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php - Here's the changes I made.

Code: Select all

{
	include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);

	$passwd_sql = '';
	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'] != 'Pink')
        {
			$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'];
		}
...then I added this as the 2nd step says:

on the same: includes/usercp_register.php

Code: Select all

		'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['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'],
		'S_ALLOW_AVATAR_REMOTE' => $board_config['allow_avatar_remote'],
		'S_HIDDEN_FIELDS' => $s_hidden_fields,
		'S_FORM_ENCTYPE' => $form_enctype,
		'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
	);
No, on the : language/lang_english/lang_main.php :

Code: Select all

$lang['Admin_reauthenticate'] = 'To administer the board you must re-authenticate yourself.';
$lang['Login_attempts_exceeded'] = 'The maximum number of %s login attempts has been exceeded. You are not allowed to login for the next %s minutes.';
$lang['Please_remove_install_contrib'] = 'Please ensure both the install/ and contrib/ directories are deleted';

// RAC MOD Begin
$lang['rac_incorrect'] = 'The authorization code you have entered is incorrect. Please try again.';
$lang['rac_code'] = 'Authorization Code';
$lang['rac_location'] = 'What color is Floyd?';
// RAC MOD End

//
// That's all, Folks!
// -------------------------------------------------

Now on the last step on the : templates/darkred/profile_add_body.tpl [ i edited the file from the style i currently use in my forums]

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 -->

I uploaded all 3 files to their respective directories and when I tried to test it and register,
some of the images (from the style i have) on the registration page did not display. Also,
after clicking the submit button, on the status bar of the browser it linked to another
directory on my site which is not even inside the template folder, not even inside the
forums folder, thus casing an error message saying that the page requested does not
exist or it's been moved. Also it slows down the loading of the reg. form process.

After replacing the edited files with the original backup copies, everything went back
to normal.

Any suggestions? I know I'm doing something wrong. I'm a php newbie and this is the first
time I try installing any mods. All help will be greatly appreciated.

Thank you very much in advanced.

-Napo
Sek Loso is the King of Rock
www.koratblues.com

Toontown
Registered User
Posts: 40
Joined: Tue Jul 17, 2007 1:12 am

Re: [RC1] Registration Auth Code (RAC)

Post by Toontown » Sun Dec 30, 2007 6:19 pm

How do you configure the answer?

EDIT: Nvm, I got it thanks!

Shyanne
Registered User
Posts: 26
Joined: Mon Jul 17, 2006 8:06 pm
Location: Arkansas

Re: [RC1] Registration Auth Code (RAC)

Post by Shyanne » Mon Dec 31, 2007 4:54 am

This is the first MOD I have tried to add to my forum. After spending 2 days and removing 1700 pesky spammers (did them individually since I did not know how to do otherwise, obviously the person I delegated that responsibility of removing the spammers dropped the ball and neglected to do it for quite some time!) I figured it was about time to do something to stop them.

I have followed the instructions and reviewed them several times but for some reason the changes to the registration process do not appear on the forum. Could it be because of one of the following:

1. The forum is still running PHPBB 2.0.21 instead of 2.0.22?
2. I edited the files from within my domain hosts file maintenance using their editor, should I have done it another way?

Also, I know I probably should have updated the forum to the newest, but am of the old school 'If it's not broke don't try to fix it' , I do however plan to update, when I do will I need to reinstall this MOD?

If you do not think it could be either of the above I will post back with the parts of the code I changed.

Thanks
Shyanne

User avatar
Jim_UK
Former Team Member
Posts: 18474
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: [RC1] Registration Auth Code (RAC)

Post by Jim_UK » Mon Dec 31, 2007 5:50 pm

The RAC mod will work with version 2.0.21 but you should always use the latest version.
The instructions relating to styles is an edit to be made to a subSilver tpl file. Did you make that edit to the template you are using?
You should also only ever use a plain text editor and upload files with a proper ftp client

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!

Shyanne
Registered User
Posts: 26
Joined: Mon Jul 17, 2006 8:06 pm
Location: Arkansas

Re: [RC1] Registration Auth Code (RAC)

Post by Shyanne » Mon Dec 31, 2007 7:03 pm

Jim_UK wrote:The RAC mod will work with version 2.0.21 but you should always use the latest version.
The instructions relating to styles is an edit to be made to a subSilver tpl file. Did you make that edit to the template you are using?
You should also only ever use a plain text editor and upload files with a proper ftp client

Jim
Jim, thank you for your reply. Yes I did make the changes to the subsilver template, that is the template I use for the forum. Can I use notepad to edit the files? How do I save them as a .php file, I only see an option to save as a .txt file? Do I just copy all the code from the .php file into a text editor and then make the changes and ftp it back? Sorry for the questions that sound so silly, I had a stroke in October and before that all this was so easy for me, now not so easy.... it is like learning all over again. I was so frustrated last night after spending most of the day trying to figure this out and reading all I could and not getting anywhere.

Shyanne

User avatar
Jim_UK
Former Team Member
Posts: 18474
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: [RC1] Registration Auth Code (RAC)

Post by Jim_UK » Mon Dec 31, 2007 7:12 pm

Yes wordpad is fine.
Right click the files (PHP or tpl) and select to open in Wordpad. Make the edits and then just click the "save" icon (small floppy disc icon) That way it will not try to save the file in any other format.
Then just ftp back to the server to overwrite the originals.

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!

Shyanne
Registered User
Posts: 26
Joined: Mon Jul 17, 2006 8:06 pm
Location: Arkansas

Re: [RC1] Registration Auth Code (RAC)

Post by Shyanne » Mon Dec 31, 2007 9:18 pm

Not sure what is going wrong, but I am getting absolutely no where. I edited the files in wordpad, saved them and uploaded them to the server and I still can not get it to work right. I am getting no error messages, but the changes do not seem to have taken place either. It does not ask for the Authorization Code on the registration page and I can register and get no error message saying I needed to enter one. Even though the new files are there on the server nothing seems to have changed anywhere. I even went back and made the changes several times to assure I did nothing wrong and uploaded again but get the same results.

Here is the location of the forum http://comanchetrailshootists.org/index.php Is there any other info I can provide to help solve this problem?

Shy
:cry:

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: [RC1] Registration Auth Code (RAC)

Post by RMcGirr83 » Mon Dec 31, 2007 9:36 pm

Please post your includes/usercp_register.php file as a text link (save the file as usercp_register.txt and upload it to your site) and provide a link.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Post Reply

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