index c02a3b86c263d8b8af8c73faf535006763063b0b..8c57c441961039ba3c5a21867a7f34a92ba27179 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
/* Save unit tags */
var $gosaUnitTag= "";
+ var $skipTagging= FALSE;
/*!
\brief Used standard values
/* Additional attributes */
foreach ($add_attrs as $name => $value){
- $command= preg_replace("/%$name/", $value, $command);
+ $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);
+ $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
}
}
- $command= preg_replace("/%dn/", $this->dn, $command);
+ $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
$command, "Execute");
-
- exec($command);
+ exec($command,$arr);
+ foreach($arr as $str){
+ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
+ $command, "Result: ".$str);
+ }
} else {
$message= sprintf(_("Command '%s', specified as POSTCREATE for plugin '%s' doesn't seem to exist."), $command, get_class($this));
print_red ($message);
/* Additional attributes */
foreach ($add_attrs as $name => $value){
- $command= preg_replace("/%$name/", $value, $command);
+ $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);
+ $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
}
}
- $command= preg_replace("/%dn/", $this->dn, $command);
+ $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
$command, "Execute");
- exec($command);
+ exec($command,$arr);
+ foreach($arr as $str){
+ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
+ $command, "Result: ".$str);
+ }
} else {
$message= sprintf(_("Command '%s', specified as POSTMODIFY for plugin '%s' doesn't seem to exist."), $command, get_class($this));
print_red ($message);
/* Additional attributes */
foreach ($add_attrs as $name => $value){
- $command= preg_replace("/%$name/", $value, $command);
+ $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);
+ $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
}
}
- $command= preg_replace("/%dn/", $this->dn, $command);
-
- /* Additional attributes */
- foreach ($add_attrs as $name => $value){
- $command= preg_replace("/%$name/", $value, $command);
- }
+ $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
$command, "Execute");
- exec($command);
+ exec($command,$arr);
+ foreach($arr as $str){
+ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
+ $command, "Result: ".$str);
+ }
} else {
$message= sprintf(_("Command '%s', specified as POSTREMOVE for plugin '%s' doesn't seem to exist."), $command, get_class($this));
print_red ($message);
function tag_attrs($at, $dn= "", $tag= "", $show= false)
{
+ /* Skip tagging?
+ If this is called from departmentGeneric, we have to skip this
+ tagging procedure.
+ */
+ if($this->skipTagging){
+ return;
+ }
+
/* No dn? Self-operation... */
if ($dn == ""){
$dn= $this->dn;