ソースを参照

posix_* functions don't exist on !UNIX platforms. Adding workarounds.

graf25 23 年 前
コミット
3a3bfa2c2c
1 ファイル変更5 行追加2 行削除
  1. 5 2
      functions/file_prefs.php

+ 5 - 2
functions/file_prefs.php

@@ -168,8 +168,11 @@ function checkForPrefs($data_dir, $username, $filename = '') {
             logout_error( $errString, $errTitle );
             logout_error( $errString, $errTitle );
             exit;
             exit;
         } else if (!@copy($default_pref, $filename)) {
         } 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>' .
             $errString = $errTitle . '<br>' .
                        _("Could not create initial preference file!") . "<br>\n" .
                        _("Could not create initial preference file!") . "<br>\n" .
                        sprintf( _("%s should be writable by user %s"), $data_dir, $uid ) .
                        sprintf( _("%s should be writable by user %s"), $data_dir, $uid ) .