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 16443 Sep 23, 2006, 10:55 AM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 15893 Sep 30, 2006, 8:24 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15887 Sep 30, 2006, 8:41 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15871 Sep 30, 2006, 9:01 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 15852 Sep 30, 2006, 9:31 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15856 Sep 30, 2006, 9:34 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15899 Sep 30, 2006, 9:40 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 15863 Sep 30, 2006, 9:43 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 15806 Sep 30, 2006, 9:46 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15861 Sep 30, 2006, 9:46 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15854 Sep 30, 2006, 9:55 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15837 Sep 30, 2006, 10:33 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15864 Sep 30, 2006, 10:41 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15922 Sep 30, 2006, 11:08 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15839 Sep 30, 2006, 11:17 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15799 Sep 30, 2006, 11:34 AM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15801 Sep 30, 2006, 11:39 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
jdgamble 15817 Sep 30, 2006, 12:04 PM
Post; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
swissbob 15752 Sep 30, 2006, 12:20 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15761 Sep 30, 2006, 12:22 PM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
jdgamble 15851 Sep 30, 2006, 1:12 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15767 Sep 30, 2006, 2:35 PM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
jdgamble 15762 Sep 30, 2006, 3:01 PM
Thread; hot thread Re: [jdgamble] Auth_vBulletin and Authentication
Red5 15802 Sep 30, 2006, 3:08 PM
Post; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 15710 Oct 1, 2006, 3:47 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 8236 Oct 1, 2006, 4:42 AM
Thread; hot thread Re: [Red5] Auth_vBulletin and Authentication
swissbob 8162 Oct 1, 2006, 9:01 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
Red5 8124 Oct 1, 2006, 9:05 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8160 Oct 4, 2006, 12:05 AM
Thread; hot thread Re: [aus_dave] Auth_vBulletin and Authentication
swissbob 8186 Oct 4, 2006, 5:53 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8119 Oct 4, 2006, 6:28 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 8165 Nov 15, 2006, 3:06 PM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
brewt 8207 Nov 15, 2006, 5:57 PM
Thread; hot thread Re: [brewt] Auth_vBulletin and Authentication
swissbob 8086 Nov 15, 2006, 7:28 PM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
brewt 8153 Nov 15, 2006, 7:41 PM
Thread; hot thread Re: [brewt] Auth_vBulletin and Authentication
swissbob 8144 Nov 16, 2006, 3:41 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
garrynz 8067 Nov 19, 2006, 2:00 AM
Post; hot thread Re: [garrynz] Auth_vBulletin and Authentication
swissbob 8084 Nov 19, 2006, 10:42 AM
Thread; hot thread Re: [swissbob] Auth_vBulletin and Authentication
aus_dave 8130 Nov 19, 2006, 7:41 PM
Thread; hot thread Re: [aus_dave] Auth_vBulletin and Authentication
swissbob 8102 Nov 24, 2006, 7:25 AM
Post; hot thread Re: [swissbob] Auth_vBulletin and Authentication
swissbob 8034 Nov 29, 2006, 5:47 AM