Author |
Message |
abuy
New Member


Joined: Mar 27, 2006
Posts: 4
|
Posted:
Mon Apr 03, 2006 11:50 pm |
|
any body know how to change the securtiy key in phpnuke 7.9, coz i wanna change the security key 6 digit to 8 digit and combine alphabet and number ? |
|
|
|
 |
evaders99
Former Moderator in Good Standing

Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Tue Apr 04, 2006 7:31 am |
|
In mainfile.php
Change the line
Code:
$code = substr($rcode, 2, 6);
|
|
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
 |
jaiib
New Member


Joined: Apr 06, 2007
Posts: 11
Location: India
|
Posted:
Fri Apr 06, 2007 10:34 pm |
|
Dear Sir,
Plz Guide me How can i change Security Image in Security Code,
where is Images file, Is it Possible or not,
Plz guide me
Thanks |
_________________ Best Regards
JAIIB TEAM |
|
|
 |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Sat Apr 07, 2007 7:38 am |
|
What version of Nuke are you using? |
|
|
|
 |
jaiib

|
Posted:
Sat Apr 07, 2007 11:21 am |
|
Dear Sir,
I am Using 7.9 version of Php-nuke,
Plz Guide me How can i change Security Image in Security Code,
where is Images file, Is it Possible or not,
Plz guide me
Thanks |
|
|
|
 |
godfather
New Member


Joined: Mar 01, 2007
Posts: 11
Location: Yorkshire
|
Posted:
Thu Jul 26, 2007 12:31 pm |
|
evaders99 wrote: | In mainfile.php
Change the line
Code:
$code = substr($rcode, 2, 6);
| |
Change it to what please? |
_________________ Only registered users can see links on this board! Get registered or login!
(where all Xp updates can be had without validation Legally)
Cos When I bought XP Validation was not required! |
|
|
 |
godfather

|
Posted:
Thu Jul 26, 2007 11:01 pm |
|
As usual found out myself as help on these forums comes very slow and note cos I did not use code tags the number eight comes up as the cool emotion so where ever you see the cool emotion just put the number eight and ); next to it..
This guide will show you in a very simple way how to change the PHPNUKE captcha from 6 to 8 digits.
1) Make sure that your $gfx_chk in the config.php is set to other than 0, normally it is 7 .if you want to use captcha everywhere on all login options.
2) Fire up your mainfile.php in your text editor such as notepad.
Make a search with your text editor to find function loginbox() - it is around line 950 (it might differs from one to another depending on the version of your phpnuke and whether this file has been modified before or not).
Look at the original codings:
function loginbox() {
global $user, $sitekey, $gfx_chk;
mt_srand ((Double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 6);
Carefully, change the last line to
$code = substr($rcode, 2, ;
Then scroll nearly to the bottom of the file
Switch($gfx) {
case "gfx":
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 6);
Yes change the last line too, so that it will become
$code = substr($rcode, 2, ;
We have to give an extra 2 spaces in the box for users to write the Security Code.
NOW go to function loginbox() line just now and find
$boxstuff .= ""._TYPESECCODE."
<input type="text" NAME="gfx_check" SIZE="7" MAXLENGTH="6">n";
change it to
$boxstuff .= ""._TYPESECCODE."
<input type="text" NAME="gfx_check" SIZE="9" MAXLENGTH="8">n";
Done for this file.
Save this mainfile.php.
3) Now go to module/Your_Account and open the index.php found in the module in your Text editor.
There are quite a number of lines to be changed here, however it is not a so difficult task.
All what you have to do is to change
$code = substr($rcode, 2, 6);
to
$code = substr($rcode, 2, ;
There are 2 places need to be changed in this file (unless you are using a customized or a different set of Your Acount module) (there was three instances in mine so look hard or it will not work) namely at
a) function confirmNewUser($username, $user_email, $user_password, $user_password2, $random_num, $gfx_check)
b) function finishNewUser($username, $user_email, $user_password, $random_num, $gfx_check)
Don't touch any line yet except changing
$code = substr($rcode, 2, 6);
to
$code = substr($rcode, 2, ;
NOW, we have to give an extra 2 spaces in the box for users to write the Security Code.
They are located at 2 places
function main($user) and
function new_user()
find at both locations:
<input type="text" NAME="gfx_check" SIZE="7" MAXLENGTH="6">
change them to
<input type="text" NAME="gfx_check" SIZE="9" MAXLENGTH="8">
Save this index.php file.
4) If you are using a userinfo block or login block where a login is enabled from the block then open your block-Userinfo.php (or whatever the file name which you used for user login) in nuke/blocks.
<input type="text" NAME="gfx_check" SIZE="7" MAXLENGTH="6">
the same should be done as recent changes that is giving an extra spaces for the login box, so change it now to:
<input type="text" NAME="gfx_check" SIZE="9" MAXLENGTH="8">
Save your block-Userinfo.php
Almost done, but wait there is another file that is admin.php
5) Fire up your admin.php file in your text editor.
Do the same as the above that is changing
<input type="text" NAME="gfx_check" SIZE="7" MAXLENGTH="6">
to
<input type="text" NAME="gfx_check" SIZE="9" MAXLENGTH="8">
Save your admin.php
Thats all folks.
While under no circu mtances that I guarantee this changes will resist against any automated actions 100%, however it can minimize them as you are now using a non-standard PHPNUKE captcha which is is using 6 digits.
Yours is 8!
LATEST
If the captcha is difficult to read i.e. the number does not appear correctly at the center of the image that resulted in an unreadable last figure, then open up your mainfile.php,
at case "gfx" find for this line:
ImageString ($image, 5, 12, 2, $code, $text_color);
alter it to
ImageString ($image, 5, 2, 2, $code, $text_color);[/code] |
|
|
|
 |
jakec

|
Posted:
Fri Jul 27, 2007 2:01 am |
|
Firstly thank you for posting your detailed explanation, I'm sure people will find it extremely useful.
godfather wrote: | As usual found out myself as help on these forums comes very slow and note cos I did not use code tags the number eight comes up as the cool emotion so where ever you see the cool emotion just put the number eight and ); next to it |
The RN team try to respond to posts ASAP, but unfortunately everybody does this in their spare time and occasionally it may take a little bit longer for a reply. There is less than 12 hours difference between your first post and your next reply, please be patient. ;o)
Also why not use the code tags? They help to make the posts more readable and also makes it easier to cut and paste the code.
Thanks again for your help.
Jakec |
|
|
|
 |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Fri Jul 27, 2007 7:26 am |
|
godfather wrote: | As usual found out myself as help on these forums comes very slow |
And how much did you pay for support on these forums? Really nice bashing a bunch of volunteers and enthusiasts. Thanks for posting a solution though. |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
|