You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2012/11/16 19:30:17 UTC
svn commit: r1410525 - /vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/groups.php
Author: jfthomps
Date: Fri Nov 16 18:30:16 2012
New Revision: 1410525
URL: http://svn.apache.org/viewvc?rev=1410525&view=rev
Log:
VCL-642
colons should not be allowed in resource group names
groups.php: modified processGroupInput - split name check to be separate for user and resource groups and removed : from available characters for resource groups
Modified:
vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/groups.php
Modified: vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/groups.php
URL: http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/groups.php?rev=1410525&r1=1410524&r2=1410525&view=diff
==============================================================================
--- vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/groups.php (original)
+++ vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/groups.php Fri Nov 16 18:30:16 2012
@@ -936,12 +936,21 @@ function processGroupInput($checks=1) {
return $return;
}
- if($return['custom'] == 1 && $return['courseroll'] == 0 &&
- ! preg_match('/^[-a-zA-Z0-9_\.: ]{3,30}$/', $return["name"])) {
- $submitErr |= GRPNAMEERR;
- $submitErrMsg[GRPNAMEERR] = "Name must be between 3 and 30 characters "
- . "and can only contain letters, numbers, and "
- . "these characters: - _ . :";
+ if($return['custom'] == 1 && $return['courseroll'] == 0) {
+ if($return['type'] == 'user' &&
+ ! preg_match('/^[-a-zA-Z0-9_\.: ]{3,30}$/', $return["name"])) {
+ $submitErr |= GRPNAMEERR;
+ $submitErrMsg[GRPNAMEERR] = "Name must be between 3 and 30 characters "
+ . "and can only contain letters, numbers, "
+ . "spaces, and these characters: - . _ :";
+ }
+ elseif($return['type'] == 'resource' &&
+ ! preg_match('/^[-a-zA-Z0-9_\. ]{3,30}$/', $return["name"])) {
+ $submitErr |= GRPNAMEERR;
+ $submitErrMsg[GRPNAMEERR] = "Name must be between 3 and 30 characters "
+ . "and can only contain letters, numbers, "
+ . "spaces, and these characters: - . _";
+ }
}
if($return['type'] == 'user')
$extraid = $return['affiliationid'];