#my $request_class = 'HTML::Mason::Request'.
#( $mode eq 'apache' ? '::ApacheHandler' : '' );
- my $request_class = 'FS::Mason::Request';
+ my $request_class = $mode eq 'standalone' ? 'FS::Mason::StandaloneRequest'
+ : 'FS::Mason::Request';
#not entirely sure it belongs here, but what the hey
if ( %%%RT_ENABLED%%% && $mode ne 'standalone' ) {
my %opt = @_;
my $mode = $superclass =~ /Apache/i ? 'apache' : 'standalone';
- freeside_setup($opt{'comp'}, $mode);
+ $class->freeside_setup($opt{'comp'}, $mode);
$class->SUPER::new(@_);
# for Mason 1.39 vs. Perl 5.10.0
sub freeside_setup {
-
- my( $filename, $mode ) = @_;
+ my( $class, $filename, $mode ) = @_;
if ( $filename =~ qr(/REST/\d+\.\d+/NoAuth/) ) {
--- /dev/null
+package FS::Mason::StandaloneRequest;
+
+use strict;
+use warnings;
+use base 'FS::Mason::Request';
+
+sub new {
+ my $class = shift;
+
+ $class->alter_superclass('HTML::Mason::Request');
+
+ #huh... shouldn't alter_superclass take care of this for us?
+ __PACKAGE__->valid_params( %{ HTML::Mason::Request->valid_params() } );
+
+ my %opt = @_;
+ #its already been altered# $class->freeside_setup($opt{'comp'}, 'standalone');
+ FS::Mason::Request->freeside_setup($opt{'comp'}, 'standalone');
+
+ $class->SUPER::new(@_);
+
+}
+
+1;
#for now, same db as specified in DATASOURCE... eventually, otherwise?
RT_DB_DATABASE = freeside
+TORRUS_ENABLED = 0
+
# for cvs-upgrade-deploy target, the username who checked out the CVS copy.
CVS_USER = ivan
[ -d ${APACHE_CONF} ] && \
( install -o root -m 755 htetc/freeside-base${APACHE_VERSION}.conf ${APACHE_CONF} && \
( [ ${RT_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-rt.conf ${APACHE_CONF} || true ) && \
+ ( [ ${TORRUS_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-torrus.conf ${APACHE_CONF} || true ) && \
perl -p -i -e "\
s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
s'%%%FREESIDE_CONF%%%'${FREESIDE_CONF}'g; \
s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
" ${RT_PATH}/etc/RT_SiteConfig.pm; fi
+configure-torrus:
+ cd torrus; \
+ torrus_user=freeside var_user=freeside var_group=freeside ./configure
+
+install-torrus:
+ cd torrus; \
+ make; \
+ make install
+ perl -p -i -e "\
+ s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
+ " /usr/local/etc/torrus/conf/torrus-siteconfig.pl
+
clean:
rm -rf masondocs
rm -rf httemplate/docs/man
--- /dev/null
+Alias /freeside/torrus/plain "/usr/local/torrus/sup/webplain"
+PerlRequire "/usr/local/torrus/conf_defaults/webmux2.pl"
+
+<Location /freeside/torrus>
+ SetHandler perl-script
+ PerlHandler Torrus::Apache2Handler
+
+ AuthName Freeside
+ AuthType Basic
+ AuthUserFile /usr/local/etc/freeside/htpasswd
+ require valid-user
+</Location>
+
+<Location /freeside/torrus/plain>
+ SetHandler default-handler
+ Options None
+
+ AuthName Freeside
+ AuthType Basic
+ AuthUserFile /usr/local/etc/freeside/htpasswd
+ require valid-user
+</Location>
Luke Pfeifer<BR>
Ricardo Signes<BR>
Steve Simitzis<BR>
+Stanislav Sinyagin<BR>
Jason Spence<BR>
James Switzer<BR>
Audrey Tang<BR>
and not a "combined work", and as such Request Tracker is distributed only
under the original GPLv2 license.
+<P>
+Contains "Torrus" <http://www.torrus.org/> from Stanislav Sinyagin / K-Open
+GmbH, licensed under the terms of the GNU GPL.
+
<!--important widgets or other "whole" bits-->
<P>
--- /dev/null
+i should move to the wiki once this is further along
+
+aptitude install rrdtool librrds-perl libxml-libxml-perl libberkeleydb-perl libtemplate-perl libproc-daemon-perl libnet-snmp-perl libapache-session-perl libjson-perl
+
+make configure-torrus
+make install-torrus
+
+#(and for the apache config)
+# in Makefile, set TORRUS_ENABLED = 1
+make install-apache
+
(
'main' => {
'description' => 'The main tree',
- 'info' => 'some tree',
+ 'info' => 'main tree', #'some tree', #per-agent?
'xmlfiles' => [qw(routers.xml)],
'run' => { 'collector' => 1, 'monitor' => 0 } }
);
# $Torrus::Renderer::companyURL = 'http://torrus.sf.net';
# $Torrus::Renderer::siteInfo = `hostname`;
+#Freeside
+$Torrus::CGI::authorizeUsers = 0;
+$Torrus::Renderer::rendererURL = '/freeside/torrus';
+$Torrus::Renderer::plainURL = '/freeside/torrus/plain/';
+$Torrus::Renderer::Freeside::FSURL = '%%%FREESIDE_URL%%%';
1;
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-# $Id: CGI.pm,v 1.1 2010-12-27 00:03:43 ivan Exp $
+# $Id: CGI.pm,v 1.2 2010-12-27 08:40:19 ivan Exp $
# Stanislav Sinyagin <ssinyagin@yahoo.com>
# Universal CGI handler for Apache mod_perl and FastCGI
## Torrus::CGI->process($q)
## Expects a CGI object as input
+our $q;
+
sub process
{
- my($class, $q) = @_;
+ #my($class, $q) = @_;
+ my $class = shift;
+ $q = shift;
my $path_info = $q->url(-path => 1);
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-# $Id: Renderer.pm,v 1.1 2010-12-27 00:03:39 ivan Exp $
+# $Id: Renderer.pm,v 1.2 2010-12-27 08:40:19 ivan Exp $
# Stanislav Sinyagin <ssinyagin@yahoo.com>
package Torrus::Renderer;
use base qw(Torrus::Renderer::HTML
Torrus::Renderer::RRDtool
Torrus::Renderer::Frontpage
- Torrus::Renderer::AdmInfo);
+ Torrus::Renderer::AdmInfo
+ Torrus::Renderer::Freeside
+ );
sub new
{
--- /dev/null
+package Torrus::Renderer::Freeside;
+
+use strict;
+
+#Freeside
+use FS::Mason qw( mason_interps );
+use FS::UID qw(cgisuidsetup);
+use FS::TicketSystem;
+
+my $outbuf;
+my( $fs_interp, $rt_interp ) = mason_interps('standalone', 'outbuf'=>\$outbuf);
+
+sub freesideHeader {
+ my($self, $title, $stylesheet, $c) = (shift, shift);
+
+ #from html-incblocks.txt
+ my $head =
+ # <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
+ # [% IF expires %]<META HTTP-EQUIV="Refresh" CONTENT="[% expires %]"/>[% END %]
+ '<STYLE type="text/css" media="all">
+ @import url( '. $Torrus::Renderer::plainURL. $stylesheet. ' );
+ </STYLE>
+ ';
+
+ $self->freesideComponent('/elements/header.html',
+ {
+ 'title' => $title,
+ 'head' => $head,
+ #'etc' => $etc,
+ 'nobr' => 1,
+ #'nocss' => 1,
+ }
+ );
+}
+
+sub freesideFooter {
+ my $self = shift;
+ $self->FreesideComponent('/elements/footer.html');
+}
+
+our $FSURL;
+
+sub freesideComponent {
+ my($self, $comp) = (shift, shift);
+
+# my $conf = new FS::Conf;
+ $FS::Mason::Request::FSURL = $FSURL;
+ $FS::Mason::Request::FSURL .= '/' unless $FS::Mason::Request::FSURL =~ /\/$/;
+# $FS::Mason::Request::QUERY_STRING = $packet->{'query_string'} || '';
+
+ cgisuidsetup($Torrus::CGI::q);
+ FS::TicketSystem->init();
+
+ $outbuf = '';
+ #$fs_interp->exec($comp, @args); #only FS for now alas...
+ $fs_interp->exec($comp, @_); #only FS for now alas...
+
+ #errors? (turn off in-line error reporting?)
+
+ return $outbuf;
+
+}
+
+1;
+
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-# $Id: Frontpage.pm,v 1.1 2010-12-27 00:03:44 ivan Exp $
+# $Id: Frontpage.pm,v 1.2 2010-12-27 08:40:19 ivan Exp $
# Stanislav Sinyagin <ssinyagin@yahoo.com>
package Torrus::Renderer::Frontpage;
hasPrivilege( $_[0], 'DisplayTree' ) }
,
'mayGlobalSearch' => sub { return $self->mayGlobalSearch(); },
- 'searchResults' => sub { return $self->doGlobalSearch($_[0]); }
+ 'searchResults' => sub { return $self->doGlobalSearch($_[0]); },
+
+ #Freeside
+ 'freesideHeader' => sub { return $self->freesideHeader(@_); },
+ 'freesideFooter' => sub { return $self->freesideFooter(); },
};
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-# $Id: HTML.pm,v 1.1 2010-12-27 00:03:44 ivan Exp $
+# $Id: HTML.pm,v 1.2 2010-12-27 08:40:19 ivan Exp $
# Stanislav Sinyagin <ssinyagin@yahoo.com>
package Torrus::Renderer::HTML;
'verifyDate' => sub { return verifyDate($_[0]); },
'markup' => sub{ return $self->translateMarkup( @_ ); },
'searchEnabled' => $Torrus::Renderer::searchEnabled,
- 'searchResults' => sub { return $self->doSearch($config_tree, $_[0]); }
+ 'searchResults' => sub { return $self->doSearch($config_tree, $_[0]); },
+
+ #Freeside
+ 'FreesideHeader' => sub { return $self->FreesideHeader(@_); },
+ 'freesideFooter' => sub { return $self->freesideFooter(); },
};
[%#
- $Id: html-incblocks.txt,v 1.1 2010-12-27 00:04:03 ivan Exp $
+ $Id: html-incblocks.txt,v 1.2 2010-12-27 08:40:19 ivan Exp $
All BLOCK statements are defined here
%]
[% BLOCK htmlstart;
IF ! contentClass; contentClass="Content"; END %]
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<HTML>
-<!-- Torrus Copyright (c) 2003-2004 Stanislav Sinyagin -->
-<HEAD>
+
+[% freesideHeader(title, style('stylesheet')) %]
+
<SCRIPT language="JavaScript">
<!--
function helpwindow()
}
//-->
</SCRIPT>
-<TITLE>[% title %]</TITLE>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
-[% IF expires %]<META HTTP-EQUIV="Refresh" CONTENT="[% expires %]"/>[% END %]
-<STYLE type="text/css" media="all">
- @import url( [% plainURL _ style('stylesheet') %] );
- [% cssoverlay = style('cssoverlay'); IF cssoverlay; %]
- @import url( [% cssoverlay %] );
- [% END %]
-</STYLE>
-</HEAD>
-<BODY>
<DIV CLASS="Header">
-<SPAN CLASS="CompanyInfo">
-<A TITLE="company info"
-HREF="[%companyURL%]">[% IF companyLogo %]<IMG SRC="[%companyLogo%]"
-ALT=[%companyName%] STYLE="border:0">[% ELSE; companyName; END %]</A>
-</SPAN>
-
[% IF siteInfo %]
<SPAN CLASS="SiteInfo">
[% siteInfo %]