summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b9d184a)
raw | patch | inline | side by side (parent: b9d184a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jan 2008 11:05:06 +0000 (11:05 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jan 2008 11:05:06 +0000 (11:05 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8563 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/glpi/admin/systems/services/glpi/class_glpiAccount.inc | patch | blob | history | |
gosa-plugins/glpi/admin/systems/services/glpi/class_glpiPrinterAccount.inc | patch | blob | history |
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiAccount.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiAccount.inc
index 4225e9fce9f844dc6514248774ea9ee228f7ed0c..445c277faf9d28aa48658dec5365b53988c240d3 100644 (file)
return($smarty->fetch(get_template_path('glpi.tpl',TRUE,dirname(__FILE__))));
}
+ /* Download requested of attachment requested.
+ */
+ if(isset($_GET['get_attachment'])){
+ $atts = $this->handle->getAttachments();
+ if(isset($atts[$_GET['get_attachment']])){
+ $att = $atts[$_GET['get_attachment']];
+ $filename = CONFIG_DIR."/glpi/".$att['filename'];
+ if(file_exists($filename) && is_readable($filename)){
+ $str = file_get_contents($filename);
+ send_binary_content($str,$att['filename']);
+ }else{
+ print_red(_("Download of attachment failed. Attachment was not found on server."));
+ }
+ }else{
+ print_red(_("Download of attachment failed. Not a valid attachment id."));
+ }
+ }
+
/* All checks are ok
Lets handle Posts, templates etc below ...
*/
$divlist = new divSelectBox("glpiAttachmentsList");
$divlist-> SetHeight(130);
$atts = $this->getUsedAttachments(true);
- $downlink = "<a href='?".$_GET['plug']."&get_attachment.php?id=%s' target='_blank'>%s</a>";
+ $downlink = "<a href='?plug=".$_GET['plug']."&get_attachment=%s'>%s</a>";
$del_link = "<input type='image' src='images/edittrash.png' name='delAttachment_%s'>";
foreach($atts as $id => $attachment){
$divlist->AddEntry
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiPrinterAccount.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiPrinterAccount.inc
index 9eee7eb168da38082825959bb6e7be275915cdbc..36f20d24d6bcdef04759890fdf419497e719f505 100644 (file)
return($smarty->fetch(get_template_path('glpiPrinter.tpl',TRUE,dirname(__FILE__))));
}
+ /* Download requested of attachment requested.
+ */
+ if(isset($_GET['get_attachment'])){
+ $atts = $this->handle->getAttachments();
+ if(isset($atts[$_GET['get_attachment']])){
+ $att = $atts[$_GET['get_attachment']];
+ $filename = CONFIG_DIR."/glpi/".$att['filename'];
+ if(file_exists($filename) && is_readable($filename)){
+ $str = file_get_contents($filename);
+ send_binary_content($str,$att['filename']);
+ }else{
+ print_red(_("Download of attachment failed. Attachment was not found on server."));
+ }
+ }else{
+ print_red(_("Download of attachment failed. Not a valid attachment id."));
+ }
+ }
+
+
/* All checks are ok
Lets handle Posts, templates etc below ...
*/
$divlist = new divSelectBox("glpiAttachmentsList");
$divlist-> SetHeight(120);
$atts = $this->getUsedAttachments(true);
- $downlink = "<a href='get_attachment.php?id=%s' target='_blank'>%s</a>";
+ $downlink = "<a href='?plug=".$_GET['plug']."&get_attachment=%s'>%s</a>";
$del_link = "<input type='image' src='images/edittrash.png' name='delAttachment_%s'>";
foreach($atts as $id => $attachment){
$divlist->AddEntry