Moodle running with safe_mode - just a suggestion to solve this problem

Moodle running with safe_mode - just a suggestion to solve this problem

by Maik Riecken -
Number of replies: 0

Hello,

My (written) englisch is extremly bad, so please don't fool me for this. I thought about getting moddle running on sites with safe_mode turned on, which is in my opinion an important security feature on shared hosting systems.

The "only" problem are file operations like creating directories, files, moving e.g. A way to get along with this problem is to use PHP-FTP functions, instead of normal file operating function like mkdir(); . If you do it in this way all folders and files will get the right owner and will not be owned by the apache user which is the main problem with safe_mode.

I found out the programmer(s) of moddle did a good job to outsource most function into libs. So these functions have to be changed to get moodle running in safe_mode areas.

I found out by greping that theses code-files do file operations:

./tags
./backup/lib.php
./files/index.php
./lib/adodb/adodb-connection.inc.php
./lib/adodb/adodb.inc.php
./lib/gdlib.php
./lib/moodlelib.php
./lib/editor/coursefiles.php
./lib/editor/courseimages.php
./lib/editor/popups/insert_image.php
./lib/editor/popups/link.php
./lib/pclzip/pclzip.lib.php
./mod/glossary/lib.php
./mod/resource/coursefiles.php

Are there any more code files doing file operations?

 I am not sure if I could code a solution because of limited time resources (two children, 2 and 0,5), but I will try with no garantee of a result in the next years...

Maybe there is a FTP-PHP_Class which can be used for this?

I would be happy to get somekind of feedback for this idea. It would be necessary to create two more config-variables like "FTP-User" and "FTP-Password".

greetings from germany

Maik

Average of ratings: -