Posts: 2
Threads: 1
Joined: Jun 2011
Using GS 3.0 with Innovation Theme in debug mode.
Browser = Firefox 3.6x
Insert image into page. Browse server.
Fatal error: Call to undefined function posix_getpwuid() in GetSimple_3.0/admin/filebrowser.php on line 151.
I have verified there are several images in the Upload folder on server, but only the first image displays.
Any ideas? Thanks.
N
Posts: 1,108
Threads: 70
Joined: Aug 2009
Are you running on a Unix host?
This command is specific for Unix.
We couold implement this better , I'll add it to the SVN.
To get you over the issue you could just comment out lines 149-155
Regards, Mike.
Posts: 1,108
Threads: 70
Joined: Aug 2009
This should sort that out for you. I'll add it to the SVN for the next release.
Code:
// get the file permissions.
if ($isUnixHost && defined('GSDEBUG')) {
$filePerms = substr(sprintf('%o', fileperms($path.$upload['name'])), -4);
if (function_exists('posix_getpwuid')){
$fileOwner = posix_getpwuid(fileowner($path.$upload['name']));
}
if (($filePerms) && isset($fileOwner['name'])){
echo '<td style="width:70px;text-align:right;"><span>'.$fileOwner['name'].'/'.$filePerms.'</span></td>';
}
}
Posts: 1,848
Threads: 86
Joined: Aug 2009
Mike, is this code snippet in upload.php too?
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 2,094
Threads: 54
Joined: Jan 2011
n00dles101 Wrote:This should sort that out for you. I'll add it to the SVN for the next release.
Code:
// get the file permissions.
if ($isUnixHost && defined('GSDEBUG')) {
$filePerms = substr(sprintf('%o', fileperms($path.$upload['name'])), -4);
if (function_exists('posix_getpwuid')){
$fileOwner = posix_getpwuid(fileowner($path.$upload['name']));
}
if (($filePerms) && isset($fileOwner['name'])){
echo '<td style="width:70px;text-align:right;"><span>'.$fileOwner['name'].'/'.$filePerms.'</span></td>';
}
}
If you move the function_exists to the outer if it's even better/clearer code ;-)
Code:
if ($isUnixHost && defined('GSDEBUG') && function_exists('posix_getpwuid')) {
$filePerms = substr(sprintf('%o', fileperms($path.$upload['name'])), -4);
$fileOwner = posix_getpwuid(fileowner($path.$upload['name']));
...
Posts: 1,108
Threads: 70
Joined: Aug 2009
@Chris, already in upload.php.
@mvlcek, yeah suppose that makes more sense as we need both before the info is output.
Posts: 2
Threads: 1
Joined: Jun 2011
This worked a treat! Thanks for your help, Mike.
Nancy O'Shea