vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Deluxe vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=108026)

xKillswitchx 11-28-2006 03:24 AM

Thanks Bill, got it working, and I use 3.6.4 :D Didn't need to modify any code for it to work, so I think its safe to assume it will work with 3.6.4 out of the box. I did, however, modify it to fit my site better and fixed some validation issues! :P

Hornstar 11-28-2006 11:18 AM

Quote:

Originally Posted by Billspaintball (Post 1126828)
Sorry, with family life at the moment I really just dont have any spare time. :(

I have another project sitting stalled from lack of time as it is :(

Thats fair enough, family should always come first. however if you ever do get a chance, please let me know, because anyone else wants to charge me an arm and a leg to get something that shouldnt cost that much IMO but I guess I will keep trying and hopefully get it myself eventually.

Thanks.

ocmca 12-05-2006 05:02 AM

Quote:

Originally Posted by delive (Post 1060963)
What is the code that evaluates the users additional usergroups. Is it possible to check and see if they are part of an additional usergroup?

What should i change
$vbulletin->userinfo['usergroupid'] == '5'
to?

another bump as I am a install-ee who could really use that little bit of info to simplify my life <3 thanks out for anyone that knows.

unit3029 12-05-2006 01:49 PM

Hi, thanks for this great hack :)

I have one small problem i am using vb 3.6.4 everything works fine except for dispay avatar.

If i add my own avatar through usercp it will diplay, but if i choose a forum avatar it wont :( any workaround for this ?

Billspaintball 12-07-2006 03:46 AM

Quote:

Originally Posted by unit3029 (Post 1132436)
If i add my own avatar through usercp it will diplay, but if i choose a forum avatar it wont :( any workaround for this ?

Sorry, It only seems to work with database held avatars.
Ive tried a few different things but havent been able to get around it. :(

Billspaintball 12-07-2006 04:01 AM

Quote:

Originally Posted by ocmca (Post 1132218)
another bump as I am a install-ee who could really use that little bit of info to simplify my life <3 thanks out for anyone that knows.

Try something like

PHP Code:

<?php 
if ($vbulletin->userinfo['usergroupid'is_member_of(n,n,n)) 
    { 
    echo 
"This is only visible to people in usergroups n,n,n";} 
    
?>

where n = the groups you want to check.

I havent tried this yet, it may or may not work.
Look here for more info https://vborg.vbsupport.ru/showthread.php?t=132024

erinys 12-11-2006 06:55 AM

You should release this as a 3.6 pluging so it shows up in the 3.6 listing :) its working perfectly fine with it anyway ;)

jedipro88 12-12-2006 06:19 AM

i've a big problem....my website has a template php (template.inc.php) that is included into index.php

Code:

include("template.inc.php");
top();
include("config.inc.php");
$mod = @$_GET['mod'];
$iniz = @$_GET['iniz'];

if ($iniz != "")
{.....

my template.inc.php has a function top that begin the html page

Code:

function top() {
chdir('/home/albertac/public_html/a-cube/forum');
require_once('/home/albertac/public_html/a-cube/forum/global.php');
include("config.inc.php");
  ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Against All Authority Multigaming Clan - www.a-cube.it -</title>
<link href="css.css" rel="stylesheet" type="text/css" />

then....if i put

Code:

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

into index.php and i put the login script into template.php it give me line 150 error, if i put global.php into template.inc.php it give a function.php error....

i don't know what to do.....i know that it go because if i create a normal page login script go well!!!!

Aur-Phala.Com 12-15-2006 05:08 PM

hey any idea how i could make it show on whosonline page
so people who are using my page www.aur-phala.com/hotmail
will show up on whos online so i can see whos checking that page out

for version 3.6.x

Yukino_AE 12-19-2006 02:19 AM

ok, i have the cms postnuke, i want the login to appear in a postnuke block. i understand that the:

<?php
require_once('/path/to/your/login_inc.php');
?>

should be in the block, but it won't appear cuz i don't know how to tweak the rest of it. can anyone help me get this to work in a postnuke block?

ArchieMB 01-04-2007 03:56 PM

I'm no coder but I want to insert your hack into joomla (I hate those bridges), is this possible?

ArchieMB 01-07-2007 01:20 PM

I think I have to place it in a joomla module, but I don't know how :(

xKillswitchx 01-08-2007 01:41 AM

Quote:

Originally Posted by erinys (Post 1136184)
You should release this as a 3.6 pluging so it shows up in the 3.6 listing :) its working perfectly fine with it anyway ;)

Indeed it does, I have it running on my site (3.6.4) and have logged alot of my site downloads with it, works very well. Displays avatars fine, not problems with it.

Archie, I may be able to help, give me a pm, Im pretty familiar with Joomla.

Edit - If anyone wants to add to this nice mod, by showing total num. of registered users, that would be nice ;)

Billspaintball 01-09-2007 03:17 AM

Quote:

Originally Posted by ArchieMB (Post 1150683)
I'm no coder but I want to insert your hack into joomla (I hate those bridges), is this possible?

Not without modification.
You would need someone quite skilled in joola to make the necessary modifications.


Quote:

Originally Posted by xKillswitchx (Post 1153188)
Edit - If anyone wants to add to this nice mod, by showing total num. of registered users, that would be nice ;)

Will add to the todo list
(might already be on there actually)

ArchieMB 01-09-2007 04:57 PM

Quote:

Originally Posted by Billspaintball (Post 1154253)
Not without modification.
You would need someone quite skilled in joola to make the necessary modifications.

Damn, I thought I found the perfect solution for my community without bridges :(

My first idea was creating a new module in joomla, insert your code there, publish this module and upload your login_inc.php file - But that would be too good to be true :(

xKillswitchx 01-12-2007 05:07 AM

Quote:

Originally Posted by ArchieMB (Post 1154702)
Damn, I thought I found the perfect solution for my community without bridges :(

My first idea was creating a new module in joomla, insert your code there, publish this module and upload your login_inc.php file - But that would be too good to be true :(

It would work, but the only problem, is you cant add the first few lines to the top of the template file, you'd have to dig into Joomla code and work it into whatever writes the header and all. Think its the joomla.php file.

Oh Bill, if you don't get too it, I will grab it soon :D I am actually working on a news publishing script for my homepage (outside of VB), which comments and all take VB user info, and hope to get it integrated more to VB, so I will need something similar soon anyways.

Luke Brown256 01-14-2007 12:59 PM

Hi i am having one issue,
when i try to read a variable parsed through the URL:
index2.php?page=home
for example
when i access $_GET['page']
all it contains is 0
i ran some tests, and if i echo it BEFORE i include global.php it is fine, if i do it after i get 0

anyway to resolve this?

**edit it will let me enter numvbers for some reason, and will parse those through fine:
i.e:
index2.php?page=65464
is fine

** additional edit, just realised page must be a reserved word, for the page number the user wishes to view in a topic,
sorry about that.
Do you have a list of reserved words by any chance?

Billspaintball 01-15-2007 02:36 AM

Quote:

Originally Posted by Luke Brown256 (Post 1158818)
Do you have a list of reserved words by any chance?

No.

I keep running into the same problem myself.
A list of vB reserved names would be very handy.

Zia 01-15-2007 04:12 AM

helo..if the target page placed in different server?
inthat case will it work?
or how could we?

Dave Rosteck 01-15-2007 07:12 PM

Am I stupid or is it impossible to put the content of my choosing inside the "Your logged in so we can display this" field for the logged in users? It won't accept PHP includes (which I would prefer) or anything beyond normal HTML tags such as <center>, <br> or <p>. In result, I continue to receive parse errors. What am I doing wrong? :confused:

Billspaintball 01-15-2007 09:38 PM

Quote:

Originally Posted by Zia (Post 1159571)
helo..if the target page placed in different server?
inthat case will it work?
or how could we?

Maybe....
Cross site logins are a known issue caused by vB's security features.
If you try the suggestions in the 2nd post in this thread you may get that working but no promises.

Billspaintball 01-15-2007 09:49 PM

Quote:

Originally Posted by Dave Rosteck (Post 1160091)
Am I stupid or is it impossible to put the content of my choosing inside the "Your logged in so we can display this" field for the logged in users? It won't accept PHP includes (which I would prefer) or anything beyond normal HTML tags such as <center>, <br> or <p>. In result, I continue to receive parse errors. What am I doing wrong? :confused:

You can put whatever php code you like in both the display to logged in or not logged in users.

Taking a guess here but your trying to place the php code inside this statement?
PHP Code:

echo "Your logged in so we can display this"

That wont work and will cause parse errors as you have found out.
You put the PHP code between the { and } not inside the echo statement.
You can also include other files if you like.

for example
PHP Code:

<?php 
If ($vbulletin->userinfo['userid']!=0
    {  
    require_once(
'mystuff.php');    
    echo 
"Your logged in so we can display this"
    
$totthreads vb_number_format($totthreads);
     
$totposts vb_number_format($totposts);
     
// display total threads and total posts - Uses vB phrases, but change if you like
     
echo"<br /> $vbphrase[threads]$totthreads<br />$vbphrase[posts]$totposts<br /> ";
    } else { 
    echo 
"Your not logged in so we display this"
    } 
?>

Hope that helps.

Dave Rosteck 01-15-2007 10:37 PM

Quote:

Originally Posted by Billspaintball (Post 1160190)
Taking a guess here but your trying to place the php code inside this statement?

You'd be correct. :o Thanks Bill!

makaveli420 01-19-2007 06:25 PM

anybody know how I can disable the script from trying to get the image size?

I get this error after logging in.

Quote:

Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /home/.antic/membername/domain.net/login_inc.php on line 34

Warning: getimagesize(http://www.domain.net/forum/image.php?u=1) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /home/.antic/jmembername/domain.net/login_inc.php on line 34
I would prefer to just display the original size of the persons avatar.

Billspaintball 01-19-2007 10:32 PM

Quote:

Originally Posted by makaveli420 (Post 1162932)

I would prefer to just display the original size of the persons avatar.


try this.
in login_inc.php find
PHP Code:

$userid=$vbulletin->userinfo['userid'];
$file $forumpath."/image.php?u=$userid";
list(
$width$height$type) = getimagesize($file);

if ( 
$width <= $maxw AND $height <= $maxh )// check width and height
   
{// if width and height under size display unchanged
       
echo "<img src=\"$file.$type\" align=\"center\" border=\"0\">";
   }
   else 
   {  
    if (
$width $maxw)//check if width is too wide
        
// if it is, resize
        
$ratio $width $maxw//work out resize ratio
        
$newwidth $maxw// new width
        
$newheight = ($height $ratio); // new height at this resize
        
}
        else
        {
        
$newheight $height// if width is ok, set this cos we need it later
        
$newwidth $width// if width was ok, set this cos we ned it later
        
}
    If (
$newheight <= $maxh )        
        {
        
// if current height is ok, were done.
        

        
        else 
// either origional or resized height is too big
            
if( $newheight >= $maxh )
            { 
// if resized height is still too big we resize it
            
$ratio2 $newheight $maxh//work out resize ratio
            
$newheight $maxh// give $newheight a new value
            
$newwidth = ($newwidth $ratio2); // new width at this resize
            
// the value of $newwidth has just been changed
            
else
            {
// if were here then origional height is too big so we resize it
            
$ratio2 $newheight $maxh//work out resize ratio
            
$newheight $maxh// give $newheight a new value
            
$newwidth = ($newwidth $ratio2); // new width at this resize
            
}

        
// now we can finally display resized pic
        
echo "<img src=\"$file.$type\" border=\"0\" width = \"$newwidth\" height = \"$newheight\" align=\"center\">"// display resized pic
   
}
// +++++++++++++++++++++++  
// end avatar display code
// +++++++++++++++++++++++ 

and replace it with

PHP Code:

$userid=$vbulletin->userinfo['userid'];
$file $forumpath."/image.php?u=$userid";

echo 
"<img src=\"$file\" border=\"0\" align=\"center\">"// display resized pic

// +++++++++++++++++++++++  
// end avatar display code
// +++++++++++++++++++++++ 

I havent tested it, so let me know it it does not work.

ArchieMB 01-21-2007 02:03 PM

it's me again, still having the problem with creating a joomla module with this hack :(

I still didn't get it :(

RobAC 01-23-2007 10:08 PM

I like the user authentication system that PhotoPost and ReviewPost utilize from Techimo.

I don't care about showing avatars and have no desire to do so. I just want the same functionality as PhotoPost has.

Does this hack do the same thing?

Billspaintball 01-25-2007 03:18 AM

Quote:

Originally Posted by ArchieMB (Post 1164268)
it's me again, still having the problem with creating a joomla module with this hack :(

I still didn't get it :(

I m not a joomla expert but I cant see how it would work as a module.
I think you would have to actually hack the joomla code to intergrate this with that.

Billspaintball 01-25-2007 03:19 AM

Quote:

Originally Posted by RobAC (Post 1166031)

Does this hack do the same thing?

Sorry, Im not familiar whith how they work.

erinys 01-29-2007 01:17 PM

Hey bill, im in the process of switching servers, and ran into a problem with this hack :) you might have seen it before, i im posting a screenshot, maybe you know how to fix this? ;)

As far as i know i made no mestakes with paths or anything

As you can see, this is how it shows when logged in (cookie settings are on / and .domain.com) , and notice the "Submit Qeury" in the button... instead of the normal "inloggen" wich it should be

thanks in advance

erinys 01-29-2007 02:21 PM

ok disregard the message above, i took the test.php and the basic code, that worked fine.
so i copied only the php lines into my template on the spot where it was, and voila, it started working again aswell. :S

very weird, but at least it works again yay :)

Billspaintball 01-30-2007 01:53 AM

Quote:

Originally Posted by erinys (Post 1169824)
so i copied only the php lines into my template on the spot where it was, and voila, it started working again aswell. :S

very weird, but at least it works again yay :)

Heh...
Ive done stuff similar to that before too. :)

PnL 02-05-2007 02:00 AM

How do you allow multiple groups access? I tried separating group IDs by commas but that doesn't seem to work.

Also, I'm assuming that only primary groups are looked at? What if I want to assign a special group permission to certain pages without changing their primary group ID?

Billspaintball 02-05-2007 10:32 AM

Quote:

Originally Posted by PnL (Post 1174906)
How do you allow multiple groups access? I tried separating group IDs by commas but that doesn't seem to work.

You need to do it this way
Code:

if ($vbulletin->userinfo['usergroupid'] == '25' 
    or $vbulletin->userinfo['usergroupid'] == '26' 
    or $vbulletin->userinfo['usergroupid'] == '27'
)


Quote:

Also, I'm assuming that only primary groups are looked at? What if I want to assign a special group permission to certain pages without changing their primary group ID?
I think so...
It should just be a matter of checking their secondary group membership like in the above manner.
I think that may be $vbulletin->userinfo['membergroupids'] but Im not sure (havent tried it)

PnL 02-05-2007 02:23 PM

Cool - thanks!

How about if I want to control files from being accessed by members who are currently logged in - is there a way to set this up? If the URL of the file is known the method in this thread won't protect those files from being accessed by "non-members", since it only controls what is displayed (like URL/links). Is there a way to have the log-in checked before the file is accessed? I'm guessing a dynamic URL/link would be required which needs to be generated based on whether the user is logged-in or not. Is this possible?

Billspaintball 02-05-2007 09:39 PM

Quote:

Originally Posted by PnL (Post 1175241)
Cool - thanks!

How about if I want to control files from being accessed by members who are currently logged in - is there a way to set this up? If the URL of the file is known the method in this thread won't protect those files from being accessed by "non-members", since it only controls what is displayed (like URL/links). Is there a way to have the log-in checked before the file is accessed? I'm guessing a dynamic URL/link would be required which needs to be generated based on whether the user is logged-in or not. Is this possible?

Thats outside the scope of this hack.

You can do this by playing with your httaccess file.
Ive seen it done on several sites before.

This hack here https://vborg.vbsupport.ru/showthread.php?t=61507 is for vB 3.0 but should give you an idea oh now it all works.

Hope this helps.

PnL 02-06-2007 03:34 AM

I figured as much. I'm looking at the rewrite mod that comes with Apache (?). I'll have to do a little more research to figure out what will work for me.

Thanks for the great hack/mod Bill, it works great on my site.

Mysticales 02-18-2007 02:28 AM

Hey just posting this here incase others were always interested in using this login script and vbexternal together. =)

https://vborg.vbsupport.ru/showpost....&postcount=399

erinys 02-23-2007 11:41 AM

Bill.. i had a big problem this morning.

When i entered my site i thought it was down, it was 100% 404 page (page not found) so i was freaking out and allready submitting a ticket to my host when my GF went behind the pc and could enter the site and started movign onto the forum

So i went to domain.nl/community (my forum url) and saw the following message: (your password is more then 180 days old, set a new pasword here)

After i did that, my frontpage went normal again, but before i did that, i checked and deleted the code from from this plugin the template to see of it was this plugin wich made the entire page it was loaded to a 404, and it was. :(

could you check into this please? cause it can ultimately make your site down for everyone a member longer then 180 days :s

Edwin

Billspaintball 02-26-2007 04:23 AM

Quote:

Originally Posted by erinys (Post 1188994)
Bill.. i had a big problem this morning.

When i entered my site i thought it was down, it was 100% 404 page (page not found) so i was freaking out and allready submitting a ticket to my host when my GF went behind the pc and could enter the site and started movign onto the forum

So i went to domain.nl/community (my forum url) and saw the following message: (your password is more then 180 days old, set a new pasword here)

After i did that, my frontpage went normal again, but before i did that, i checked and deleted the code from from this plugin the template to see of it was this plugin wich made the entire page it was loaded to a 404, and it was. :(

could you check into this please? cause it can ultimately make your site down for everyone a member longer then 180 days :s

Edwin

Is there a password expiry time setting in vB or is that part of another hack you have installed?
Anyhow, I will have a look at it when I get home.


All times are GMT. The time now is 11:02 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.02243 seconds
  • Memory Usage 1,892KB
  • 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
  • (5)bbcode_php_printable
  • (22)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