Author: jfthomps
Date: Fri Nov 16 18:30:23 2012
New Revision: 1410526

URL: http://svn.apache.org/viewvc?rev=1410526&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/trunk/web/.ht-inc/groups.php

Modified: vcl/trunk/web/.ht-inc/groups.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/groups.php?rev=1410526&r1=1410525&r2=1410526&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/groups.php (original)
+++ vcl/trunk/web/.ht-inc/groups.php Fri Nov 16 18:30:23 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'];


Reply via email to