Menu

PHP 4.0.6

Help
2003-04-22
2003-04-23
  • Nobody/Anonymous

    Hi,
    First, congrads for this great script ! :)

    Here's my problem :
    I'm using the 4.0.6 version of PHP (on a Linux box), so I changed all the $_GET, $_POST, $_SERVER and $_SESSION by $HTTP_xxx_VARS, including in header.php and footer.php of the theme I'm using.
    But when I'm still unable to login...

    I don't get any error message (even before getting redirected to index.php)

    What else should I do ?

    thanks.

     
    • Nobody/Anonymous

      Ok I found out where the session problem was and I changed this portion of code :

      // Log user in if post variables are defined from form
      if (($HTTP_POST_VARS['logmein']) && ($HTTP_POST_VARS['username']) && ($HTTP_POST_VARS['password'])) {

        //Make sure nobody tries to be shifty
        //unset($HTTP_SESSION_VARS['isadmin']);
        session_unregister('isadmin');
        $result1=db_query("SELECT userid,password,fullname,email,theme,admin FROM ".$prefix."users WHERE username='".$HTTP_POST_VARS['username']."'");
        $num_rows1 = db_num_rows($result1);
        list($userid,$pwd,$fullname,$user_email,$user_theme,$isadmin)=db_fetch_array($result1);
        if (($num_rows1 > 0) && (md5($HTTP_POST_VARS['password']) == $pwd)) {
          //$HTTP_SESSION_VARS['userid'] = $userid;
          session_register('userid');
          //$HTTP_SESSION_VARS['isloggedin'] = $glbl_hash;
          $isloggedin=$glbl_hash;
          session_register('isloggedin');
          //$HTTP_SESSION_VARS['user_theme'] = $user_theme;
          session_register('user_theme');
          //$HTTP_SESSION_VARS['fullname'] = $fullname;
          session_register('fullname');
          //$HTTP_SESSION_VARS['user_email'] = $user_email;
          session_register('user_mail');
          //$HTTP_SESSION_VARS['username'] = $HTTP_POST_VARS['username'];
          session_register('username');
            if ($isadmin == 1) {
              $isadmin = $glbl_hash;
              //$HTTP_SESSION_VARS['isadmin'] = $isadmin;
              session_register('isadmin');
            }
        }
      }

      But now I don't get redirected  instantly to index.php. I must obviously change the $HTTP_SESSION_VARS['isloggedin'] ...

       
      • Brad Fears

        Brad Fears - 2003-04-22

        I'm surprised you had so much trouble.  I was able to test on an installation of 4.0.6 (linux) and it worked without issue.  I wonder what's different between my setup and yours.

        The code you modified was designed to work with 'register_globals' turn Off in the php.ini, and it appears that you have it On, or your session_register() functions would not work.

        So after changing the IF and ELSE in the last part of the user.php, did everything function properly?

        --Brad Fears

         
    • Nobody/Anonymous

      yes my register_globals is set to ON (booh!)

      I changed indeed the last part of user.php, and everything is working fine now.

      By the way, are you planning to translate phpCC ?

      chicobra.

       
      • Brad Fears

        Brad Fears - 2003-04-22

        I hadn't _planned_ on it, but that could be a potential feature for future versions.  What language(s) did you have in mind?  Are you willing to help..?

         
        • Nobody/Anonymous

          sure, I can give you the french translation as least, and maybe the german one (if I still remember...)

           
          • Brad Fears

            Brad Fears - 2003-04-23

            That works for me.  Send me your email address so I have a way to contact you when I start working on the languages.

            You can send the address to 'brad_fears@users.sourceforge.net'.

            Thanks
            --Brad Fears

             

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.