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 03-27-2007 11:21 PM

Quote:

Originally Posted by jeramie78 (Post 1213229)
I removed this part of the code
which i really wanted to use. and wish i could still use

Ok.
From here I would recommend adding back that code one section at a time till we find the bit that breaks it.


As for the Avatars, are your avatars stored in the database or in the filesystem?
There is a problem if they are stored in the filesystem.

LBmtb 04-02-2007 06:38 AM

This may sound petty: but any way to get the form's code to validate? I'm not a javascript guy so I don't know all the tricks to get the code to validate.

Snatch 04-07-2007 01:34 PM

I use this script on an secound server. It works very find.

But I have one Problem. The Script opens this connection to the firs (forum) server.It opens many many from this connection. But it dount close it.

Code:

| 13745 | web1 | MySecoundServer.com:53717 | usr_web1_2 | Query  |  43 | Writing to net | SELECT *
                        FROM datastore
                        WHERE title IN ('','options','bitfields','attachmentcache','forumcache |

| 27382 | web1 | localhost                  | usr_web1_2 | Query  |  34 | Locked        | SELECT *
                        FROM datastore
                        WHERE title IN ('','options','bitfields')                              |

one minute later, both server are not reachable. I must restart MySQL than.

Any ideas ?

GreeTz
Snatch

suttercain 04-10-2007 10:35 PM

See Post Below

Vigile 04-11-2007 12:06 AM

Is there anyway for this hack to work where the forums on a different physical server, though they are a subdomain of the other site in question.

For example:

mysite.com on server IP 192.168.0.100
forums.mysite.com on server IP 192.168.0.101

Possible?

suttercain 04-11-2007 01:15 AM

See Post Below

suttercain 04-11-2007 01:46 AM

see post below

Billspaintball 04-11-2007 04:23 AM

Quote:

Originally Posted by suttercain (Post 1224617)
Is it because of the subdomain?

Quite possibly.
Subdomains are a knowen problem.

One thing I would suggest is to clear your cookies (tools -> Internet Options -> Delete cookies) then force a page refresh (CTRL + F5) and see if that helps.

Billspaintball 04-11-2007 04:24 AM

Quote:

Originally Posted by Vigile (Post 1224569)
Possible?

Sorry but this is unlikely to work in this case.

suttercain 04-11-2007 05:43 AM

Hi Bill,

I have been literally working on this for 5 hours. I moved the forum from the subdomain of forums.supermandatabase.com to supermandatabase.com/forums to run this script.

I am running vb 3.6.4. After no success of getting the Welcome 'user' to work once logged in I created a test.php with no other code bu the code supplied in the zip file.

Here is what I have:
Code:

<?php
$curdir = getcwd ();
chdir('/home/superman/public_html/forums/');
require_once('/home/superman/public_html/forums/global.php');
chdir ($curdir);
?>
<?php
  require_once('login_inc.php');
?> 
<?php

if ($vbulletin->userinfo['usergroupid'] == '6' )
        {
        echo "This is only visible to people in usergroup 6";}
        ?>

In FIREFOX:
So I go to supermandatabase.com/forums/test.php and I login. It takes me to the vBulletin login and process me and redirects me back to test.php and I see Welcome Superman! and "This is only visible to people in usergroup 6" But when I click log out, it takes me to vBulletin and says cookies cleared, but when I go back to test.php I see the Welcome Superman I can't logoff via the test.php SOLVED!!!

In EXPLORER:
Exact opposite happens. I go to test.php, enter information, and I am processed and redirected back expect I don't see Welcome Superman! I see the login information without the "This is only visible to people in usergroup 6" being echoed. I am also getting a warning message that says "Problems with this web page might prevent it from being displayed properly.

Line : 9
Char: 1
Error: Expected '('
Code: 0


I have no clue what to do. The cookies are set to "/" and not '/forums/"

Any suggestions or anyone else had this issue?

Thanks in advance for the help.

suttercain 04-11-2007 06:05 AM

Quote:

Originally Posted by Doctor Who (Post 1138111)
Any idea what would be causing the attached error, and how to fix it? The only javascript that is included in the page is from the login_inc.php file.

Exactly my same issue.

I figured out it's a JavaScript/IE error but I don't know JavaScript. I tried looking to see a place to close with a "(" but couldn't find one. Anyone else having this issue or know how to solve it? Thanks.

SC

suttercain 04-11-2007 06:36 AM

Quote:

Originally Posted by LBmtb (Post 1218153)
This may sound petty: but any way to get the form's code to validate? I'm not a javascript guy so I don't know all the tricks to get the code to validate.

Same problem on this guy's page:
http://socaltrailriders.org/

I open it up in Explorer and the same error. I don't think his post was ever answered. Is it possible to get this to validate?


Thanks.

Vigile 04-11-2007 02:54 PM

Quote:

Originally Posted by Billspaintball (Post 1224698)
Sorry but this is unlikely to work in this case.

Well, that's no good. Any possible solution to this issue? Using the vb user db for login information on another system?

suttercain 04-11-2007 05:55 PM

Since there were never any answers to the previous two gentleman having this same issue, it's safe to say that I should forget about using this hack?

70% of internet users use IE. If it doesn't work in IE... I can't use it.

Mastar 04-11-2007 08:05 PM

As soon as I gets permission I will release a revision of his hack. Please check back for an update.

suttercain 04-11-2007 08:10 PM

I figured out the javaScript error... only took 14 hours. Sorry I'm a php guy not a JavaScript guy.

Anyway...

replace:
Code:

echo "<input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''"; size=10 />";
with

Code:

echo "<input name=vb_login_username type=text id=navbar_username onfocus=\"if (this.value == '$vbphrase[username]') this.value = '';\" size=10 />";
The quotation marks were missing. IE was expecting them. Hope this helps. Donation can be made to your local Animal Shelter.

Billspaintball 04-12-2007 12:20 AM

Quote:

Originally Posted by suttercain (Post 1225280)
I figured out the javaScript error... only took 14 hours. Sorry I'm a php guy not a JavaScript guy.

Thanks, I'm a php not javascript guy as well. :)
I will update the hack over the weekend to correct it.

Ipuck 04-13-2007 12:15 AM

Hello

Thanks for the hack!

I got this error on all the pages I have added:

Quote:

Fatal error: Call to undefined method db::unlock_tables()

in /var/www/domains/xxxxxmydomainxxxxxxx/docs/forum/includes/functions.php on line 4998
Any ideas?

Thanks

jeramie78 04-13-2007 12:22 AM

the unlock_tables error is caused by VB and your script that you are inserting this code into are clashing.

vb uses $db to connect to the mysql DB and so does your script ....
in your config file of the script your using try changing........

$db = mysql_select_db

to

$db1 = mysql_select_db

Sorry if its so vague but thats what i did.

Ipuck 04-13-2007 01:36 AM

Thanks jeramie78 I'll try that

Ipuck 04-13-2007 01:50 AM

Thanks It worked!!!!! :)

But now I got another error :( (See Photo) Any ideas?

jags2ooo 04-13-2007 10:35 AM

Quote:

Originally Posted by Ipuck (Post 1226385)
Thanks It worked!!!!! :)

But now I got another error :( (See Photo) Any ideas?

getting the same error also.

suttercain 04-13-2007 10:52 PM

Quote:

Originally Posted by Ipuck (Post 1226385)
Thanks It worked!!!!! :)

But now I got another error :( (See Photo) Any ideas?

I posted this fix for this on this page. It's always a good idea to read the forum posts.

suttercain 04-13-2007 11:14 PM

Hate to say it, I found another error via Firefox VS. IE.

When I login and I have code so only a certain group can see it... works fine in Firefox and displays the code, yet in IE it logs me in, shows I am in, but does not display the code to that user group.

Is anyone else having this issue with IE?

Thanks.

SC

Ipuck 04-13-2007 11:58 PM

Thanks

I didn't know what that fix was for, but read all your post and i found it.

Thanks it worked well.


Quote:

Originally Posted by suttercain (Post 1227069)
I posted this fix for this on this page. It's always a good idea to read the forum posts.


suttercain 04-14-2007 12:10 AM

IPuck,

Glad to hear it.

Have you tried this code yet?

Code:

if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>

} else {
            echo "You do not have permission for this page"; }

If so can you let me know if it is showing the content that it is suppose to after logging in. I got it to show in Firefox, but not IE.

Thanks

Snatch 04-14-2007 06:56 PM

Quote:

Originally Posted by Vigile (Post 1224569)
Is there anyway for this hack to work where the forums on a different physical server, though they are a subdomain of the other site in question.

For example:

mysite.com on server IP 192.168.0.100
forums.mysite.com on server IP 192.168.0.101

Possible?

Hi, this works! Make a copy of the needed Forum Forum files on the secound Server.
Then you must set in the config.php on the secound server the ip to the server where the VB-Database is runnig.
I have made this to and it works fine.

Example:
My Forum: www.celebritymarkt.org (Server 1)
My Uploader 10mbit.celebritymarkt.org/uploader (Server 2)

GreeTz
Snatch

suttercain 04-14-2007 07:00 PM

Can some please tell me if

Code:

if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>

} else {
            echo "You do not have permission for this page"; }

Works for them in IE?

Thank you

Taipa 04-14-2007 09:41 PM

Quote:

Originally Posted by suttercain (Post 1227685)
Can some please tell me if

Code:

if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>

} else {
            echo "You do not have permission for this page"; }

Works for them in IE?

Thank you

How did you get that to work in Firefox? It's missing the "; at the end of the first echo statement. I have to add the "; to get it to work at all.

But no, I cannot get it to work in IE. Then again, I'm not a very good test, because I can't get anything for this hack to work in IE. Works brilliantly in Firefox, but won't even let me login in IE. I login, it shows the vB screen saying "thank you for logging in" but then when it redirects me, it's not showing me as being logged in at all.
I don't get any errors, it just... doesn't work for me.
I'm still reading this whole thread to figure out where I've gone wrong.

suttercain 04-14-2007 09:45 PM

Thanks for replying. I fixed the login part for IE I think it's on page 7 of this forum. But what is the point of this hack if it doesn't work in IE? That is what I don't get. For better or worse, most people use IE and if this only works for Firefox it's pointless.

I used this in Firefox
Code:

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>
  <tr>
    <td>NEWS</td>
    <td>COMICS</td>
    <td>REVIEWS</td>
    <td>CHARACTERS</td>
    <td>CREATORS</td>
    <td>ARTICLES</td>
  </tr>
  <tr>
    <td><a href='submit_news.php'>Submit News </a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><a href='view_edit_news.php'>Edit News </a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>";
            } else {
            echo "You do not have permission for this page"; }
    ?>

Worked great in Firefox, sucks in IE

Taipa 04-14-2007 09:58 PM

Quote:

Originally Posted by suttercain (Post 1227831)
Thanks for replying. I fixed the login part for IE I think it's on page 7 of this forum.

If you mean this
PHP Code:

"<input name=vb_login_username type=text id=navbar_username onfocus=\"if (this.value == '$vbphrase[username]') this.value = '';\" size=10 />"

Thank you; I already changed that, but it didn't make a difference. It's still not letting me actually log in using IE.
Even before i changed that, I wasn't getting any errors in IE, it just wasn't working.


I do have my cookies set to / and not forum/, so I don't know what the IE issue is. :P

suttercain 04-14-2007 09:59 PM

Post Removed Because I jumped the gun. Seems to be working perfectly. Will be donating to Bill on Friday for his great work

Taipa 04-14-2007 10:04 PM

Quote:

Originally Posted by suttercain (Post 1227845)
Okay, so I got it to even display the info in IE to only level 6 members....

Would you mind sharing how you did this?
Even with a security/cookie issue, I'd like to see how it was done. :)
Thanks!

suttercain 04-14-2007 10:07 PM

The problem you may be having is when you go into vBulletin options-> Cookies and Setting your site may be (blank) you should have a drop down that allows you to select yourdomain.com. Once I changed that it worked. That is the only thing I did different. The table code I posted above is the same... well here is the entire code:

Code:

<?php
$curdir = getcwd ();
chdir('/home/superman/public_html/forums');
require_once('/home/superman/public_html/forums/global.php');
chdir ($curdir);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?php
  require_once('../forums/login_inc.php');
?>

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>
  <tr>
    <td>NEWS</td>
    <td>COMICS</td>
    <td>REVIEWS</td>
    <td>CHARACTERS</td>
    <td>CREATORS</td>
    <td>ARTICLES</td>
  </tr>
  <tr>
    <td><a href='submit_news.php'>Submit News </a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><a href='view_edit_news.php'>Edit News </a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>";
            } else {
            echo "You do not have permission for this page"; }
    ?>

</body>
</html>


Taipa 04-14-2007 10:25 PM

Quote:

Originally Posted by suttercain (Post 1227851)
The problem you may be having is when you go into vBulletin options-> Cookies and Setting your site may be (blank) you should have a drop down that allows you to select yourdomain.com. Once I changed that it worked. That is the only thing I did different. The table code I posted above is the same... well here is the entire code:

Thank you! That solved my issue. :)


Quote:

Originally Posted by suttercain (Post 1227845)
When you click logout... it takes you to vBulletin's logout page and says all cookies have been cleared... NOT TRUE!

If you go back to the same page that you tried logging out from you can see that it is still logged in!

Unless you manually go into IE and clear all your cookies and RESET your history... you will still be logged in.

I did not have this issue in IE.
I clicked "Return to the page you were previously viewing", and I was logged out. I also tried it just typing in the URL after logging out; I was still logged out properly.
But I don't use IE, so I don't know how to check the cookies to make sure the one from my site was removed or not.
But it appears to be logging me out properly.

Billspaintball 04-16-2007 02:12 PM

Quote:

Originally Posted by Snatch (Post 1227680)
Hi, this works! Make a copy of the needed Forum Forum files on the secound Server.
Then you must set in the config.php on the secound server the ip to the server where the VB-Database is runnig.
I have made this to and it works fine.

Example:
My Forum: www.celebritymarkt.org (Server 1)
My Uploader 10mbit.celebritymarkt.org/uploader (Server 2)

GreeTz
Snatch

Thanks for this, will add it to the troubleshooting guide as a workaround. :)

activa 04-21-2007 03:34 PM

it is possible to use the template system vb in non vb page with this mod ?

jags2ooo 04-21-2007 06:30 PM

Quote:

Originally Posted by suttercain (Post 1225280)
I figured out the javaScript error... only took 14 hours. Sorry I'm a php guy not a JavaScript guy.

Anyway...

replace:
Code:

echo "<input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''"; size=10 />";
with

Code:

echo "<input name=vb_login_username type=text id=navbar_username onfocus=\"if (this.value == '$vbphrase[username]') this.value = '';\" size=10 />";
The quotation marks were missing. IE was expecting them. Hope this helps. Donation can be made to your local Animal Shelter.

cant find tha tline in the document

gbaker 04-22-2007 09:21 PM

Firstly, suttercain, it appears you could be very helpful to others...but you need to relax dude...seriously.

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).

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:

"In order to accept POST request originating from this domain, the admin must add this domain to the whitelist"

Dunno if this will help at all, but figured I'd post it.

Billspaintball 04-24-2007 02:55 PM

Updated
  • Fixed - // in paths bug
  • Fixed - Javascript warning in some browsers
  • Fixed - Tidied up some code
  • Fixed - Avatar display code bug

Download the update from the first post, and see the 2nd post for additional workarounds for the 404 on Expired passwords and cross domain login issues.


All times are GMT. The time now is 01:37 PM.

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.01621 seconds
  • Memory Usage 1,865KB
  • 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
  • (11)bbcode_code_printable
  • (1)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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