sub header { my ($refrerr) = @_; if ($refrerr eq 'admin') { require "../data/session.cgi"; $header = HTML::Template->new(filename => 'header.tmpl', path => ["$prog_lib/../templates/standard"]); } else { require "data/session.cgi"; $header = HTML::Template->new(filename => 'header.tmpl', path => ["$prog_lib/templates/standard"]); } my $loggedin; my $loggedinuser; my $loggedinuserid; my $cgi = new CGI; $sid = $cgi->cookie('YAMBE_SESSID') || $cgi->param('sid'); $header->param(L_TITLE => $lang{title}); $header->param(L_REGISTER => $lang{Register}); $header->param(L_TODAY => $lang{Today}); $header->param(L_CALENDAR => $lang{Calendar}); $header->param(L_MONTHSUMMERY => $lang{Monthsummery}); $header->param(L_SEARCH => $lang{Search}); $header->param(ROOT_PATH => $root_path); $header->param(U_REGISTER => &add_session($root_path . "/cgi-bin/yambe/register.cgi")); $header->param(U_TODAY => &add_session($root_path . "/cgi-bin/yambe/event.cgi")); $header->param(U_CALENDAR => &add_session($root_path . "/cgi-bin/yambe/kalender.cgi")); $header->param(U_MONTHSUMMERY => &add_session($root_path . "/cgi-bin/yambe/monat.cgi")); $header->param(U_SEARCH => &add_session($root_path . "/cgi-bin/yambe/search.cgi")); if (defined ($sid)) { ($loggedin,$loggedinuser,$loggedinuserid) = &init; } if ($loggedin != 1) { $header->param(USER_LOGGED_OUT => 1); $header->param(L_PROFILE_REGISTER => $lang{Profile_Register}); $header->param(L_LOGIN => $lang{Login}); $header->param(U_PROFILE_REGISTER => $root_path . "/cgi-bin/yambe/profile.cgi?action=register"); $header->param(U_LOGIN => $root_path . "/cgi-bin/yambe/login.cgi"); } else { $header->param(USER_LOGGED_IN => 1); $header->param(L_LOGOUT => sprintf($lang{Logout},$loggedinuser)); $header->param(L_PROFILE => $lang{Profil}); $header->param(U_LOGOUT => $root_path . "/cgi-bin/yambe/login.cgi?action=logout"); my $test = &add_session($root_path . "/cgi-bin/yambe/profile.cgi"); $header->param(U_PROFILE => $test . "&action=edit&u=$loggedinuserid"); } print "Content-Type: text/html\n\n"; print $header->output; }