public static function group($cn, $allowDashes = false)
	{
		$pattern = '/^[0-9a-z]+[' . ($allowDashes ? '-' : '') . '_0-9a-z]*$/';

		if (!preg_match($pattern, $cn))
		{
			return false;
		}

		if (self::nonNegativeInteger($cn))
		{
			return false;
		}

		// Is it a reserved group name?
		if (self::reserved('group', $cn))
		{
			return false;
		}

		return true;
	}
public static function group($cn, $allowDashes = false)
	{
		$pattern = '/^[0-9a-z]+[' . ($allowDashes ? '-' : '') . '_0-9a-z]*$/';

		if (!preg_match($pattern, $cn))
		{
			return false;
		}

		if (self::nonNegativeInteger($cn))
		{
			return false;
		}

		// Is it a reserved group name?
		if (self::reserved('group', $cn))
		{
			return false;
		}

		return true;
	}
public static function group ( $ cn , $ allowDashes = false ) { $ pattern = '/^[0-9a-z]+[' . ( $ allowDashes ? '-' : '' ) . '_0-9a-z]*$/' ; if ( ! preg_match ( $ pattern , $ cn ) ) { return false ; } if ( self :: nonNegativeInteger ( $ cn ) ) { return false ; } // Is it a reserved group name? if ( self :: reserved ( 'group' , $ cn ) ) { return false ; } return true ; }
Check if a group alias is valid

- Check if $cn contains any invalid characters
- Check if $cn is just an integer
- Check if $cn is reserved

@param   string   $cn           Group to check
@param   boolean  $allowDashes  Allow dashes in cn
@return  boolean  True if valid, false if invalid
Check if a group alias is valid