Revision 29460ef7
Added by Marc Dequènes about 14 years ago
- ID 29460ef70d5d007019c484e39035f3157a1e9928
lib/ldap_shadows/manipulation_helper.rb | ||
---|---|---|
|
||
module LdapShadows
|
||
module Manipulation
|
||
# hyphens are permitted by RFC2251, but disallowed for method named
|
||
TEXTUI_KEY_PATTERN = "(?:[a-zA-Z]*:)?[a-zA-Z][a-zA-Z0-9]*"
|
||
|
||
def self.item_modify_from_strings(item, str_list)
|
||
str_list = [str_list] unless str_list.is_a? Array
|
||
|
||
modification_done = false
|
||
str_list.each do |str|
|
||
unless str =~ /^([a-zA-Z]*(?::[a-zA-Z]+)?)(=|\+=|-=)(.*)$/
|
||
unless str =~ /^(#{TEXTUI_KEY_PATTERN})(=|\+=|-=)(.*)$/
|
||
raise SyntaxError, _("modification parameter '%s' is invalid") % str
|
||
end
|
||
key = $1
|
||
... | ... | |
ldap_search_where =Set.new
|
||
ldap_search_exclude =Set.new
|
||
str_list.each do |str|
|
||
unless str =~ /^([a-zA-Z]*(?::[a-zA-Z]+)?)(=|~=)(.*)$/
|
||
unless str =~ /^(#{TEXTUI_KEY_PATTERN})(=|~=)(.*)$/
|
||
raise SyntaxError, _("search parameter '%s' is invalid") % str
|
||
end
|
||
key = $1
|
Also available in: Unified diff
[fix] TextUI key pattern was wrong (not allowing digits at all)