Announcement

Collapse
No announcement yet.

login page outside vbulletin - anyone done it in vb3?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by merk
    damn im stupid

    replace that line with

    PHP Code:
        if (md5(md5($password) . $res['salt']) == $res['password']) { 
    Merk, you're a legend mate. The login module on my CMS is working perfectly again now... I owe you a beer or twelve.

    Comment


    • #17
      so would you like to tell me what i need to do now to get this on my index.php?

      Comment


      • #18
        I must be doing something stupid, I cant get it working.
        No error messages just a blank screen

        As you can see Ive added some print commands so I can see how far its getting before there is a problem.

        a and b display and thats it.

        Code:
         
        <?php 
        Print "a";
        $checkservername = "localhost";   // hostname or ip of server
        $dbcheckusername = "user";	// user name
        $dbcheckpassword = "pass";	 // user password
        $dbcheckbase	 = "database";	 // name of database
        $encryptedpw   = true;	// encrypted (md5) passwords on/off (true/false)
        $realm = "This area is for registered members only!";
        Print "b";
        if (isset($username) && isset($password)) { 
        	// Connect to MySQL 
        	 mysql_connect($checkservername,$dbcheckusername,$dbcheckpassword) 
        		or die ( 'Unable to connect to server.' ); 
        Print "c";
        	// Select database on MySQL server 
        	mysql_select_db($dbcheckbase) 
        		or die ( 'Unable to select database.' ); 
        Print "d";
        	// Formulate the query 
        # Vbulletin GROUP ID's 
        # default setting = Admin & Jnr Admin
        #
        # 1  Unregistered / Not Logged In
        # 2  Registered
        # 3  Users Awaiting Email Confirmation
        # 4  (COPPA) Users Awaiting Moderation
        # 5  JNR Admin
        # 6  Administrator
        # 7  Moderators
        # 8  Banned
        # 9  Moderated
        # 10 Gold Member
        # 11 Platinum Member
        	// Formulate the query 
        	$sql = "SELECT * FROM user WHERE 
        			username = '$username' AND 
        			(usergroupid = '6' or usergroupid = '2' or usergroupid = '7' or usergroupid = '5') "; 
        	// Execute the query and put results in $result 
        	$result = mysql_query( $sql ) 
        		or die ( 'Unable to execute query.' ); 
        $res = mysql_fetch_array($result);
        	if (md5(md5($password) . $res['salt']) == $res['password']) { 
         
        	// A matching row was found - the user is authenticated.
        	$user_reg = $username;
        	session_register("user_reg");
        	print "You have logged in!";
        	} else {
        print "Your password is not correct";
        session_unregister("user_reg");
        }
        }
        ?>

        Comment


        • #19
          Unable to make it work...

          Originally posted by M4g!k
          so would you like to tell me what i need to do now to get this on my index.php?
          Hello!

          I've seen your posting because I'm subscribed to the thread and recived an email about it. However, I'm on vacation in Mexico and paying for internet access by the minute right now. So, I'm unable to investigate this further until I return to the states next week. If I have not replied by 4/1, drop me a note or a PM or post to the string again and I'll follow-up ASAP.

          Sorry... but at by-the-minute rates, that's the best I can do.

          Best Professional Regards,
          websissy

          Comment


          • #20
            Ahhh got it working

            For those having the same problem
            PHP Code:
            <?php 
            include("/home/xxxxxxx/include/_vbbforumsconnect.php");//this file defines database connection pw, user etc.
            session_unregister("valid_user");
            session_unregister("usegroup");

            // get refering page address and reload if login is sucessfull
            $refer $_SERVER['HTTP_REFERER'];
                
            // Connect to MySQL 
                 
            mysql_connect($checkservername,$dbcheckusername,$dbcheckpassword
                    or die ( 
            'Unable to connect to server.' ); 
                
            // Select database on MySQL server 
                
            mysql_select_db($dbcheckbase
                    or die ( 
            'Unable to select database.' ); 
                
            // Formulate the query 
                
            $sql "SELECT * FROM user WHERE 
                        username = '
            $username' "
                
            // Execute the query and put results in $result 
                
            $result mysql_query$sql 
                    or die ( 
            'Unable to execute query.' ); 
            $res mysql_fetch_array($result);
             
             
            // $sqluser = "SELECT usergroupid FROM user WHERE 
             //           username = '$username' ";  
             
            $usegroup mysql_query("SELECT usertitle FROM user WHERE 
                        username = '
            $username'"
                    or die ( 
            'Unable to execute query.' ); 

            if (
            md5(md5($password) . $res['salt']) == $res['password']) { 
                
            // A matching row was found - the user is authenticated.
                
            $valid_user $username;
                
            session_register('valid_user');
            Header ('Location:' $refer); 

             
            // display redirection message and manual return link.
                
            print "You are being redirected back to where you were when you logged in.<br>";
             print 
            "If this fails please ";
             print (
            "<a href='$refer'>Click here</a> to return.");
             
                } else {
            session_unregister("valid_user");
            session_unregister("usegroup");
             
            // Display error message and link to try again.
             
            print "Your password is not correct<br>";
             print 
            "Please ";
             print (
            "<a href='$refer'>Click here</a> to return and try again.");
            }
            ?>

            Comment


            • #21
              still problems

              I use vb3 gold.

              i still have the problem that the bbuserinfo will not be pushed in the original index.
              my forum is located completly in the directory html/forum/
              my baseindex.php is in html/
              in ther i have a login (copied from the forumbase incl. md5)
              if i give my password en my pass i am logged in, because the forum recognize me, but not my base index.
              no bbuserinfos in the.
              in the 2. version we included the sessions in the base index.php and all worked, but ther seems to be chanches there, because init. php is required.
              if i include those the directories are incorect because it looks at ./includes/ instead of forum/includes.
              but it must be possible the have a site based on the forum login whitout working actually in there?

              Comment


              • #22
                Hello,

                We are in the process of integrating an outside subscription system that will allow the new subscribers to be added to the vBulletin registration and was wonder where the "salt" value is obtained. I understand the how the password is generated, but where does this "salt" value come from.

                This will be coded with Perl also
                Thunder Rain Internet Publishing
                Providing Personal/Business
                Internet Solutions that work!

                Comment


                • #23
                  The salt comes from the database and is unique for each user.

                  Comment


                  • #24
                    thx's for the info.
                    after some digging I found it, was able to get figured out.
                    Mickalo
                    Thunder Rain Internet Publishing
                    Providing Personal/Business
                    Internet Solutions that work!

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...
                    X