Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Insert image error in filebrowser.php
#1
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
Reply
#2
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.
My Github Repos: Github
Website: DigiMute
Reply
#3
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>';
                }
            }
My Github Repos: Github
Website: DigiMute
Reply
#4
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!
Reply
#5
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']));
        ...
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#6
@Chris, already in upload.php.

@mvlcek, yeah suppose that makes more sense as we need both before the info is output.
My Github Repos: Github
Website: DigiMute
Reply
#7
This worked a treat! Thanks for your help, Mike.

Nancy O'Shea
Reply




Users browsing this thread: 1 Guest(s)