diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc
index cf00e07b52b6d76fbf08c97edb1ce0d00fd55cab..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);
}
- function generateTemplate(){
+ function generateTemplate()
+ {
$str= "# This code is part of GOsa (https://gosa.gonicus.de)\n#\n";
$values = array();
/* 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();
$smarty->assign($name."ACL",$this->getacl($name));
}
- $smarty->assign("baseACL", $this->getacl("base"));
-
/* 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);
if($this->dialog->isClosed()){
$this->dialog = false;
}elseif($this->dialog->isSelected()){
-
+
+ /* Just allow selection valid bases */
$tmp = $this->get_allowed_bases();
if(isset($tmp[$this->dialog->isSelected()])){
$this->base = $this->dialog->isSelected();
{
$ldap= $this->config->get_ldap_link();
$ldap->rmDir($this->dn);
+ 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->set_acl_base($this->base);
}
- /* Check acls to create a new application here */
- $ui= get_userinfo();
- if (!$this->acl_is_createable() && $this->dn == "new"){
- $message[]= _("You have no permissions to create a application on this 'Base'.");
- }
-
/* All required fields are set? */
if ($this->cn == ""){
$message[]= _("Required field 'Name' is not filled.");
$this->cleanup();
$ldap->modify ($this->attrs);
$this->handle_post_events("modify");
+ 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);
+ 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()