added per page wobject privileges
This commit is contained in:
parent
759dfd2f6b
commit
aee1eda4fa
9 changed files with 100 additions and 497 deletions
|
|
@ -75,7 +75,8 @@ sub _recursePageTree {
|
|||
newWindow,
|
||||
cacheTimeout,
|
||||
cacheTimeoutVisitor,
|
||||
printableStyleId
|
||||
printableStyleId,
|
||||
wobjectPrivileges
|
||||
) values (
|
||||
$newPageId,
|
||||
$_[1],
|
||||
|
|
@ -103,7 +104,8 @@ sub _recursePageTree {
|
|||
$package{newWindow},
|
||||
$package{cacheTimeout},
|
||||
$package{cacheTimeoutVisitor},
|
||||
$package{printableStyleId}
|
||||
$package{printableStyleId},
|
||||
$package{wobjectPrivileges}
|
||||
)");
|
||||
_recursePageTree($package{pageId},$newPageId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ sub _recursivelyChangePrivileges {
|
|||
WebGUI::SQL->write("update page set startDate=".WebGUI::FormProcessor::dateTime("startDate").",
|
||||
endDate=".WebGUI::FormProcessor::dateTime("endDate").",
|
||||
ownerId=$session{form}{ownerId}, groupIdView=$session{form}{groupIdView},
|
||||
groupIdEdit=$session{form}{groupIdEdit} where pageId=$pageId");
|
||||
groupIdEdit=$session{form}{groupIdEdit}, wobjectPrivileges=$session{form}{wobjectPrivileges} where pageId=$pageId");
|
||||
_recursivelyChangePrivileges($pageId);
|
||||
}
|
||||
}
|
||||
|
|
@ -294,7 +294,11 @@ sub www_editPage {
|
|||
-label=>WebGUI::International::get(500),
|
||||
-uiLevel=>3
|
||||
);
|
||||
$f->getTab("properties")->text("title",WebGUI::International::get(99),$page{title});
|
||||
$f->getTab("properties")->text(
|
||||
-name=>"title",
|
||||
-label=>WebGUI::International::get(99),
|
||||
-value=>$page{title}
|
||||
);
|
||||
$f->getTab("properties")->text(
|
||||
-name=>"menuTitle",
|
||||
-label=>WebGUI::International::get(411),
|
||||
|
|
@ -448,6 +452,12 @@ sub www_editPage {
|
|||
-excludeGroups=>[1,7],
|
||||
-uiLevel=>6
|
||||
);
|
||||
$f->getTab("privileges")->yesNo(
|
||||
-name=>"wobjectPrivileges",
|
||||
-label=>WebGUI::International::get(1003),
|
||||
-value=>$page{wobjectPrivileges},
|
||||
-uiLevel=>9
|
||||
);
|
||||
if ($childCount) {
|
||||
$f->getTab("privileges")->yesNo(
|
||||
-name=>"recursePrivs",
|
||||
|
|
@ -500,6 +510,7 @@ sub www_editPageSave {
|
|||
groupIdView=$session{form}{groupIdView},
|
||||
groupIdEdit=$session{form}{groupIdEdit},
|
||||
newWindow=$session{form}{newWindow},
|
||||
wobjectPrivileges=$session{form}{wobjectPrivileges},
|
||||
hideFromNavigation=$session{form}{hideFromNavigation},
|
||||
startDate=".WebGUI::FormProcessor::dateTime("startDate").",
|
||||
endDate=".WebGUI::FormProcessor::dateTime("endDate").",
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ sub www_editContentSettings {
|
|||
$f->integer("textAreaRows",WebGUI::International::get(463),$session{setting}{textAreaRows});
|
||||
$f->integer("textAreaCols",WebGUI::International::get(464),$session{setting}{textAreaCols});
|
||||
$f->integer("textBoxSize",WebGUI::International::get(465),$session{setting}{textBoxSize});
|
||||
$f->yesNo("wobjectPrivileges",WebGUI::International::get(1003),$session{setting}{wobjectPrivileges});
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return _submenu($output);
|
||||
|
|
|
|||
69
lib/WebGUI/Operation/Style.pm
Normal file
69
lib/WebGUI/Operation/Style.pm
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
package WebGUI::Operation::Style;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2003 Plain Black LLC.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use Exporter;
|
||||
use strict;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::URL;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_makePrintable &www_setPersonalStyle &www_unsetPersonalStyle);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_makePrintable {
|
||||
if ($session{form}{styleId} ne "") {
|
||||
$session{page}{printableStyleId} = $session{form}{styleId};
|
||||
}
|
||||
$session{page}{makePrintable} = 1;
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_setPersonalStyle {
|
||||
WebGUI::Session::setScratch("personalStyleId",$session{form}{styleId});
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_unsetPersonalStyle {
|
||||
WebGUI::Session::deleteScratch("personalStyleId");
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_listRoots {
|
||||
return WebGUI::Privilege::adminOnly() unless(WebGUI::Privilege::isInGroup(3));
|
||||
my ($output, $p, $sth, %data, @row, $i);
|
||||
$output = helpIcon(28);
|
||||
$output .= '<h1>'.WebGUI::International::get(408).'</h1>';
|
||||
$sth = WebGUI::SQL->read("select * from page where title<>'Reserved' and parentId=0 order by title");
|
||||
while (%data = $sth->hash) {
|
||||
$row[$i] = '<tr><td valign="top" class="tableData">'
|
||||
.deleteIcon('op=deletePage',$data{urlizedTitle})
|
||||
.editIcon('op=editPage',$data{urlizedTitle})
|
||||
.cutIcon('op=cutPage',$data{urlizedTitle})
|
||||
.'</td>';
|
||||
$row[$i] .= '<td valign="top" class="tableData"><a href="'.WebGUI::URL::gateway($data{urlizedTitle}).'">'.$data{title}.'</a></td>';
|
||||
$row[$i] .= '<td valign="top" class="tableData">'.$data{urlizedTitle}.'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=listRoots'),\@row);
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0 align="center">';
|
||||
$output .= $p->getPage;
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional;
|
||||
return _submenu($output);
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
|
@ -128,7 +128,7 @@ The unique identifier for the wobject that you wish to check the privileges on.
|
|||
sub canEditWobject {
|
||||
my (%wobject);
|
||||
tie %wobject, 'Tie::CPHash';
|
||||
return canEditPage() if ($session{setting}{wobjectPrivileges} != 1 || $_[0] eq "new");
|
||||
return canEditPage() if ($session{page}{wobjectPrivileges} != 1 || $_[0] eq "new");
|
||||
%wobject = WebGUI::SQL->quickHash("select ownerId,groupIdEdit from wobject where wobjectId=".quote($_[0]));
|
||||
if ($session{user}{userId} == $wobject{ownerId}) {
|
||||
return 1;
|
||||
|
|
@ -196,7 +196,7 @@ The unique identifier for the wobject that you wish to check the privileges on.
|
|||
sub canViewWobject {
|
||||
my (%wobject);
|
||||
tie %wobject, 'Tie::CPHash';
|
||||
return canViewPage() unless ($session{setting}{wobjectPrivileges} == 1);
|
||||
return canViewPage() unless ($session{page}{wobjectPrivileges} == 1);
|
||||
%wobject = WebGUI::SQL->quickHash("select ownerId,groupIdView,startDate,endDate from wobject where wobjectId=".quote($_[0]));
|
||||
if ($wobject{startDate} < time() && $wobject{endDate} > time()) {
|
||||
if ($session{user}{userId} == $wobject{ownerId}) {
|
||||
|
|
|
|||
|
|
@ -1249,7 +1249,7 @@ sub www_edit {
|
|||
} else {
|
||||
$subtext = "";
|
||||
}
|
||||
if ($session{setting}{wobjectPrivileges}) {
|
||||
if ($session{page}{wobjectPrivileges}) {
|
||||
my $clause;
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
my $contentManagers = WebGUI::Grouping::getUsersInGroup(4,1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue