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 16541 Sep 23, 2006, 10:55 AM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 15991 Sep 30, 2006, 8:24 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15983 Sep 30, 2006, 8:41 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15967 Sep 30, 2006, 9:01 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 15949 Sep 30, 2006, 9:31 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15955 Sep 30, 2006, 9:34 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15997 Sep 30, 2006, 9:40 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 15960 Sep 30, 2006, 9:43 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 15903 Sep 30, 2006, 9:46 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15959 Sep 30, 2006, 9:46 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15952 Sep 30, 2006, 9:55 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15934 Sep 30, 2006, 10:33 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15962 Sep 30, 2006, 10:41 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 16020 Sep 30, 2006, 11:08 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15936 Sep 30, 2006, 11:17 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15896 Sep 30, 2006, 11:34 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15897 Sep 30, 2006, 11:39 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15914 Sep 30, 2006, 12:04 PM
Post; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15849 Sep 30, 2006, 12:20 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15857 Sep 30, 2006, 12:22 PM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
jdgamble 15947 Sep 30, 2006, 1:12 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15864 Sep 30, 2006, 2:35 PM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
jdgamble 15858 Sep 30, 2006, 3:01 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15899 Sep 30, 2006, 3:08 PM
Post; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 15808 Oct 1, 2006, 3:47 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 8306 Oct 1, 2006, 4:42 AM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 8232 Oct 1, 2006, 9:01 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 8194 Oct 1, 2006, 9:05 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8230 Oct 4, 2006, 12:05 AM
Thread; hot thread Re: [aus_dave] Auth_vBulletin and Authentication
swissbob 8258 Oct 4, 2006, 5:53 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8188 Oct 4, 2006, 6:28 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 8236 Nov 15, 2006, 3:06 PM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
brewt 8276 Nov 15, 2006, 5:57 PM
Thread; hot thread Re: [brewt] Auth_vBulletin and Authentication
swissbob 8157 Nov 15, 2006, 7:28 PM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
brewt 8223 Nov 15, 2006, 7:41 PM
Thread; hot thread Re: [brewt] Auth_vBulletin and Authentication
swissbob 8215 Nov 16, 2006, 3:41 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
garrynz 8138 Nov 19, 2006, 2:00 AM
Post; hot thread Re: [garrynz] Auth_vBulletin and Authentication
swissbob 8153 Nov 19, 2006, 10:42 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8199 Nov 19, 2006, 7:41 PM
Thread; hot thread Re: [aus_dave] Auth_vBulletin and Authentication
swissbob 8172 Nov 24, 2006, 7:25 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 8103 Nov 29, 2006, 5:47 AM