summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2eab6c7)
raw | patch | inline | side by side (parent: 2eab6c7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Jan 2011 16:03:08 +0000 (16:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Jan 2011 16:03:08 +0000 (16:03 +0000) |
Updated email address test for templates, it allows {} now, to be able to handle replacements.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.7@20596 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.7@20596 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_plugin.inc | patch | blob | history | |
gosa-core/include/functions.inc | patch | blob | history | |
gosa-core/include/utils/class_tests.inc | patch | blob | history |
index f932dd3f23b44e789e7d5cdebc636aae649fb29f..0180a8529a50fc25e108417911f1fecfdd84d9ad 100644 (file)
$this->attrs= $ldap->fetch();
$values = array();
- foreach($this->attributes as $name){
+ foreach(array('uid','sn','givenName') as $name){
if(isset($this->parent->$name)){
$value = $this->parent->$name;
if(is_numeric($name)) continue;
index fde2df70e0fb1343eade77fd7793ef86b8647b42..22670325a322509c57f3c9a8fed9e99d8d96f171 100644 (file)
}
krsort($hits);
+ // Add lower case placeholders to avoid errors
+ foreach($attrs as $key => $attr) $attrs[strtolower($key)] = $attr;
+
// Replace the placeholder in the given string now.
foreach($hits as $match){
// Avoid errors about undefined index.
- $name = $match[2];
+ $name = strtolower($match[2]);
if(!isset($attrs[$name])) $attrs[$name] = $default;
// Calculate the replacement
index 602ce0623bf7666230bab6df4c52e62e7723e0a3..6b2e283a2ac6167972563a6e90d8c5cf24b75d7a 100644 (file)
return (TRUE);
}
if ($template){
- return preg_match ("/^[._a-z0-9%\+-]+@[_a-z0-9-]+(\.[a-z0-9-]+)(\.[a-z0-9-]+)*$/i",
+ return preg_match ("/^[._a-z0-9{\[\]}%\+-]+@[_a-{}\[\]%z0-9-]+(\.[a-z0-9-]+)(\.[a-z0-9-]+)*$/i",
$address);
} else {
return preg_match ("/^[._a-z0-9\+-]+@[_a-z0-9-]+(\.[a-z0-9i-]+)(\.[a-z0-9-]+)*$/i",