|
From: <pdo...@us...> - 2010-04-16 05:24:50
|
Revision: 13933
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13933&view=rev
Author: pdontthink
Date: 2010-04-16 05:24:43 +0000 (Fri, 16 Apr 2010)
Log Message:
-----------
Show what user/group the web server is running as; helps with debugging certain plugins for admins who aren't quite sure about these things
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2010-03-30 05:54:31 UTC (rev 13932)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2010-04-16 05:24:43 UTC (rev 13933)
@@ -88,6 +88,32 @@
echo $IND . 'PHP version ' . PHP_VERSION . " OK.<br />\n";
+// try to determine information about the user and group the web server is running as
+//
+$webOwnerID = 'N/A';
+$webOwnerInfo = array('name' => 'N/A');
+if (function_exists('posix_getuid'))
+ $webOwnerID = posix_getuid();
+if ($webOwnerID === FALSE)
+ $webOwnerID = 'N/A';
+if ($webOwnerID !== 'N/A' && function_exists('posix_getpwuid'))
+ $webOwnerInfo = posix_getpwuid($webOwnerID);
+if (!$webOwnerInfo)
+ $webOwnerInfo = array('name' => 'N/A');
+$webGroupID = 'N/A';
+$webGroupInfo = array('name' => 'N/A');
+if (function_exists('posix_getgid'))
+ $webGroupID = posix_getgid();
+if ($webGroupID === FALSE)
+ $webGroupID = 'N/A';
+if ($webGroupID !== 'N/A' && function_exists('posix_getgrgid'))
+ $webGroupInfo = posix_getgrgid($webGroupID);
+if (!$webGroupInfo)
+ $webGroupInfo = array('name' => 'N/A');
+
+echo $IND . 'Running as ' . $webOwnerInfo['name'] . '(' . $webOwnerID
+ . ') / ' . $webGroupInfo['name'] . '(' . $webGroupID . ")<br />\n";
+
echo $IND . 'display_errors: ' . ini_get('display_errors') . "<br />\n";
echo $IND . 'error_reporting: ' . ini_get('error_reporting') . "<br />\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|