소스 검색

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 );
             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 ) .