diff --git a/plugins/admin/systems/class_glpiAttachmentPool.inc b/plugins/admin/systems/class_glpiAttachmentPool.inc
index fb1d5618dd0569ba02dd31cf062c0ba3ea7fa34d..d36409ea5f25dabe808c4ebccb1fe006c4d1ff3c 100644 (file)
class glpiAttachmentPool extends plugin
{
class glpiAttachmentPool extends plugin
{
- /* CLI vars */
- var $cli_summary= "Manage server basic objects";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
/* attribute list for save action */
var $ignore_account = TRUE;
var $attributes = array("name","comment","mime","filename","date_mod");
/* attribute list for save action */
var $ignore_account = TRUE;
var $attributes = array("name","comment","mime","filename","date_mod");
}else{
$this->parent->handle->deleteAttachment($this->delAttach);
}else{
$this->parent->handle->deleteAttachment($this->delAttach);
- @unlink("/etc/gosa/glpi/".$this->filename);
+ @unlink(CONFIG_DIR."/glpi/".$this->filename);
$attach = $this->parent->handle->getAttachments();
}
}
$attach = $this->parent->handle->getAttachments();
}
}
if($FILE['error']!=0) {
print_red(_("Upload wasn't successfull."));
}else{
if($FILE['error']!=0) {
print_red(_("Upload wasn't successfull."));
}else{
- if(!is_dir("/etc/gosa/glpi/")){
- print_red(_("Missing directory '/etc/gosa/glpi/' to store glpi uploads."));
+ if(!is_dir(CONFIG_DIR."/glpi/")){
+ print_red(sprintf(_("Missing directory '%s/glpi/' to store glpi uploads."),CONFIG_DIR));
}else{
}else{
- $filen = "/etc/gosa/glpi/".$FILE['name'];
+ $filen = CONFIG_DIR."/glpi/".$FILE['name'];
if(file_exists($filen)){
print_red(_("There is already a file with the same name uploaded."));
}else{
if(file_exists($filen)){
print_red(_("There is already a file with the same name uploaded."));
}else{
$smarty->assign($attr,htmlentities(utf8_decode($this->$attr)));
}
if(!empty($this->filename)){
$smarty->assign($attr,htmlentities(utf8_decode($this->$attr)));
}
if(!empty($this->filename)){
- if(is_readable("/etc/gosa/glpi/".$this->filename)){
+ if(is_readable(CONFIG_DIR."/glpi/".$this->filename)){
$status =_("File is available.");
}else{
$status =_("File is not readable, possibly the file is missing.");
$status =_("File is available.");
}else{
$status =_("File is not readable, possibly the file is missing.");
/* Simple check */
function check()
{
/* Simple check */
function check()
{
- $message = array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
if($this->edit){
/* check if given name is already in use */
if($this->edit){
/* check if given name is already in use */