summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eddae89)
raw | patch | inline | side by side (parent: eddae89)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 9 Apr 2008 10:21:35 +0000 (10:21 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 9 Apr 2008 10:21:35 +0000 (10:21 +0000) |
-Postcreate/modify/remove fixed replacements
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10297 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10297 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_plugin.inc | patch | blob | history |
index 047b218983372683ee6a609d473c5877163d40bd..8ae807992ea217da787fb42990ede73407aa53c4 100644 (file)
if ($command != ""){
- /* Additional attributes */
- foreach ($add_attrs as $name => $value){
- $command= preg_replace("/%$name( |$)/", "$value ", $command);
- }
-
/* Walk through attribute list */
foreach ($this->attributes as $attr){
if (!is_array($this->$attr)){
- $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
+ $add_attrs[$attr] = $this->$attr;
}
}
- $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
+ $add_attrs['dn']=$this->dn;
+
+ $tmp = array();
+ foreach($add_attrs as $name => $value){
+ $tmp[$name] = strlen($name);
+ }
+ arsort($tmp);
+
+ /* Additional attributes */
+ foreach ($tmp as $name => $len){
+ $value = $add_attrs[$name];
+ $command= preg_replace("/%$name/", "$value ", $command);
+ }
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
if ($command != ""){
- /* Additional attributes */
- foreach ($add_attrs as $name => $value){
- $command= preg_replace("/%$name( |$)/", "$value ", $command);
- }
-
/* Walk through attribute list */
foreach ($this->attributes as $attr){
if (!is_array($this->$attr)){
- $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
+ $add_attrs[$attr] = $this->$attr;
}
}
- $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
+ $add_attrs['dn']=$this->dn;
- if (check_command($command)){
- @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
- $command, "Execute");
+ $tmp = array();
+ foreach($add_attrs as $name => $value){
+ $tmp[$name] = strlen($name);
+ }
+ arsort($tmp);
+
+ /* Additional attributes */
+ foreach ($tmp as $name => $len){
+ $value = $add_attrs[$name];
+ $command= preg_replace("/%$name/", "$value ", $command);
+ }
+ if (check_command($command)){
+ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,$command, "Execute");
exec($command);
} else {
$message[]= msgPool::cmdnotfound("POSTMODIFY", get_class($this));
$command= $this->config->search(get_class($this), "POSTREMOVE",array('menu','tabs'));
if ($command != ""){
- /* Additional attributes */
- foreach ($add_attrs as $name => $value){
- $command= preg_replace("/%$name( |$)/", "$value ", $command);
- }
-
/* Walk through attribute list */
foreach ($this->attributes as $attr){
if (!is_array($this->$attr)){
- $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
+ $add_attrs[$attr] = $this->$attr;
}
}
- $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
+ $add_attrs['dn']=$this->dn;
+
+ $tmp = array();
+ foreach($add_attrs as $name => $value){
+ $tmp[$name] = strlen($name);
+ }
+ arsort($tmp);
+
+ /* Additional attributes */
+ foreach ($tmp as $name => $len){
+ $value = $add_attrs[$name];
+ $command= preg_replace("/%$name/", "$value ", $command);
+ }
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,