diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc
index 5ecab3a94495d85905ba0af1a94ea12f9717e4ca..875c269f18e791fe51bf55f9096404225a123d33 100644 (file)
var $gosaApplicationIcon= "";
var $gotoLogonScript ="";
var $iconData;
+ var $view_logged = FALSE;
/* Headpage attributes */
var $last_sorting= "invalid";
var $isReleaseApplikation = false;
- function application ($config, $dn= NULL, $parent= NULL)
+ function application (&$config, $dn= NULL, $parent= NULL)
{
plugin::plugin ($config, $dn, $parent);
$this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
}
}
-
- if($this->is_account && $dn != "new"){
- @log::log("view","application/".get_class($this),$this->dn);
- }
}
/* Call parent execute */
plugin::execute();
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","application/".get_class($this),$this->dn);
+ }
+
$smarty= get_smarty();
$tmp = $this->plInfo();
}
/* Do we represent a valid group? */
- if (!$this->is_account && $this->parent == NULL){
+ if (!$this->is_account && $this->parent === NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
_("This 'dn' is no application.")."</b>";
return ($display);
{
$ldap= $this->config->get_ldap_link();
$ldap->rmDir($this->dn);
- @log::log("remove","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("remove","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
show_ldap_error($ldap->get_error(), sprintf(_("Removing of application with dn '%s' failed."),$this->dn));
/* Optionally execute a command after we're done */
/* Load the new uploaded Photo */
if(!$handle = imagick_ReadImage($_FILES['picture_file']['tmp_name'])){
- gosa_log("Can't Load image");
+ print_red(_("Can't access uploaded image."));
}
/* Resizing image to 147x200 and blur */
if(!imagick_resize($handle,48,48,IMAGICK_FILTER_GAUSSIAN,0)){
- gosa_log("imagick_resize failed");
+ print_red(_("Uploaded image could not be resized, possilby the image magick extension is missing."));
}
/* Converting image to JPEG */
if(!imagick_convert($handle,"PNG")) {
- gosa_log("Can't Convert to PNG");
+ print_red(_("Could not convert image to png, possilby the image magick extension is missing."));
}
- if(imagick_writeimage($handle,$_FILES['picture_file']['tmp_name'])){
- gosa_log("can't write to specified folder");
+ if(!imagick_writeimage($handle,$_FILES['picture_file']['tmp_name'])){
+ print_red(sprintf(_("Could not save uploaded image to %s."),$_FILES['picture_file']['tmp_name']));
}
imagick_free($handle);
$this->cleanup();
$ldap->modify ($this->attrs);
$this->handle_post_events("modify");
- @log::log("modify","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("modify","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
} else {
/* Remove gotoLogonScript if it is empty */
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
$ldap->cd($this->dn);
$ldap->add($this->attrs);
- @log::log("create","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("create","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
$this->handle_post_events("add");
}
show_ldap_error($ldap->get_error(), sprintf(_("Saving of application with dn '%s' failed."),$this->dn));
}
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+ $source_o = new application($this->config,$source['dn']);
+ $this->gosaApplicationIcon = $source_o->gosaApplicationIcon;
+ }
+
+
/* Return plugin informations for acl handling
#FIXME FAIscript seams to ununsed within this class... */
function plInfo()