posix_* functions don't exist on !UNIX platforms. Adding workarounds.
authorgraf25 <graf25@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 27 May 2002 21:01:29 +0000 (21:01 +0000)
committergraf25 <graf25@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 27 May 2002 21:01:29 +0000 (21:01 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2874 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/file_prefs.php

index a4bfeac..082b1bc 100644 (file)
@@ -168,8 +168,11 @@ function checkForPrefs($data_dir, $username, $filename = '') {
             logout_error( $errString, $errTitle );
             exit;
         } else if (!@copy($default_pref, $filename)) {
-            $user_data = posix_getpwuid(posix_getuid());
-            $uid = $user_data['name'];
+            $uid = 'httpd';
+            if (function_exists('posix_getuid')){
+                $user_data = posix_getpwuid(posix_getuid());
+                $uid = $user_data['name'];
+            }
             $errString = $errTitle . '<br>' .
                        _("Could not create initial preference file!") . "<br>\n" .
                        sprintf( _("%s should be writable by user %s"), $data_dir, $uid ) .