fix group editing adding numbers
This commit is contained in:
parent
5167b279f5
commit
bcaf1243b0
3 changed files with 23 additions and 16 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
7.4.4
|
7.4.4
|
||||||
- fix: bug in EMS purge
|
- fix: Changing group detail adds number to group name
|
||||||
- fix: bug in poll where you can't edit it to have less answers
|
http://www.webgui.org/bugs/tracker/changing-group-detail-adds-number-to-group-name
|
||||||
|
- fix: bug in EMS purge
|
||||||
|
- fix: bug in poll where you can't edit it to have less answers
|
||||||
|
|
||||||
7.4.3
|
7.4.3
|
||||||
- Data Forms set reply to to the same as the from field
|
- Data Forms set reply to to the same as the from field
|
||||||
|
|
|
||||||
|
|
@ -459,20 +459,24 @@ sub www_editGroup {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editGroupSave {
|
sub www_editGroupSave {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
return $session->privilege->adminOnly() unless (canEditGroup($session,$session->form->process("gid")));
|
my $gid = $session->form->process("gid");
|
||||||
my $g = WebGUI::Group->new($session,$session->form->process("gid"));
|
return $session->privilege->adminOnly
|
||||||
$g->description($session->form->process("description"));
|
unless canEditGroup($session, $gid);
|
||||||
# We don't want them to use an existing name. If needed, we'll ad a number to the name to keep it unique.
|
my $g = WebGUI::Group->new($session, $gid);
|
||||||
my $groupName = $session->form->process("groupName");
|
# We don't want them to use an existing name. If needed, we'll ad a number to the name to keep it unique.
|
||||||
while (WebGUI::Group->find($session, $groupName)->getId) {
|
my $groupName = $session->form->process("groupName");
|
||||||
$groupName =~ s/\A(.*?)(\d*)\z/
|
while (my $existingGroupId = WebGUI::Group->find($session, $groupName)->getId) {
|
||||||
my $newNum = ($2 || 0) + 1;
|
last
|
||||||
substr($1, 0, 100 - length($newNum)) . $newNum; #prevent name from growing over 100 chars
|
if $existingGroupId eq $gid;
|
||||||
/emsx;
|
$groupName =~ s/\A(.*?)(\d*)\z/
|
||||||
|
my $newNum = ($2 || 0) + 1;
|
||||||
|
substr($1, 0, 100 - length($newNum)) . $newNum; #prevent name from growing over 100 chars
|
||||||
|
/emsx;
|
||||||
}
|
}
|
||||||
$g->name($groupName);
|
$g->name($groupName);
|
||||||
$g->expireOffset($session->form->interval("expireOffset"));
|
$g->description($session->form->process("description"));
|
||||||
|
$g->expireOffset($session->form->interval("expireOffset"));
|
||||||
$g->karmaThreshold($session->form->process("karmaThreshold"));
|
$g->karmaThreshold($session->form->process("karmaThreshold"));
|
||||||
$g->ipFilter($session->form->process("ipFilter"));
|
$g->ipFilter($session->form->process("ipFilter"));
|
||||||
$g->scratchFilter($session->form->process("scratchFilter"));
|
$g->scratchFilter($session->form->process("scratchFilter"));
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,8 @@ foreach my $package (@modules) {
|
||||||
next if (WebGUI::Utility::isIn($package,@excludes));
|
next if (WebGUI::Utility::isIn($package,@excludes));
|
||||||
my $use = "use ".$package." ()";
|
my $use = "use ".$package." ()";
|
||||||
eval($use);
|
eval($use);
|
||||||
|
print $@
|
||||||
|
if $@;
|
||||||
}
|
}
|
||||||
|
|
||||||
use Apache2::ServerUtil ();
|
use Apache2::ServerUtil ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue