WebGUI 2.3.3 release

This commit is contained in:
JT Smith 2001-11-02 02:09:00 +00:00
parent 12f9388a06
commit 73909699ff
8 changed files with 153 additions and 58 deletions

View file

@ -1197,6 +1197,7 @@ INSERT INTO international VALUES (343,'WebGUI','Deutsch','Profil anschauen.');
INSERT INTO international VALUES (345,'WebGUI','Deutsch','Kein Mitglied'); INSERT INTO international VALUES (345,'WebGUI','Deutsch','Kein Mitglied');
INSERT INTO international VALUES (346,'WebGUI','Deutsch','Dieser Benutzer ist kein Mitglied. Wir haben keine weiteren Informationen über ihn.'); INSERT INTO international VALUES (346,'WebGUI','Deutsch','Dieser Benutzer ist kein Mitglied. Wir haben keine weiteren Informationen über ihn.');
INSERT INTO international VALUES (347,'WebGUI','Deutsch','Profil anschauen von'); INSERT INTO international VALUES (347,'WebGUI','Deutsch','Profil anschauen von');
INSERT INTO international VALUES (349,'WebGUI','English','Latest version available');
# #
# Table structure for table 'message' # Table structure for table 'message'
@ -1329,7 +1330,7 @@ INSERT INTO settings VALUES ('profileExtraContact','1');
INSERT INTO settings VALUES ('profileMisc','1'); INSERT INTO settings VALUES ('profileMisc','1');
INSERT INTO settings VALUES ('profileHome','0'); INSERT INTO settings VALUES ('profileHome','0');
INSERT INTO settings VALUES ('profileWork','0'); INSERT INTO settings VALUES ('profileWork','0');
INSERT INTO settings VALUES ('VERSION','2.3.2'); INSERT INTO settings VALUES ('VERSION','2.3.3');
# #
# Table structure for table 'style' # Table structure for table 'style'

View file

@ -132,7 +132,7 @@ CREATE TABLE LinkList (
CREATE TABLE LinkList_link ( CREATE TABLE LinkList_link (
widgetId int(11) default NULL, widgetId int(11) default NULL,
linkId int(11) NOT NULL default '0', linkId int(11) NOT NULL default '0',
name varchar(30) default NULL, name varchar(128) default NULL,
url text, url text,
description text, description text,
sequenceNumber int(11) NOT NULL default '0', sequenceNumber int(11) NOT NULL default '0',
@ -293,7 +293,7 @@ CREATE TABLE UserSubmission (
CREATE TABLE UserSubmission_submission ( CREATE TABLE UserSubmission_submission (
widgetId int(11) default NULL, widgetId int(11) default NULL,
submissionId int(11) NOT NULL default '0', submissionId int(11) NOT NULL default '0',
title varchar(30) default NULL, title varchar(128) default NULL,
dateSubmitted int(11) default NULL, dateSubmitted int(11) default NULL,
username varchar(30) default NULL, username varchar(30) default NULL,
userId int(11) default NULL, userId int(11) default NULL,
@ -1329,6 +1329,7 @@ INSERT INTO settings VALUES ('profileExtraContact','1');
INSERT INTO settings VALUES ('profileMisc','1'); INSERT INTO settings VALUES ('profileMisc','1');
INSERT INTO settings VALUES ('profileHome','0'); INSERT INTO settings VALUES ('profileHome','0');
INSERT INTO settings VALUES ('profileWork','0'); INSERT INTO settings VALUES ('profileWork','0');
INSERT INTO settings VALUES ('VERSION','2.3.2');
# #
# Table structure for table 'style' # Table structure for table 'style'

View file

@ -0,0 +1,3 @@
insert into international values ('349','WebGUI','English','Latest version available');
update settings set value='2.3.3' where name='VERSION';

View file

@ -1,5 +1,5 @@
package WebGUI; package WebGUI;
our $VERSION = "2.3.2"; our $VERSION = "2.3.3";
#------------------------------------------------------------------- #-------------------------------------------------------------------
# WebGUI is Copyright 2001 Plain Black Software. # WebGUI is Copyright 2001 Plain Black Software.

View file

@ -19,10 +19,10 @@ my %international;
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub get { sub get {
my ($output, $language, $namespace); my ($output, $language, $namespace);
if ($session{user}{language} ne "") { if ($_[2] ne "") {
$language = $session{user}{language};
} elsif ($_[2] ne "") {
$language = $_[2]; $language = $_[2];
} elsif ($session{user}{language} ne "") {
$language = $session{user}{language};
} else { } else {
$language = "English"; $language = "English";
} }

View file

@ -11,6 +11,9 @@ package WebGUI::Operation::Statistics;
#------------------------------------------------------------------- #-------------------------------------------------------------------
use Exporter; use Exporter;
use HTTP::Request;
use HTTP::Headers;
use LWP::UserAgent;
use strict; use strict;
use WebGUI::International; use WebGUI::International;
use WebGUI::Privilege; use WebGUI::Privilege;
@ -22,12 +25,22 @@ our @EXPORT = qw(&www_viewStatistics);
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_viewStatistics { sub www_viewStatistics {
my ($output, $data); my ($output, $data, $header, $userAgent, $request, $response, $version, $referer);
if (WebGUI::Privilege::isInGroup(3)) { 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 .= '<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 .= '<h1>'.WebGUI::International::get(144).'</h1>';
$output .= '<table>'; $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}); ($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>'; $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}); ($data) = WebGUI::SQL->quickArray("select count(*)+1 from page where parentId>25",$session{dbh});

View file

@ -25,7 +25,7 @@ our @EXPORT = qw(&www_viewPendingSubmissions &www_approveSubmission &www_denySub
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_approveSubmission { sub www_approveSubmission {
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) { 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(); return www_viewPendingSubmissions();
} else { } else {
return WebGUI::Privilege::insufficient(); return WebGUI::Privilege::insufficient();
@ -35,7 +35,7 @@ sub www_approveSubmission {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_denySubmission { sub www_denySubmission {
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) { 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(); return www_viewPendingSubmissions();
} else { } else {
@ -48,7 +48,7 @@ sub www_viewPendingSubmissions {
my (@submission, $output, $sth, @row, $i, $pn); my (@submission, $output, $sth, @row, $i, $pn);
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) { if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
$output = '<h1>'.WebGUI::International::get(159).'</h1>'; $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) { 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>'; $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++; $i++;

View file

@ -8,14 +8,46 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
# Yeah if you're looking at this code you're probably thinking to
# yourself, "What a #$@*ing mess!" That's what we think too. But
# if you know Perl well enough to know that this sux, then you
# probably don't need to use this script cuz you know how to
# install Perl modules and such.
BEGIN { BEGIN {
unshift (@INC, "./lib"); unshift (@INC, "./lib");
} }
use strict; use strict;
use CPAN;
if ($ARGV[0] eq "--help" || $ARGV[0] eq "/?" || $ARGV[0] eq "/help" || $ARGV[0] eq "-?" || $ARGV[0] eq "-help" || $ARGV[0] eq "help") {
print "Usage: ".$0." [option]\n";
print "\t--help\t\t\tPrint this menu.\n";
print "\t--install-modules\tInstall any missing Perl modules.\n";
print "\n";
exit;
}
print "\nWebGUI is checking your system environment...\n\n"; print "\nWebGUI is checking your system environment...\n\n";
our $os;
if ($^O =~ /Win/i) {
$os = "Microsoftish";
} else {
$os = "Linuxish";
}
print "Operating System:\t".$os."\n";
if ($ARGV[0] eq "--install-modules" && $< != 0 && $os eq "Linuxish") {
print "You cannot install Perl modules unless you are the root user.\n";
exit;
} elsif ($ARGV[0] eq "--install-modules" && $os eq "Windowsish") {
print $0." cannot currently install Perl modules under ".$os." operating systems.\n";
exit;
}
################################### ###################################
# Checking Perl # Checking Perl
@ -26,66 +58,110 @@ if ($] >= 5.006) {
print "OK\n"; print "OK\n";
} else { } else {
print "Please upgrade to 5.6 or later!\n"; print "Please upgrade to 5.6 or later!\n";
if ($ARGV[0] ne "") {
print "Test environment exiting, cannot continue without Perl 5.6.\n";
exit;
}
} }
print "DBI module:\t\t";
if (eval { require DBI }) {
print "OK\n";
} else {
print "Please install.\n";
}
print "Database drivers:\t";
print join(", ",DBI->available_drivers);
print "\n";
print "LWP module:\t\t"; print "LWP module:\t\t";
if (eval { require LWP }) { if (eval { require LWP }) {
print "OK\n"; print "OK\n";
} else { } else {
print "Please install.\n"; if ($ARGV[0] eq "--install-modules") {
} print "Installing...\n";
CPAN::Shell->install("LWP");
print "Tie::IxHash module:\t"; } else {
if (eval { require Tie::IxHash }) { print "Please install.\n";
print "OK\n"; }
} else {
print "Please install.\n";
}
print "Tie::CPHash module:\t";
if (eval { require Tie::CPHash }) {
print "OK\n";
} else {
print "Please install.\n";
}
print "Net::SMTP module:\t";
if (eval { require Net::SMTP }) {
print "OK\n";
} else {
print "Please install.\n";
}
print "XML::RSS module:\t";
if (eval { require XML::RSS }) {
print "OK\n";
} else {
print "Please install.\n";
} }
print "Digest::MD5 module:\t"; print "Digest::MD5 module:\t";
if (eval { require Digest::MD5 }) { if (eval { require Digest::MD5 }) {
print "OK\n"; print "OK\n";
} else { } else {
print "Please install.\n"; if ($ARGV[0] eq "--install-modules") {
print "Installing...\n";
CPAN::Shell->install("Digest::MD5");
} else {
print "Please install.\n";
}
}
print "DBI module:\t\t";
if (eval { require DBI }) {
print "OK\n";
} else {
if ($ARGV[0] eq "--install-modules") {
print "Installing...\n";
CPAN::Shell->install("DBI");
} else {
print "Please install.\n";
}
}
print "Database drivers:\t";
print join(", ",DBI->available_drivers);
print "\n";
print "Tie::IxHash module:\t";
if (eval { require Tie::IxHash }) {
print "OK\n";
} else {
if ($ARGV[0] eq "--install-modules") {
print "Installing...\n";
CPAN::Shell->install("Tie::IxHash");
} else {
print "Please install.\n";
}
}
print "Tie::CPHash module:\t";
if (eval { require Tie::CPHash }) {
print "OK\n";
} else {
if ($ARGV[0] eq "--install-modules") {
print "Installing...\n";
CPAN::Shell->install("Tie::CPHash");
} else {
print "Please install.\n";
}
}
print "Net::SMTP module:\t";
if (eval { require Net::SMTP }) {
print "OK\n";
} else {
if ($ARGV[0] eq "--install-modules") {
print "Installing...\n";
CPAN::Shell->install("Net::SMTP");
} else {
print "Please install.\n";
}
}
print "XML::RSS module:\t";
if (eval { require XML::RSS }) {
print "OK\n";
} else {
if ($ARGV[0] eq "--install-modules") {
print "Installing...\n";
CPAN::Shell->install("XML::RSS");
} else {
print "Please install.\n";
}
} }
print "Net::LDAP module:\t"; print "Net::LDAP module:\t";
if (eval { require Net::LDAP }) { if (eval { require Net::LDAP }) {
print "OK\n"; print "OK\n";
} else { } else {
print "Please install.\n"; if ($ARGV[0] eq "--install-modules") {
print "Installing...\n";
CPAN::Shell->install("Net::LDAP");
} else {
print "Please install.\n";
}
} }
# this is here to insure they installed correctly. # this is here to insure they installed correctly.
@ -155,11 +231,10 @@ use HTTP::Request;
use HTTP::Headers; use HTTP::Headers;
my ($header, $userAgent, $request, $response, $version, $referer); my ($header, $userAgent, $request, $response, $version, $referer);
$userAgent = new LWP::UserAgent; $userAgent = new LWP::UserAgent;
$userAgent->agent("WebGUI-Check/1.0"); $userAgent->agent("WebGUI-Check/2.0");
$header = new HTTP::Headers; $header = new HTTP::Headers;
$referer = "http://".`hostname`; $referer = "http://webgui.cli.getversion/".`hostname`;
chomp $referer; chomp $referer;
$referer .= "/getversion/";
$header->referer($referer); $header->referer($referer);
$request = new HTTP::Request (GET => "http://www.plainblack.com/downloads/latest-version.txt", $header); $request = new HTTP::Request (GET => "http://www.plainblack.com/downloads/latest-version.txt", $header);
$response = $userAgent->request($request); $response = $userAgent->request($request);
@ -170,9 +245,11 @@ if ($response->is_error) {
} elsif ($version eq $WebGUI::VERSION) { } elsif ($version eq $WebGUI::VERSION) {
print "OK\n"; print "OK\n";
} else { } else {
print "There is a newer version of WebGUI available.\n"; print "You are using ".$WebGUI::VERSION." and ".$version." is available.\n";
} }
print "\nTesting complete!\n"; print "\nTesting complete!\n";