index da0a6c4d1e6001f4fc9189e5e5a4ad95612d6904..9e5d706d37f14aa2622d94672bf50fc09d62adf6 100644 (file)
function execute()
{
/* This one is empty currently. Fabian - please fill in the docu code */
- $_SESSION['current_class_for_help'] = get_class($this);
+ session::set('current_class_for_help',get_class($this));
/* Reset Lock message POST/GET check array, to prevent perg_match errors*/
- $_SESSION['LOCK_VARS_TO_USE'] = $_SESSION['LOCK_VARS_USED'] =array();
+ session::set('LOCK_VARS_TO_USE',array());
+ session::set('LOCK_VARS_USED',array());
}
/*! \brief execute plugin
exec($command);
} else {
$message= sprintf(_("Command '%s', specified as POSTCREATE for plugin '%s' doesn't seem to exist."), $command, get_class($this));
- print_red ($message);
+ msg_dialog::display(_("Error"), $message, ERROR_DIALOG);
}
}
}
exec($command);
} else {
$message= sprintf(_("Command '%s', specified as POSTMODIFY for plugin '%s' doesn't seem to exist."), $command, get_class($this));
- print_red ($message);
+ msg_dialog::display(_("Error"), $message, ERROR_DIALOG);
}
}
}
exec($command);
} else {
$message= sprintf(_("Command '%s', specified as POSTREMOVE for plugin '%s' doesn't seem to exist."), $command, get_class($this));
- print_red ($message);
+ msg_dialog::display(_("Error"), $message, ERROR_DIALOG);
}
}
}
/* Check if the snapshot_base is defined */
if(!isset($tmp['SNAPSHOT_BASE'])){
- print_red(sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not configured in your gosa.conf."),"SNAPSHOT_BASE"));
+ msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."),"SNAPSHOT_BASE"), ERROR_DIALOG);
return(FALSE);
}
foreach(array("SNAPSHOT_SERVER","SNAPSHOT_USER","SNAPSHOT_PASSWORD","SNAPSHOT_BASE") as $var){
if(!isset($tmp[$var])){
$missing .= $var." ";
- print_red(sprintf(_("The snapshot functionality is enabled, but the required variable(s) '%s' is not configured in your gosa.conf."),$missing));
+ msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."), $missing), ERROR_DIALOG);
return(FALSE);
}
}
$msgs = $this->snapDialog->check();
if(count($msgs)){
foreach($msgs as $msg){
- print_red($msg);
+ msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
}
}else{
$this->dn = $this->snapDialog->dn;
}
/* Update userinfo if necessary */
- if($_SESSION['ui']->dn == $old_dn){
- $_SESSION['ui']->dn = $new_dn;
+ $ui = session::get('ui');
+ if($ui->dn == $old_dn){
+ $ui->dn = $new_dn;
+ session::set('ui',$ui);
new log("view","acl/".get_class($this),$this->dn,array(),"Updated current user dn from '".$old_dn."' to '".$new_dn."'");
}
foreach ($this->attributes as $val){
$found= array_key_ics($val, $this->multi_attrs);
if ($found != ""){
- $this->$val= $this->multi_attrs["$found"][0];
+ if(isset($this->multi_attrs["$found"][0])){
+ $this->$val= $this->multi_attrs["$found"][0];
+ }
}
}
}
+
+ /*! \brief Enables multiple support for this plugin
+ */
+ function enable_multiple_support()
+ {
+ $this->ignore_account = TRUE;
+ $this->multiple_support_active = TRUE;
+ }
+
/*! \brief Returns all values that have been modfied in multiple edit mode.
@return array Cotaining all mdofied values.
return($ret);
}
+
+ /*! \brief Update class variables with values collected by multiple edit.
+ */
+ function set_multi_edit_values($attrs)
+ {
+ foreach($attrs as $name => $value){
+ $this->$name = $value;
+ }
+ }
+
/*! \brief execute plugin
function multiple_execute()
{
/* This one is empty currently. Fabian - please fill in the docu code */
- $_SESSION['current_class_for_help'] = get_class($this);
+ session::set('current_class_for_help',get_class($this));
/* Reset Lock message POST/GET check array, to prevent perg_match errors*/
- $_SESSION['LOCK_VARS_TO_USE'] = $_SESSION['LOCK_VARS_USED'] =array();
+ session::set('LOCK_VARS_TO_USE',array());
+ session::set('LOCK_VARS_USED',array());
return("Multiple edit is currently not implemented for this plugin.");
}
/* Save values to object */
$this->multi_boxes = array();
foreach ($this->attributes as $val){
- if ($this->acl_is_writeable($val) && isset ($_POST["$val"])){
+
+ /* Get selected checkboxes from multiple edit */
+ if(isset($_POST["use_".$val])){
+ $this->multi_boxes[] = $val;
+ }
- if(isset($_POST["use_".$val])){
- $this->multi_boxes[] = $val;
- }
+ if ($this->acl_is_writeable($val) && isset ($_POST["$val"])){
/* Check for modifications */
if (get_magic_quotes_gpc()) {
}
+ /*! \brief Returns all attributes of this plugin,
+ to be able to detect multiple used attributes
+ in multi_plugg::detect_multiple_used_attributes().
+ @return array Attributes required for intialization of multi_plug
+ */
+ public function get_multi_init_values()
+ {
+ $attrs = $this->attrs;
+ return($attrs);
+ }
+
+
/*! \brief Check given values in multiple edit
@return array Error messages
*/