Requesting help for a PHP issue

Status
Not open for further replies.

Psoewish

New Member
Messages
80
Reaction score
0
Points
0
Hello, I have recently (I think two days ago) installed a photo gallery on my website, but it appears that users cannot upload any pictures themselves, and when I do it through the admin panel, nobody can see my images.

Now I tried getting to the bottom of this, and finally thought of trying to see if I can simply link straight to the image (copy image location and paste in my navigation bar :))

Now, it came up with the following error:
Code:
 [B]Warning[/B]:  shell_exec() has been disabled for security reasons in [B]/home/psoewish/public_html/e107_plugins/sgallery/includes/phpthumb.functions.php[/B] on line [B]465[/B]

I'm on the Intermediate PVP package, and I think this means the function isn't enabled on that package, there might be other functions I need as well, I'm not sure of that as it probably just prints the first error it encounters.

Anyway, here's a link to the files for the gallery (uploaded on own webspace cause other sites require registration) http://newdawn.exofire.net/cl_gallery_v2.05.zip

Maybe it helps, maybe you don't care about it, but no harm adding it in any case ;)

I'm on Absolut
Domain: newdawn.exofire.net
cPanel: Psoewish


Thanks in advance.
 

Psoewish

New Member
Messages
80
Reaction score
0
Points
0
Ok thank you for the reply, I have now requested an upgrade of my PHP version.
 

Psoewish

New Member
Messages
80
Reaction score
0
Points
0
Well it has been almost 48 hours now, and the status of the upgrade is still pending ...

Any news on this?
 

Corey

I Break Things
Staff member
Messages
34,553
Reaction score
204
Points
63
Bryon would have to approve the v3 application, we rarely give v3 out though.

Your best bet would be to see why it is using shell_exec. It's usually for a non-important reason and can be commented out.

-Corey
 

Psoewish

New Member
Messages
80
Reaction score
0
Points
0
Well, I don't really know anything about this stuff, but as far as I can tell so far, the function is used to display my thumbnails?

No idea if i'm right here though, and the files are too cluttered to be able to comment that stuff out (no idea from where to where I should comment it out ;))

So now there are 3 options: I get PHP advanced package, someone's gonna aid me in figuring out what parts in which files I comment out, or a good suggestion for an image gallery that's seemlessly integrated in my e107 system :p

I think the first and last options may be the easiest in my case, time to go back to Google and find me a new plugin I'm affraid, cause I'm not expecting to get that upgrade .. :)
 

Psoewish

New Member
Messages
80
Reaction score
0
Points
0
Hmm, seems like it was my Notepad ****ing up there (gotta hate Windows :))

Anyway, I opened the file in Dreamweaver, and it was all just fine, here's the part of the code the error is in:
Code:
    function SafeExec($command) {
        static $AllowedExecFunctions = array();
        if (empty($AllowedExecFunctions)) {
            $AllowedExecFunctions = array('shell_exec'=>true, 'passthru'=>true, 'system'=>true, 'exec'=>true);
            foreach ($AllowedExecFunctions as $key => $value) {
                $AllowedExecFunctions[$key] = !phpthumb_functions::FunctionIsDisabled($key);
            }
        }
        $command .= ' 2>&1'; // force redirect stderr to stdout
        foreach ($AllowedExecFunctions as $execfunction => $is_allowed) {
            if (!$is_allowed) {
                continue;
            }
            $returnvalue = false;
            switch ($execfunction) {
                case 'passthru':
                case 'system':
                    ob_start();
                    $execfunction($command);
                    $returnvalue = ob_get_contents();
                    ob_end_clean();
                    break;

                case 'exec':
                    $output = array();
                    $lastline = $execfunction($command, $output);
                    $returnvalue = implode("\n", $output);
                    break;

                case 'shell_exec':
                    ob_start();
                    $returnvalue = $execfunction($command);
                    ob_end_clean();
                    break;
            }
            return $returnvalue;
        }
        return false;
    }

I'm not really sure what I have to do with it thouhg, because, as I said before, I know next to nothing about PHP :)

So any help would be appreciated ...
Edit:
nvm, I figured it out by myself now :D

This topic can now be closed ;)
 
Last edited:
Status
Not open for further replies.
Top