FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


phpNuke Register new users Problem Problem





mike_phi
Hi all, I am experiencing a problem with my Phpnuke powered site, it seems to be with the post method.

I have turned register_globals to on in my .httacces file and I can see the it is on but after the confirmation message in PHPnuke I press finish button I noticed that the global variables are not in the _POST[....

as it should be in the phpinfo prinout. the strange thing is that this exact site works on my local machine so its some configuration issue

Has anybody else experienced problems with register new users in phpnuke

this is the method in the "Your Account" module that is not working it is not passing the global variable so the finishNewuser method is never called.

here is the mothed where the symptom of the fault is caused

Code:
function confirmNewUser($username, $user_email, $user_password, $user_password2, $random_num, $gfx_check) {
   global $stop, $EditedMessage, $sitename, $module_name, $minpass;
   include("header.php");
   include("config.php");
   filter_text($username);
   $username = $EditedMessage;
   $user_viewemail = "0";
   userCheck($username, $user_email);
   if (!$stop) {
      $datekey = date("F j");
      $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $_POST[random_num] . $datekey));
      $code = substr($rcode, 2, 6);
      if (extension_loaded("gd") AND $code != $gfx_check AND ($gfx_chk == 3 OR $gfx_chk == 4 OR $gfx_chk == 6 OR $gfx_chk == 7)) {
         title(""._NEWUSERERROR."");
         OpenTable();
         echo "<center><b>"._SECCODEINCOR."</b><br><br>"
         .""._GOBACK."</center>";
         CloseTable();
         include("footer.php");
         die();
      }
      if ($user_password == "" AND $user_password2 == "") {
         $user_password = makepass();
      } elseif ($user_password != $user_password2) {
         title(""._NEWUSERERROR."");
         OpenTable();
         echo "<center><b>"._PASSDIFFERENT."</b><br><br>"._GOBACK."</center>";
         CloseTable();
         include("footer.php");
         die();
      } elseif ($user_password == $user_password2 AND strlen($user_password) < $minpass) {
         title(""._NEWUSERERROR."");
         OpenTable();
         echo "<center>"._YOUPASSMUSTBE." <b>$minpass</b> "._CHARLONG."<br><br>"._GOBACK."</center>";
         CloseTable();
         include("footer.php");
         die();
      }
      title("$sitename: "._USERREGLOGIN."");
      OpenTable();
      //phpinfo();
      echo "<center><b>"._USERFINALSTEP."</b><br><br>$username, "._USERCHECKDATA."</center><br><br>"
      ."<table align='center' border='0'>"
      ."<tr><td><b>"._UUSERNAME.":</b> $username<br></td></tr>"
      ."<tr><td><b>"._EMAIL.":</b> $user_email</td></tr></table><br><br>"
      ."<center><b>"._NOTE."</b> "._YOUWILLRECEIVE."";
      echo "<form action=\"modules.php?name=$module_name\" method=\"post\">"
      ."<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">"
      ."<input type=\"hidden\" name=\"gfx_check\" value=\"$gfx_check\">"
      ."<input type=\"hidden\" name=\"username\" value=\"$username\">"
      ."<input type=\"hidden\" name=\"user_email\" value=\"$user_email\">"
      ."<input type=\"hidden\" name=\"user_password\" value=\"$user_password\">"
      ."<input type=\"hidden\" name=\"op\" value=\"finish\"><br><br>"
      ."<input type=\"submit\" value=\""._FINISH."\"> &nbsp;&nbsp;"._GOBACK."</form></center>";
      CloseTable();
   } else {
      OpenTable();
      echo "<center><font class=\"title\"><b>Registration Error!</b></font><br><br>";
      echo "<font class=\"content\">$stop<br>"._GOBACK."</font></center>";
      CloseTable();
   }
   include("footer.php");
}


here is the expected output from phpinfo


Code:
PHP_SELF  /modules.php 
_REQUEST["name"] Your_Account
_REQUEST["random_num"] no value
_REQUEST["gfx_check"] no value
_REQUEST["username"] test192
_REQUEST["user_email"] test192@hot.com
_REQUEST["user_password"] test192
_REQUEST["op"] finish
_REQUEST["lang"] english
_REQUEST["user"] no value
_GET["name"] Your_Account
_POST["random_num"] no value
_POST["gfx_check"] no value
_POST["username"] test192
_POST["user_email"] test192@hot.com
_POST["user_password"] test192
_POST["op"] finish
_COOKIE["lang"] english



the actual error output on my site is the following notice there is no post


Code:
PHP_SELF  /modules.php 
_REQUEST["name"] Your_Account
_REQUEST["lang"] english
_REQUEST["user"] no value
_GET["name"] Your_Account
_COOKIE["lang"] english
_COOKIE["user"] no value
_SERVER["DOCUMENT_ROOT"] /domains/<my domain>/public_html
_SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["HTTP_COOKIE"] lang=english; user=
_SERVER["HTTP_HOST"]


can someon help

cheers Mic
mike_phi
Hi to all that have viewed this post, I actually solved it a few weeks ago but I thought I would share my findings as it is an interesting problem.

Before i proceed I would be interested to know how the other PhpNuke sites managed to continue working normally and not require any mods inorder for the register new members to work.

After isolating the problem on my private development mechine and recreating the problem by setting register_globals to off, I tried editing .httacces and as on the online version that did not work, this made me happy as I manged to recreate the fault.

I then manged to fully debug the fault in the offline environment and foud the problem to be the old "register_globals ", so I had to modify the actuall phpnuke code to compansate for this by explicidly checking for all the global dependancies and hey presto it worked, I then deployed the fix to my online version and its running fine.

I then started to wonder how the other Nuke sites where not affected by this register_globals thing.

None the less this issue was solved and if anyone needs help be sure to slip me a note

cheers Mic
Related topics
FTP User Pass Invalid?
how do you get linux
Statistics
New server on DirectAdmin
How to install phpnuke with new server on directadmin??
Do new accounts have Cpanel?
Hmm.. Perhaps a chance for misusers?
Less main sections
Why you should not be using Ubuntu!
India adds record 3.2 million GSM mobile users in December
How do I debug my site, How to turn log_errors on
Make New Users Read Sticky's before creating new topics
Captcha for new users
What is easier for the moderators?
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.