AxKit::App::TABOO::AddXSLParams::Session - Minimal session parameter XSLT access for TABOO


AxKit-App-TABOO documentation Contained in the AxKit-App-TABOO distribution.

Index


Code Index:

NAME

Top

AxKit::App::TABOO::AddXSLParams::Session - Minimal session parameter XSLT access for TABOO

SYNOPSIS

Top

  # in httpd.conf or .htaccess
  AxAddPlugin AxKit::App::TABOO::AddXSLParams::Session

DESCRIPTION

Top

AxKit::App::TABOO::AddXSLParams::Session provides a way to pass the critical session info to XSLT params.

Like A:A:P:A:Request, you can access session values by defining a specially named XSL parameter. These three are available, and can be used as the final example indicates:

  <xsl:param name="session.id"/>
  <xsl:param name="session.authlevel"/>
  <xsl:param name="session.loggedin"/>

  ...
  <xsl:value-of select="$session.loggedin"/>

These parameters can supply the session ID, the authorisation level and the username of the logged in user. If there is no logged in user, the latter will return 0 and guest respectively.

SEE ALSO

Top

Apache::AxKit::Plugin::AddXSLParams::Request

FORMALITIES

Top

See AxKit::App::TABOO.


AxKit-App-TABOO documentation Contained in the AxKit-App-TABOO distribution.

package AxKit::App::TABOO::AddXSLParams::Session;
use 5.6.0;
use strict;
use warnings;
use AxKit;
use AxKit::App::TABOO;
use Session;
use Apache::Constants;
use Apache::Cookie;
use Apache::Request;
use Apache::URI;
use AxKit::App::TABOO;

our $VERSION = '0.1';

sub handler {
  my $r = shift;
  my $uri = $r->uri;
  my $cgi = Apache::Request->instance($r);
  
  my $session = AxKit::App::TABOO::session($r);
  if (defined($session)) {
    $cgi->parms->set('session.id' => $session->session_id);
    $cgi->parms->set('session.authlevel' => AxKit::App::TABOO::authlevel($session));    
    $cgi->parms->set('session.loggedin' => AxKit::App::TABOO::loggedin($session));
  } else {
    $cgi->parms->set('session.authlevel' => '0');
    $cgi->parms->set('session.loggedin' => 'guest');
  }
  return OK;
}

1;
__END__