From 38b7cea478b018a7f4dd8e24f0feeba9355ea80f Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 12 Oct 2005 13:06:27 +0000 Subject: [PATCH] * Integrated Jan's changes for binary downloads * Added cosmetic fix for quota display git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1563 594d385d-05f5-0310-b6e9-bd551577e9d8 --- TODO | 8 ++++++++ html/{getpic.php => getbin.php} | 12 +++++++++--- html/getldif.php | 2 +- .../admin/applications/class_applicationGeneric.inc | 6 ++++-- plugins/admin/applications/generic.tpl | 2 +- plugins/admin/groups/class_groupMail.inc | 2 +- plugins/personal/generic/class_user.inc | 9 ++++++--- plugins/personal/generic/generic.tpl | 2 +- plugins/personal/generic/generic_picture.tpl | 2 +- plugins/personal/mail/class_mailAccount.inc | 2 +- 10 files changed, 33 insertions(+), 14 deletions(-) rename html/{getpic.php => getbin.php} (80%) diff --git a/TODO b/TODO index 1a9a37bbb..e61031a05 100644 --- a/TODO +++ b/TODO @@ -48,6 +48,14 @@ Things to fix before 2.4: * Workstation is defect +* Save FAI sub objects directly when they already exist + +* FAI variables are not editable during creation + +* FAI package lists -> why do we ask for distribution if the list is already filled? + +* FAI package lists behave strange + Target for 2.5: =============== diff --git a/html/getpic.php b/html/getbin.php similarity index 80% rename from html/getpic.php rename to html/getbin.php index 8f941ae0f..3040535f6 100644 --- a/html/getpic.php +++ b/html/getbin.php @@ -26,7 +26,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getpic.php called without session"); + gosa_log ("Error: getbin.php called without session"); header ("Location: ../index.php"); exit; } @@ -36,9 +36,15 @@ header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); header("Cache-Control: post-check=0, pre-check=0"); -header("Content-type: image/jpeg"); +$bintype = isset($_SESSION['binarytype']) + ? $_SESSION['binarytype'] : "octet-stream"; +header("Content-type: " . $bintype); +if (isset($_SESSION['binaryfile'])) { + header( "Content-disposition: attachment; filename=" + . $_SESSION['binaryfile'] ); +} -echo $_SESSION['picture']; +echo $_SESSION['binary']; error_reporting (E_ALL); // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/html/getldif.php b/html/getldif.php index 541204607..63d963696 100644 --- a/html/getldif.php +++ b/html/getldif.php @@ -65,7 +65,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getpic.php called without session"); + gosa_log ("Error: getldif.php called without session"); header ("Location: ../index.php"); exit; } diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 1dc42b890..34ab301b7 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -38,7 +38,8 @@ class application extends plugin if ($this->iconData == ""){ $this->set_picture(""); } - $_SESSION['picture']= $this->iconData; + $_SESSION['binary']= $this->iconData; + $_SESSION['binarytype']= "image/jpeg"; $this->gosaApplicationIcon= $this->iconData; /* This is always an account */ @@ -370,7 +371,8 @@ class application extends plugin if (file_exists($filename)){ $fd = fopen ($filename, "rb"); $this->iconData= fread ($fd, filesize ($filename)); - $_SESSION['picture']= $this->iconData; + $_SESSION['binary']= $this->iconData; + $_SESSION['binarytype']= "image/jpeg"; $this->gosaApplicationIcon= $this->iconData; fclose ($fd); diff --git a/plugins/admin/applications/generic.tpl b/plugins/admin/applications/generic.tpl index 80294dfd0..fac82d096 100644 --- a/plugins/admin/applications/generic.tpl +++ b/plugins/admin/applications/generic.tpl @@ -45,7 +45,7 @@
- + diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index ba9e62e2c..40b0e8be8 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -426,7 +426,7 @@ class mailgroup extends plugin $smarty->assign("$val"."ACL", chkacl($this->acl, "$val")); } if (is_numeric($this->gosaMailQuota) && $this->gosaMailQuota != 0){ - $smarty->assign("quotausage", progressbar(($this->quotaUsage * 100)/ $this->gosaMailQuota,100,15,true)); + $smarty->assign("quotausage", progressbar(round(($this->quotaUsage * 100)/ $this->gosaMailQuota,100,15,true))); $smarty->assign("quotadefined", "true"); } else { $smarty->assign("quotadefined", "false"); diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 2df705419..648939217 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -309,7 +309,8 @@ class user extends plugin $this->photoData= $this->old_photoData; /* Update picture */ - $_SESSION['picture']= $this->photoData; + $_SESSION['binary']= $this->photoData; + $_SESSION['binarytype']= "image/jpeg"; $this->picture_dialog= FALSE; $this->dialog= FALSE; } @@ -1024,7 +1025,8 @@ class user extends plugin if ($ei) { if ($info = ldap_get_values_len($ds, $ei, "jpegPhoto")){ $this->photoData= $info[0]; - $_SESSION['picture']= $this->photoData; + $_SESSION['binary']= $this->photoData; + $_SESSION['binarytype']= "image/jpeg"; $this->jpegPhoto= ""; } } @@ -1081,7 +1083,8 @@ class user extends plugin $fd = fopen ($filename, "rb"); $this->photoData= fread ($fd, filesize ($filename)); - $_SESSION['picture']= $this->photoData; + $_SESSION['binary']= $this->photoData; + $_SESSION['binarytype']= "image/jpeg"; $this->jpegPhoto= ""; fclose ($fd); diff --git a/plugins/personal/generic/generic.tpl b/plugins/personal/generic/generic.tpl index 6f3122dcf..337ac381c 100644 --- a/plugins/personal/generic/generic.tpl +++ b/plugins/personal/generic/generic.tpl @@ -12,7 +12,7 @@ - {t}Personal picture{/t} + {t}Personal picture{/t}
diff --git a/plugins/personal/generic/generic_picture.tpl b/plugins/personal/generic/generic_picture.tpl index cb76dc282..b3b4ae769 100644 --- a/plugins/personal/generic/generic_picture.tpl +++ b/plugins/personal/generic/generic_picture.tpl @@ -12,7 +12,7 @@ - + diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index 13bc4b0c9..515a91839 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -441,7 +441,7 @@ class mailAccount extends plugin } if (is_numeric($this->gosaMailQuota) && $this->gosaMailQuota != 0){ - $smarty->assign("quotausage", progressbar(($this->quotaUsage * 100)/ $this->gosaMailQuota,100,15,true)); + $smarty->assign("quotausage", progressbar(round(($this->quotaUsage * 100)/ $this->gosaMailQuota,100,15,true))); $smarty->assign("quotadefined", "true"); } else { $smarty->assign("quotadefined", "false"); -- 2.30.2