WebGUI 2.3.3 release
This commit is contained in:
parent
12f9388a06
commit
73909699ff
8 changed files with 153 additions and 58 deletions
|
|
@ -19,10 +19,10 @@ my %international;
|
|||
#-------------------------------------------------------------------
|
||||
sub get {
|
||||
my ($output, $language, $namespace);
|
||||
if ($session{user}{language} ne "") {
|
||||
$language = $session{user}{language};
|
||||
} elsif ($_[2] ne "") {
|
||||
if ($_[2] ne "") {
|
||||
$language = $_[2];
|
||||
} elsif ($session{user}{language} ne "") {
|
||||
$language = $session{user}{language};
|
||||
} else {
|
||||
$language = "English";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ package WebGUI::Operation::Statistics;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use Exporter;
|
||||
use HTTP::Request;
|
||||
use HTTP::Headers;
|
||||
use LWP::UserAgent;
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
|
|
@ -22,12 +25,22 @@ our @EXPORT = qw(&www_viewStatistics);
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewStatistics {
|
||||
my ($output, $data);
|
||||
my ($output, $data, $header, $userAgent, $request, $response, $version, $referer);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$userAgent = new LWP::UserAgent;
|
||||
$userAgent->agent("WebGUI-Check/2.0");
|
||||
$header = new HTTP::Headers;
|
||||
$referer = "http://webgui.web.getversion/".$session{env}{SERVER_NAME}.$session{env}{REQUEST_URI};
|
||||
chomp $referer;
|
||||
$header->referer($referer);
|
||||
$request = new HTTP::Request (GET => "http://www.plainblack.com/downloads/latest-version.txt", $header);
|
||||
$response = $userAgent->request($request);
|
||||
$version = $response->content;
|
||||
chomp $version;
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(144).'</h1>';
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(145).'</td><td class="tableData">'.$WebGUI::VERSION.'</td></tr>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(145).'</td><td class="tableData">'.$WebGUI::VERSION.' ('.WebGUI::International::get(349).': '.$version.')</td></tr>';
|
||||
($data) = WebGUI::SQL->quickArray("select count(*) from session",$session{dbh});
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(146).'</td><td class="tableData">'.$data.'</td></tr>';
|
||||
($data) = WebGUI::SQL->quickArray("select count(*)+1 from page where parentId>25",$session{dbh});
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ our @EXPORT = qw(&www_viewPendingSubmissions &www_approveSubmission &www_denySub
|
|||
#-------------------------------------------------------------------
|
||||
sub www_approveSubmission {
|
||||
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
|
||||
WebGUI::SQL->write("update submission set status='Approved' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
WebGUI::SQL->write("update UserSubmission_submission set status='Approved' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_viewPendingSubmissions();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -35,7 +35,7 @@ sub www_approveSubmission {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_denySubmission {
|
||||
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
|
||||
WebGUI::SQL->write("update submission set status='Denied' where submissionId=$session{form}{sid}",$session{dbh}
|
||||
WebGUI::SQL->write("update UserSubmission_submission set status='Denied' where submissionId=$session{form}{sid}",$session{dbh}
|
||||
);
|
||||
return www_viewPendingSubmissions();
|
||||
} else {
|
||||
|
|
@ -48,7 +48,7 @@ sub www_viewPendingSubmissions {
|
|||
my (@submission, $output, $sth, @row, $i, $pn);
|
||||
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
|
||||
$output = '<h1>'.WebGUI::International::get(159).'</h1>';
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId,widgetId from submission where status='Pending' order by dateSubmitted",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId,widgetId from UserSubmission_submission where status='Pending' order by dateSubmitted",$session{dbh});
|
||||
while (@submission = $sth->array) {
|
||||
$row[$i] = '<tr><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$submission[5].'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%m/%d/%Y").'</td><td class="tableData">'.$submission[3].'</td></tr>';
|
||||
$i++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue