- Added an option for hosters to limit the number of assets that may be

created on a WebGUI site.
fixed some bugs
This commit is contained in:
JT Smith 2006-03-29 20:22:09 +00:00
parent 9b7d160a7a
commit 5a7fedc731
6 changed files with 33 additions and 6 deletions

View file

@ -1799,6 +1799,11 @@ NOTE: Don't try to override or overload this method. It won't work. What you are
sub www_editSave {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
if ($self->session->config("maximumAssets")) {
my ($count) = $self->session->db->quickArray("select count(*) from asset");
my $i18n = WebGUI::International->new($self->session, "Asset");
$self->session->style->userStyle($i18n->get("over max assets")) if ($self->session->config("maximumAssets") <= $count);
}
my $object;
if ($self->session->form->process("assetId") eq "new") {
$object = $self->addChild({className=>$self->session->form->process("class")});