vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Integration with vBulletin - Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=132996)

Billspaintball 04-24-2007 03:00 PM

Quote:

Originally Posted by gbaker (Post 1233621)
1. I tried to see if this was posted before, but was unable to find. Everything works great, but when "Log Out" is clicked, the "cleared cookies" vb page is shown and stays. Is this the normal behavior? Is there a known workaround to get it to return the initiating page? (other than hacking the vb code).

Thats the default vB behaviour.
As you guessed the way around that is to hack the vB code.
Quote:

2. On the subdomain issue, I have the typical: xxx.org and forums.xxx.org. By doing a "cwd()" in both the domain and subdomain, I confirmed that the physical locations are both under the main domain. However, the require_once of the global.php simply prohibits the page from displaying. Bypassing this with a technologically-superior "//" (commenting out), the page loads fine but displays the following after clicking login:
There is an additional method to bypass this issue now listed at the end of section 4 in the troubleshooting guide that may solve this for you https://vborg.vbsupport.ru/showpost....79&postcount=2

revolink24 05-04-2007 06:50 PM

Warning: chdir(): No such file or directory (errno 2) in xxxxxx/xxxx/index49.php on line 59

Warning: main(/forums/global.php): failed to open stream: No such file or directory in xxx/xxx/xxx//index49.php on line 60

Fatal error: main(): Failed opening required '/forums/global.php' (include_path='.:/usr/local/lib/php') in /xxx/xxx/xxx/xxx/index49.php on line 60

Billspaintball 05-07-2007 12:54 AM

Quote:

Originally Posted by revolink24 (Post 1241503)
Warning: chdir(): No such file or directory (errno 2) .......


See step two in the troubleshooting guide.
https://vborg.vbsupport.ru/showpost....79&postcount=2

From those errors it appears that your path is entered wrong.

ShadyB 05-21-2007 01:32 PM

I have been trying to use this hack on my site, but I dont know where to place the code...
This is the code for my site, so please help me!

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Designed by ShadyB!
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ShadyB.co.uk | Members Area</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="../shadybauth.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
        <div id="logo">
                <h1>Welcome to the members area </h1>
                <h2>SHADYB.CO.UK</h2>
        </div>
        <div id="menu">
      <ul>
        <li><a href="http://www.shadyb.co.uk/members/home.php" title="">Home</a></li>
        <li><a href="http://www.shadyb.co.uk/members/forum.php" title="">Forums</a></li>
        <li class="active"><a href="http://www.shadyb.co.uk/members/" title="">Members</a></li>
        <li><a href="http://www.shadyb.co.uk/members/downloads/" title="">Downloads</a></li>
        <li><a href="http://www.shadyb.co.uk/members/arcade/" title="">Arcade</a></li>
        <li><a href="http://www.shadyb.co.uk/members/servers.php" title="">Servers</a></li>
        <li><a href="#" title="">Server Sales </a></li>
      </ul>
  </div>
</div>
<div id="wrapper">
        <div id="content">
                <div id="sidebar">
                        <div id="support">
                                <h2>Status:</h2>
                                <h3>
                  You are logged in! </div>
                        <div id="login" class="boxed">
                                <h2 class="title">Links</h2>
                                <p class="title"><a href="userdetail.php">My Details</a><br />
                                  My Files<br />
                                  <a href="../chgpwd.php">Change Password </a><br />
                  </p>
                                <div class="content"></div>
                        </div>
                        <div id="updates" class="boxed">
                                <h2 class="title">Recent Updates</h2>
                          <div class="content">
                                  <ul>
                                          <li>
                                                  <h3>Updates</h3>
                                                  <p><a href="http://www.shadyb.co.uk/members/home.php">Update details are currently available on the home page! </a></p>
                                          </li>
                                          <li></li>
                                  </ul>
                          </div>
                        </div>
                </div>
                <div id="main">
                        <div id="welcome" class="post">
                                <h2 class="title">Welcome To The Members Area!</h2>
                                <h3 class="date"><span class="month">Updated May 20th 2007 </span><span class="year"></span></h3>
                                <div class="meta">
                                        <p>ShadyB<a href="#"></a></p>
                                </div>
                                <div class="story">
                                        <p><strong>Welcome to the ShadyB.co.uk members area. Here there will soon be private chat rooms, a music player, and games room, and a few more cool features! </strong><em></em></p>
                                </div>
                        </div>
                        <div id="example" class="post">
                                <h2 class="title">Information</h2>
                                <h3 class="date"><span class="month">Updated May 20th 2007 </span><span class="year"></span></h3>
                                <div class="meta">
                                        <p>ShadyB<a href="#"></a></p>
                                </div>
                                <div class="story">
                                        <p>This section will be expanded on soon!</p>
                                        <h3>Coming Soon! </h3>
                                        <p>Some features coming soon to the members area!</p>
                                        <ul>
                                          <li>Private Games Room </li>
                                      <li>Private Chat Rooms</li>
                                      <li>Music Player</li>
                                      <li>Some More Things When I Think Lol  <br />
                                </li>
                                  </ul>
                          </div>
                        </div>
                </div>
        </div>
        <div style="clear: both;">&nbsp;</div>
</div>
<div id="footer">
        <p id="legal">Copyright &copy; 2007 ShadyB.co.uk </p>
</div>
</body>
</html>

Please could you say where I need to place the code to restrtct the whole page to a certain usergroup? Thankyou in advance!

Mastar 05-21-2007 01:43 PM

Quote:

Originally Posted by ShadyB (Post 1252057)
I have been trying to use this hack on my site, but I dont know where to place the code...
This is the code for my site, so please help me!

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Designed by ShadyB!
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ShadyB.co.uk | Members Area</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="../shadybauth.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
        <div id="logo">
                <h1>Welcome to the members area </h1>
                <h2>SHADYB.CO.UK</h2>
        </div>
        <div id="menu">
      <ul>
        <li><a href="http://www.shadyb.co.uk/members/home.php" title="">Home</a></li>
        <li><a href="http://www.shadyb.co.uk/members/forum.php" title="">Forums</a></li>
        <li class="active"><a href="http://www.shadyb.co.uk/members/" title="">Members</a></li>
        <li><a href="http://www.shadyb.co.uk/members/downloads/" title="">Downloads</a></li>
        <li><a href="http://www.shadyb.co.uk/members/arcade/" title="">Arcade</a></li>
        <li><a href="http://www.shadyb.co.uk/members/servers.php" title="">Servers</a></li>
        <li><a href="#" title="">Server Sales </a></li>
      </ul>
  </div>
</div>
<div id="wrapper">
        <div id="content">
                <div id="sidebar">
                        <div id="support">
                                <h2>Status:</h2>
                                <h3>
                  You are logged in! </div>
                        <div id="login" class="boxed">
                                <h2 class="title">Links</h2>
                                <p class="title"><a href="userdetail.php">My Details</a><br />
                                  My Files<br />
                                  <a href="../chgpwd.php">Change Password </a><br />
                  </p>
                                <div class="content"></div>
                        </div>
                        <div id="updates" class="boxed">
                                <h2 class="title">Recent Updates</h2>
                          <div class="content">
                                  <ul>
                                          <li>
                                                  <h3>Updates</h3>
                                                  <p><a href="http://www.shadyb.co.uk/members/home.php">Update details are currently available on the home page! </a></p>
                                          </li>
                                          <li></li>
                                  </ul>
                          </div>
                        </div>
                </div>
                <div id="main">
                        <div id="welcome" class="post">
                                <h2 class="title">Welcome To The Members Area!</h2>
                                <h3 class="date"><span class="month">Updated May 20th 2007 </span><span class="year"></span></h3>
                                <div class="meta">
                                        <p>ShadyB<a href="#"></a></p>
                                </div>
                                <div class="story">
                                        <p><strong>Welcome to the ShadyB.co.uk members area. Here there will soon be private chat rooms, a music player, and games room, and a few more cool features! </strong><em></em></p>
                                </div>
                        </div>
                        <div id="example" class="post">
                                <h2 class="title">Information</h2>
                                <h3 class="date"><span class="month">Updated May 20th 2007 </span><span class="year"></span></h3>
                                <div class="meta">
                                        <p>ShadyB<a href="#"></a></p>
                                </div>
                                <div class="story">
                                        <p>This section will be expanded on soon!</p>
                                        <h3>Coming Soon! </h3>
                                        <p>Some features coming soon to the members area!</p>
                                        <ul>
                                          <li>Private Games Room </li>
                                      <li>Private Chat Rooms</li>
                                      <li>Music Player</li>
                                      <li>Some More Things When I Think Lol  <br />
                                </li>
                                  </ul>
                          </div>
                        </div>
                </div>
        </div>
        <div style="clear: both;">&nbsp;</div>
</div>
<div id="footer">
        <p id="legal">Copyright &copy; 2007 ShadyB.co.uk </p>
</div>
</body>
</html>

Please could you say where I need to place the code to restrtct the whole page to a certain usergroup? Thankyou in advance!



PHP Code:



<?php
$curdir 
getcwd ();
chdir('/path/to/your/forums');
require_once(
'/path/to/your/forums/global.php');
chdir ($curdir);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Designed by ShadyB!
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ShadyB.co.uk | Members Area</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="../shadybauth.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
    <div id="logo">
        <h1>Welcome to the members area </h1>
        <h2>SHADYB.CO.UK</h2>
    </div>
    <div id="menu">
      <ul>
        <li><a href="http://www.shadyb.co.uk/members/home.php" title="">Home</a></li>
        <li><a href="http://www.shadyb.co.uk/members/forum.php" title="">Forums</a></li>
        <li class="active"><a href="http://www.shadyb.co.uk/members/" title="">Members</a></li>
        <li><a href="http://www.shadyb.co.uk/members/downloads/" title="">Downloads</a></li>
        <li><a href="http://www.shadyb.co.uk/members/arcade/" title="">Arcade</a></li>
        <li><a href="http://www.shadyb.co.uk/members/servers.php" title="">Servers</a></li>
        <li><a href="#" title="">Server Sales </a></li>
      </ul>
  </div>
</div>
<div id="wrapper">
    <div id="content">
        <div id="sidebar">
            <div id="support">
                <h2>Status:</h2>
                <h3>
          You are logged in!     
                      </h3>

                <p>
<!-- begin login code -->
<?php
   
require_once('/path/to/your/login_inc2.php');
?>          
<!-- end login code -->
          </p>
          
            </div>
            <div id="login" class="boxed">
                <h2 class="title">Links</h2>
                <p class="title"><a href="userdetail.php">My Details</a><br />
                  My Files<br />
                  <a href="../chgpwd.php">Change Password </a><br />
              </p>
                <div class="content"></div>
            </div>
            <div id="updates" class="boxed">
                <h2 class="title">Recent Updates</h2>
              <div class="content">
                  <ul>
                      <li>
                          <h3>Updates</h3>
                          <p><a href="http://www.shadyb.co.uk/members/home.php">Update details are currently available on the home page! </a></p>
                      </li>
                      <li></li>
                  </ul>
              </div>
            </div>
        </div>
        <div id="main">
            <div id="welcome" class="post">
                <h2 class="title">Welcome To The Members Area!</h2>
                <h3 class="date"><span class="month">Updated May 20th 2007 </span><span class="year"></span></h3>
                <div class="meta">
                    <p>ShadyB<a href="#"></a></p>
                </div>
                <div class="story">
                    <p><strong>Welcome to the ShadyB.co.uk members area. Here there will soon be private chat rooms, a music player, and games room, and a few more cool features! </strong><em></em></p>
                </div>
            </div>
            <div id="example" class="post">
                <h2 class="title">Information</h2>
                <h3 class="date"><span class="month">Updated May 20th 2007 </span><span class="year"></span></h3>
                <div class="meta">
                    <p>ShadyB<a href="#"></a></p>
                </div>
                <div class="story">
                    <p>This section will be expanded on soon!</p>
                    <h3>Coming Soon! </h3>
                    <p>Some features coming soon to the members area!</p>
                    <ul>
                      <li>Private Games Room </li>
                      <li>Private Chat Rooms</li>
                      <li>Music Player</li>
                      <li>Some More Things When I Think Lol   <br /> 
                         </li>
                  </ul>
              </div>
            </div>
        </div>
    </div>
    <div style="clear: both;">&nbsp;</div>
</div>
<div id="footer">
    <p id="legal">Copyright &copy; 2007 ShadyB.co.uk </p>
</div>
</body>
</html>


Fill in your info where there is RED.

ShadyB 05-21-2007 01:54 PM

Ok I knew where to put that, but its the restricting bit I cant do...

PHP Code:

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo 
"Have stuff for here";
             } else {
             echo 
"You do not have permission for this page"; }
    
?>

Its that bit that I dont know where to place.. I just keep getting parse errors if I try and do it...
I want it so that the page is viewable to people that are logged in, but not to people that arent..

Mastar 05-21-2007 04:09 PM

Why not create a vbulletin custom page :

https://vborg.vbsupport.ru/showthread.php?t=62164

ShadyB 05-21-2007 04:15 PM

Thats not what I'm trying to do... I have a different design for the site, and just want to use the login system, so users dont have to register on two different sites..
This hack does that, but I just dont know how to use the php code in my last post..

Billspaintball 05-22-2007 01:27 AM

Quote:

Originally Posted by ShadyB (Post 1252073)
Ok I knew where to put that, but its the restricting bit I cant do...

PHP Code:

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo 
"Have stuff for here";
             } else {
             echo 
"You do not have permission for this page"; }
    
?>

Its that bit that I dont know where to place.. I just keep getting parse errors if I try and do it...
I want it so that the page is viewable to people that are logged in, but not to people that arent..

Your getting parse errors probably because your HTML code is not escaped correctly.

For example this bit here
Code:

<div id="welcome" class="post">
                                <h2 class="title">Welcome To The Members Area!</h2>
                                <h3 class="date"><span class="month">Updated May 20th 2007 </span><span class="year"></span></h3>
                                <div class="meta">
                                        <p>ShadyB<a href="#"></a></p>
                                </div>

should be done something like

Code:

<?php 
if ($vbulletin->userinfo['userid'] >0) {
echo"

<div id=\"welcome\" class=\"post\">
                                <h2 class=\"title\">Welcome To The Members Area!</h2>
                                <h3 class=\"date\"><span class=\"month\">Updated May 20th 2007 </span><span class=\"year\"></span></h3>
                                <div class=\"meta\">
                                        <p>ShadyB<a href=\"#\"></a></p>
                                </div>

";

?>

It does require some basic PHP skills to do this.
If you have not used PHP/HTML togeather before you really should do a couple of online tutorials on it.
Its a little confusing at first, but not hard to pick up the basics (which is all you need for this)

ShadyB 05-22-2007 01:43 PM

Thankyou SO MUCH BILL!!!
Adding the \'s in the right places made it work!!
I cannot thankyou enough.. I might make a donation =]


All times are GMT. The time now is 03:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01705 seconds
  • Memory Usage 1,859KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete