Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [swissbob] Auth_vBulletin and Authentication

Quote Reply
Re: [swissbob] Auth_vBulletin and Authentication In reply to
This is the only code you should use:

Quote:


here is the perl file log.cgi

Code:

#!/usr/bin/perl
#================================
use strict;
use lib '/home/httpd/vhosts/magicdirectory.com/cgi-bin/admin';
use Links qw/$IN/;
Links::init('/home/httpd/vhosts/magicdirectory.com/cgi-bin/admin');
use Links::SiteHTML;
local $SIG{__DIE__} = \&Links::fatal;
main();
sub main {
#---------------------------------------------------
#
my $username = $IN->cookie('Community_Name') || $IN->param('Community_Name');
print $IN->header;
print Links::SiteHTML::display('include_login', {Username => $username});
}



If you use GCommunity, then make sure you have not renamed your session name under

Setup -> User Session -> session_cookie_name_user

If you do not use GCommunity, then "Community_Name" should be replaced with "s".

You should create a global, say, "login" OR "log" with this sub routine:

Code:

sub {
my $output;

if ($ENV{SCRIPT_NAME} =~ /nph-build/) {
$output = '<!--#exec cgi="/cgi-bin/log.cgi" -->';
}
else {
$output = Links::SiteHTML::display('include_login');

}
return $output;

}



<%log%>, which you can put in your include_header.html file, will now automatically check to see what kind of file it is loaded. This requires SSI, so your files must be built with .shtml extension. Remember to also check your cgi paths.

Last but not least, you must create an "include_login" template file with something like this:

Code:

<%if Username%>
[<a href='<%db_cgi_url%>/user.cgi?logout=1'>Sign Out</a>,
<a href='<%db_cgi_url%>/user.cgi'>My Account</a>]
<%else%>
<a href="<%db_cgi_url%>/user.cgi">Sign In</a>
<%endif%>



Although javascript can seem easier, it is run from the user end. I am just completly anti-javascript when there is no need for it.

Hope someone uses this,

- Jonathan
Subject Author Views Date
Thread; hot thread Auth_vBulletin and Authentication Red5 16545 Sep 23, 2006, 10:55 AM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 15996 Sep 30, 2006, 8:24 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15987 Sep 30, 2006, 8:41 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15972 Sep 30, 2006, 9:01 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 15953 Sep 30, 2006, 9:31 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15959 Sep 30, 2006, 9:34 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 16001 Sep 30, 2006, 9:40 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 15964 Sep 30, 2006, 9:43 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 15907 Sep 30, 2006, 9:46 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15964 Sep 30, 2006, 9:46 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15956 Sep 30, 2006, 9:55 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15939 Sep 30, 2006, 10:33 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15966 Sep 30, 2006, 10:41 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 16024 Sep 30, 2006, 11:08 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15940 Sep 30, 2006, 11:17 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15900 Sep 30, 2006, 11:34 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15901 Sep 30, 2006, 11:39 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15918 Sep 30, 2006, 12:04 PM
Post; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15853 Sep 30, 2006, 12:20 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15861 Sep 30, 2006, 12:22 PM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
jdgamble 15951 Sep 30, 2006, 1:12 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15868 Sep 30, 2006, 2:35 PM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
jdgamble 15862 Sep 30, 2006, 3:01 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15903 Sep 30, 2006, 3:08 PM
Post; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 15812 Oct 1, 2006, 3:47 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 8307 Oct 1, 2006, 4:42 AM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 8233 Oct 1, 2006, 9:01 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 8195 Oct 1, 2006, 9:05 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8231 Oct 4, 2006, 12:05 AM
Thread; hot thread Re: [aus_dave] Auth_vBulletin and Authentication
swissbob 8259 Oct 4, 2006, 5:53 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8189 Oct 4, 2006, 6:28 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 8237 Nov 15, 2006, 3:06 PM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
brewt 8277 Nov 15, 2006, 5:57 PM
Thread; hot thread Re: [brewt] Auth_vBulletin and Authentication
swissbob 8158 Nov 15, 2006, 7:28 PM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
brewt 8224 Nov 15, 2006, 7:41 PM
Thread; hot thread Re: [brewt] Auth_vBulletin and Authentication
swissbob 8216 Nov 16, 2006, 3:41 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
garrynz 8139 Nov 19, 2006, 2:00 AM
Post; hot thread Re: [garrynz] Auth_vBulletin and Authentication
swissbob 8154 Nov 19, 2006, 10:42 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8200 Nov 19, 2006, 7:41 PM
Thread; hot thread Re: [aus_dave] Auth_vBulletin and Authentication
swissbob 8173 Nov 24, 2006, 7:25 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 8104 Nov 29, 2006, 5:47 AM