merging 5.4.2 changes

This commit is contained in:
JT Smith 2003-07-14 06:16:55 +00:00
parent a4d391b52a
commit 0726e2fd62
9 changed files with 2608 additions and 57 deletions

View file

@ -225,7 +225,11 @@ If set to "1" then the listing will not include expired groupings. Defaults to "
sub getGroupsForUser {
my $clause = "and expireDate>".time() if ($_[1]);
return WebGUI::SQL->buildArrayRef("select groupId from groupings where userId=$_[0] $clause");
if ($_[0] eq "") {
return [];
} else {
return WebGUI::SQL->buildArrayRef("select groupId from groupings where userId=$_[0] $clause");
}
}

View file

@ -118,8 +118,7 @@ sub process {
if (WebGUI::Privilege::isInGroup(4)) {
%hash = (
WebGUI::URL::page('op=listRoots')=>WebGUI::International::get(410),
'http://validator.w3.org/check?uri=http%3A%2F%2F'.$session{env}{SERVER_NAME}.
WebGUI::URL::page()=>WebGUI::International::get(399),
'http://validator.w3.org/check?uri='.WebGUI::URL::escape(WebGUI::URL::page())=>WebGUI::International::get(399),
WebGUI::URL::page('op=manageClipboard')=>WebGUI::International::get(949),
WebGUI::URL::page('op=listCollateral')=>WebGUI::International::get(394),
WebGUI::URL::page('op=viewPageTree')=>WebGUI::International::get(447),

View file

@ -74,13 +74,6 @@ sub adminOnly {
my ($output, $sth, @data);
$output = '<h1>'.WebGUI::International::get(35).'</h1>';
$output .= WebGUI::International::get(36);
$output .= '<ul>';
$sth = WebGUI::SQL->read("select users.username,users.userId from users,groupings where users.userId=groupings.userId and groupings.groupId=3 order by users.username");
while (@data = $sth->array) {
$output .= '<li><a href="'.WebGUI::URL::page('op=viewProfile&uid='.$data[1]).'">'.$data[0].'</a>';
}
$sth->finish;
$output .= '</ul><p>';
return $output;
}
@ -117,7 +110,6 @@ sub canEditPage {
}
}
#Added by Frank Dillon. Wobject API not used due to possible performance issues
#-------------------------------------------------------------------
=head2 canEditWobject ( wobjectId )
@ -186,7 +178,6 @@ sub canViewPage {
}
}
#Added by Frank Dillon. Wobject API not used due to possible performance issues
#-------------------------------------------------------------------
=head2 canViewWobject ( wobjectId )

View file

@ -60,15 +60,14 @@ sub get {
}
%style = WebGUI::SQL->quickHash("select * from style where styleId=$styleId");
@body = split(/\^\-\;/,$style{body});
$header = $session{setting}{docTypeDec}."\n".'<!-- WebGUI '.$WebGUI::VERSION.' --> <html> <head> <title>';
$header .= $session{page}{title}.' - '.$session{setting}{companyName};
my $type = lc($session{setting}{siteicon});
my $type = lc($session{setting}{siteicon});
$type =~ s/.*\.(.*?)$/$1/;
$header .= '</title>
<meta http-equiv="Content-Type" content="text/html; charset='.($session{header}{charset}||$session{language}{characterSet}||"ISO-8859-1").'" />
<link rel="icon" href="'.$session{setting}{siteicon}.'" type="image/'.$type.'" />
<link rel="SHORTCUT ICON" href="'.$session{setting}{favicon}.'" />
'.$style{styleSheet}.$session{page}{metaTags};
$header = $session{setting}{docTypeDec}.'
<!-- WebGUI '.$WebGUI::VERSION.' -->
<html> <head>
<title>'.$session{page}{title}.' - '.$session{setting}{companyName}.'</title>
';
$header .= $style{styleSheet}.$session{page}{metaTags};
if ($session{var}{adminOn}) {
# This "triple incantation" panders to the delicate tastes of various browsers for reliable cache suppression.
$header .= '<meta http-equiv="Pragma" content="no-cache" />';
@ -78,10 +77,18 @@ sub get {
if ($session{page}{defaultMetaTags}) {
$header .= '<meta http-equiv="Keywords" name="Keywords" content="'.$session{page}{title}
.', '.$session{setting}{companyName}.'" />';
$header .= '<meta http-equiv="Description" name="Description" content="'.$session{page}{synopsis}.'" />';
if ($session{page}{synopsis}) {
$header .= '<meta http-equiv="Description" name="Description" content="'.$session{page}{synopsis}.'" />';
}
}
$header .= '</head>'.$body[0];
$header .= '
<meta http-equiv="Content-Type"
content="text/html; charset='.($session{header}{charset}||$session{language}{characterSet}||"ISO-8859-1").'" />
<link rel="icon" href="'.$session{setting}{siteicon}.'" type="image/'.$type.'" />
<link rel="SHORTCUT ICON" href="'.$session{setting}{favicon}.'" />
</head>
';
$header .= $body[0];
$footer = $body[1].' </html>';
return $header.$_[0].$footer;
}
@ -89,6 +96,5 @@ sub get {
1;

View file

@ -208,7 +208,7 @@ sub discussionProperties {
-value=>[$groupToModerate],
-uiLevel=>7
);
$f->select(
$f->selectList(
-name=>"moderationType",
-options=>\%moderationType,
-label=>WebGUI::International::get(569),
@ -1101,7 +1101,7 @@ NOTE: Should never need to be overridden or extended.
=cut
sub www_copy {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$_[0]->duplicate;
return "";
}
@ -1117,7 +1117,7 @@ NOTE: Should never need to be overridden or extended.
=cut
sub www_createShortcut {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
my $w = WebGUI::Wobject::WobjectProxy->new({wobjectId=>"new",namespace=>"WobjectProxy"});
$w->set({
pageId=>2,
@ -1141,7 +1141,7 @@ Moves this instance to the clipboard.
=cut
sub www_cut {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$_[0]->set({
pageId=>2,
templatePosition=>1,
@ -1163,7 +1163,7 @@ Prompts a user to confirm whether they wish to delete this instance.
sub www_delete {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
if (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
$output = helpIcon(14);
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(43);
@ -1190,7 +1190,7 @@ Moves this instance to the trash.
=cut
sub www_deleteConfirm {
if (WebGUI::Privilege::canEditPage()) {
if (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
$_[0]->set({pageId=>3, templatePosition=>1,
bufferUserId=>$session{user}{userId},
bufferDate=>time(),
@ -1212,7 +1212,7 @@ Displays a confirmation message relating to the deletion of a file.
=cut
sub www_deleteFile {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
return $_[0]->confirm(WebGUI::International::get(728),
WebGUI::URL::page('func=deleteFileConfirm&wid='.$_[0]->get("wobjectId").'&file='.$session{form}{file}),
WebGUI::URL::page('func=edit&wid='.$_[0]->get("wobjectId"))
@ -1228,7 +1228,7 @@ Deletes a file from this instance.
=cut
sub www_deleteFileConfirm {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$_[0]->set({$session{form}{file}=>''});
return $_[0]->www_edit();
}
@ -1310,7 +1310,7 @@ An id this namespace of the WebGUI international system. This message will be re
=cut
sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
my ($self, @p) = @_;
my ($properties, $layout, $privileges, $heading, $helpId, $headingId) =
rearrange([qw(properties layout privileges heading helpId headingId)], @p);
@ -1368,7 +1368,7 @@ sub www_edit {
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
);
}
$f->getTab("layout")->select(
$f->getTab("layout")->selectList(
-name=>"templatePosition",
-label=>WebGUI::International::get(363),
-value=>[$templatePosition],
@ -1404,7 +1404,7 @@ sub www_edit {
$clause = "userId=".$_[0]->get("ownerId");
}
my $users = WebGUI::SQL->buildHashRef("select userId,username from users where $clause order by username");
$f->getTab("privileges")->select(
$f->getTab("privileges")->selectList(
-name=>"ownerId",
-options=>$users,
-label=>WebGUI::International::get(108),
@ -1480,7 +1480,7 @@ A hash reference of extra properties to set.
=cut
sub www_editSave {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
my %set;
foreach my $key (keys %{$_[0]->{_wobjectProperties}}) {
my $temp = WebGUI::FormProcessor::process(
@ -1530,7 +1530,7 @@ Moves this instance to the bottom of the page.
=cut
sub www_moveBottom {
if (WebGUI::Privilege::canEditPage()) {
if (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
$_[0]->set({sequenceNumber=>99999});
_reorderWobjects($_[0]->get("pageId"));
return "";
@ -1549,7 +1549,7 @@ Moves this instance down one spot on the page.
sub www_moveDown {
my ($wid, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
if (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from wobject where wobjectId=".$_[0]->get("wobjectId"));
($wid) = WebGUI::SQL->quickArray("select wobjectId from wobject where pageId=".$_[0]->get("pageId")
." and sequenceNumber=".($thisSeq+1));
@ -1573,7 +1573,7 @@ Moves this instance to the top of the page.
=cut
sub www_moveTop {
if (WebGUI::Privilege::canEditPage()) {
if (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
$_[0]->set({sequenceNumber=>0});
_reorderWobjects($_[0]->get("pageId"));
return "";
@ -1592,7 +1592,7 @@ Moves this instance up one spot on the page.
sub www_moveUp {
my ($wid, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
if (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from wobject where wobjectId=".$_[0]->get("wobjectId"));
($wid) = WebGUI::SQL->quickArray("select wobjectId from wobject where pageId=".$_[0]->get("pageId")
." and sequenceNumber=".($thisSeq-1));
@ -1617,7 +1617,7 @@ Moves this instance from the clipboard to the current page.
sub www_paste {
my ($output, $nextSeq);
if (WebGUI::Privilege::canEditPage()) {
if (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber) from wobject where pageId=$session{page}{pageId}");
$nextSeq += 1;
WebGUI::SQL->write("UPDATE wobject SET "

View file

@ -525,10 +525,13 @@ sub www_editField {
sub www_editFieldSave {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{form}{name} = $session{form}{label} if ($session{form}{name} eq "");
$session{form}{name} = WebGUI::URL::urlize($session{form}{name});
$session{form}{name} =~ s/\-//g;
$session{form}{name} =~ s/\///g;
$_[0]->setCollateral("DataForm_field","DataForm_fieldId",{
DataForm_fieldId=>$session{form}{fid},
width=>$session{form}{width},
name=>WebGUI::URL::urlize($session{form}{name}),
name=>$session{form}{name},
label=>$session{form}{label},
status=>$session{form}{status},
type=>$session{form}{type},