[#14237] Test tmpdir in test.php
Summary Test tmpdir in test.php
Queue Horde Base
Queue Version 5.2.8
Type Enhancement
State Resolved
Priority 1. Low
Owners jan@horde.org
Requester skhorde@smail.inf.fh-bonn-rhein-sieg.de
Created 2016-02-02 (1321 days ago)
Due
Updated 2017-10-20 (695 days ago)
Assigned
Resolved 2016-02-11 (1312 days ago)
Milestone 5.2.10
Patch Yes

Comments
skhorde@smail.inf.fh-bonn-rhein-sieg.de 2016-02-02 09:27:03
please add a test to test.php, in order to check if Horde can write to 
the configured tmpdir, e.g.:

diff -r 196e5df19f18 var/www/horde/lib/Test.php
--- a/var/www/horde/lib/Test.php        Tue Feb 02 09:12:37 2016 +0100
+++ b/var/www/horde/lib/Test.php        Tue Feb 02 10:21:35 2016 +0100
@@ -952,6 +952,15 @@
              ? '<strong style="color:green">Yes</strong>'
              : '<strong style="color:red">No</strong><br /><strong 
style="color:orange">If caching javascript and CSS files by storing 
them in static files (HIGHLY RECOMMENDED), this directory must be 
writable as the user the web server runs as%s.</strong>';

+        /* Determine if 'tmpdir' is writable by the web user. */
+        $tmpdir = Horde::getTempDir();
+        $ret .= sprintf('<li>Is tmpdir <tt>%s</tt> writable by the 
web server user%s? ',
+                    htmlspecialchars($tmpdir),
+                    $user ? (' (' . $user['name'] . ')') : '');
+        $ret .= is_writable($tmpdir)
+            ? '<strong style="color:green">Yes</strong>'
+            : '<strong style="color:red">No</strong><br />';
+
          if (extension_loaded('imagick')) {
              $im = new Imagick();
              $imagick = is_callable(array($im, 'getIteratorIndex'));


Git Commit <commits@lists.horde.org> 2016-02-11 14:49:13
Changes have been made in Git (FRAMEWORK_5_2):

commit 92a567cfaf84e00f8dbcdcd6bd9f28a992bdd802
Author: Jan Schneider <jan@horde.org>
Date:   Thu Feb 11 15:48:45 2016 +0100

     [jan] Check if temporary directory is writable 
(skhorde@smail.inf.fh-bonn-rhein-sieg.de, Request #14237).

  horde/docs/CHANGES |    2 ++
  horde/lib/Test.php |   11 +++++++++++
  horde/package.xml  |    4 ++--
  3 files changed, 15 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/92a567cfaf84e00f8dbcdcd6bd9f28a992bdd802

Jan Schneider <jan@horde.org> 2016-02-11 14:50:30
Thanks!

Git Commit <commits@lists.horde.org> 2016-02-12 10:42:17
Changes have been made in Git (master):

commit 376f8c1c2da4adb410471ccf207ffb37ca310da5
Author: Jan Schneider <jan@horde.org>
Date:   Thu Feb 11 15:48:45 2016 +0100

     [jan] Check if temporary directory is writable 
(skhorde@smail.inf.fh-bonn-rhein-sieg.de, Request #14237).

  horde/lib/Test.php |   11 +++++++++++
  horde/package.xml  |   19 +++++++++++++++++--
  2 files changed, 28 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/376f8c1c2da4adb410471ccf207ffb37ca310da5

Git Commit <commits@lists.horde.org> 2017-10-20 20:33:48
Changes have been made in Git (FRAMEWORK_5_2):

commit c3e8ad168fcc516bc0a7598bc6752042df18e404
Author: Jan Schneider <jan@horde.org>
Date:   Thu, 11 Feb 2016 15:48:45 +0100

[jan] Check if temporary directory is writable 
(skhorde@smail.inf.fh-bonn-rhein-sieg.de, Request #14237).

  M docs/CHANGES
  M lib/Test.php
  M package.xml

https://github.com/horde/base/commit/c3e8ad168fcc516bc0a7598bc6752042df18e404