}
if(!is_readable($orig_path)) {
- $this->_warning("Photo ". $orig_path ." is not readable for user ". get_current_user() ."<br />\n");
+ $this->_warning("Photo ". $orig_path ." is not readable for user ". $this->getuid() ."<br />\n");
}
/* If the thumbnail doesn't exist yet, try to create it */
}
if(!is_readable($full_path)) {
- $this->_warning("File ". $full_path ." is not readable for ". get_current_user() ."\n");
+ $this->_warning("File ". $full_path ." is not readable for ". $this->getuid() ."\n");
return;
}
} // whatToDo()
+ private function getuid()
+ {
+ if($uid = posix_getuid()) {
+ if($user = posix_getpwuid($uid)) {
+ return $user['name'];
+ }
+ }
+
+ return 'n/a';
+
+ } // getuid()
+
}
?>