2005-07-30 00:21:01 +04:00
|
|
|
#!/usr/bin/perl -w
|
2005-10-11 22:44:16 +04:00
|
|
|
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
|
|
|
|
|
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1
|
2005-07-30 00:21:01 +04:00
|
|
|
#
|
2005-10-11 22:44:16 +04:00
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
2005-07-30 00:21:01 +04:00
|
|
|
#
|
2005-10-11 22:44:16 +04:00
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
2005-07-30 00:21:01 +04:00
|
|
|
#
|
|
|
|
# The Original Code is Litmus.
|
|
|
|
#
|
2005-10-11 22:44:16 +04:00
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# the Mozilla Corporation.
|
2006-01-25 20:03:40 +03:00
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2006
|
2005-10-11 22:44:16 +04:00
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
# Chris Cooper <ccooper@deadsquid.com>
|
|
|
|
# Zach Lipton <zach@zachlipton.com>
|
2005-07-30 00:21:01 +04:00
|
|
|
#
|
2005-10-11 22:44:16 +04:00
|
|
|
# ***** END LICENSE BLOCK *****
|
2005-07-30 00:21:01 +04:00
|
|
|
|
|
|
|
use strict;
|
2005-10-11 22:44:16 +04:00
|
|
|
$|++;
|
2005-07-30 00:21:01 +04:00
|
|
|
|
2007-04-18 05:57:45 +04:00
|
|
|
my $t0;
|
|
|
|
if ($Litmus::Config::DEBUG) {
|
|
|
|
use Time::HiRes qw( gettimeofday tv_interval );
|
|
|
|
$t0 = [gettimeofday];
|
|
|
|
}
|
2005-07-30 00:21:01 +04:00
|
|
|
|
|
|
|
use Litmus;
|
2005-10-11 22:44:16 +04:00
|
|
|
use Litmus::Auth;
|
2005-07-30 00:21:01 +04:00
|
|
|
use Litmus::Error;
|
2007-04-18 05:57:45 +04:00
|
|
|
use Litmus::DB::TestRun;
|
2006-08-02 00:50:15 +04:00
|
|
|
|
|
|
|
Litmus->init();
|
2005-07-30 00:21:01 +04:00
|
|
|
|
2006-01-08 06:56:10 +03:00
|
|
|
my $c = Litmus->cgi();
|
2005-07-30 00:21:01 +04:00
|
|
|
print $c->header();
|
|
|
|
|
2005-10-11 22:44:16 +04:00
|
|
|
my $vars = {
|
2007-04-18 05:57:45 +04:00
|
|
|
title => 'Active Test Runs',
|
2005-10-11 22:44:16 +04:00
|
|
|
};
|
|
|
|
|
2007-04-18 05:57:45 +04:00
|
|
|
my @test_runs = Litmus::DB::TestRun->getTestRuns(1,'all',5);
|
|
|
|
|
|
|
|
if (@test_runs and scalar @test_runs > 0) {
|
|
|
|
$vars->{'active_test_runs'} = \@test_runs;
|
2005-10-11 22:44:16 +04:00
|
|
|
}
|
|
|
|
|
2006-01-08 06:56:10 +03:00
|
|
|
my $user = Litmus::Auth::getCurrentUser();
|
|
|
|
if ($user) {
|
2007-04-18 05:57:45 +04:00
|
|
|
$vars->{"defaultemail"} = $user;
|
|
|
|
$vars->{"show_admin"} = $user->is_admin();
|
2006-01-08 06:56:10 +03:00
|
|
|
}
|
2005-10-11 22:44:16 +04:00
|
|
|
|
|
|
|
Litmus->template()->process("index.tmpl", $vars) ||
|
2005-10-19 05:06:34 +04:00
|
|
|
internalError(Litmus->template()->error());
|
2005-10-11 22:44:16 +04:00
|
|
|
|
2007-04-18 05:57:45 +04:00
|
|
|
if ($Litmus::Config::DEBUG) {
|
|
|
|
my $elapsed = tv_interval ( $t0 );
|
|
|
|
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
|
|
|
|
}
|
2005-10-11 22:44:16 +04:00
|
|
|
|
|
|
|
exit 0;
|
|
|
|
|
|
|
|
|
2005-07-30 00:21:01 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|