Code Search for Developers
 
 
  

excel.html from AlphaMail at Krugle


Show excel.html syntax highlighted

% # vim: set syntax=mason: 
<%args>
$file
$format => 'text'
</%args>
<%init>
my $logger = Log::Log4perl->get_logger('alphamail');
my $user = Apache::SiteControl->getCurrentUser($r);
my $prefix = $config->get("message_tmpdir", "/tmp");
my $legal = "/" . $user->getAttribute('imap') .  "_" . $user->getUsername();
my $username = $user->getUsername();
my $xlhtml = $config->get('xlhtml');
my $sandbox_dir = $config->get('sandbox');
my $sandbox = $config->get('sandbox_util');

if($file !~ m/^\Q$legal\E/i || $file =~ m!/\.\./!) {
   $logger->logcroak("Security Violation! $username attempted to view $file. Prefix was $prefix");
}

my $name = $file;
$name =~ s!^.*/([^/]*)$!$1!;
unlink "$sandbox_dir/tmp/$name";
link "$prefix$file", "$sandbox_dir/tmp/$name" or $logger->error("Could not create link from $file to $sandbox_dir/tmp");

$r->content_type('text/html');
my @lines = qx($sandbox $xlhtml '/tmp/$name' 2>&1);
unlink "$sandbox_dir/tmp/$name";
$m->print(@lines);
</%init>
<%once>
$config = new AlphaMail::Config($r->dir_config('AlphamailParameters'));
</%once>




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  excel.html
  html.html
  targz.html
  text.html
  word.html
  zip.html