2
0
forked from Wavyzz/dolibarr

NEW Can install an external module from admin pages, if web server has

permission for and if setup is ok for.
This commit is contained in:
Laurent Destailleur
2015-04-04 00:19:03 +02:00
parent 106a393054
commit 2ec5595277
4 changed files with 150 additions and 30 deletions

View File

@@ -3728,9 +3728,10 @@ function get_exdir($num,$level=3,$alpha=0,$withoutslash=0)
*
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
* @param string $dataroot Data root directory (To avoid having the data root in the loop. Using this will also lost the warning on first dir PHP has no permission when open_basedir is used)
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0444'
* @return int < 0 if KO, 0 = already exists, > 0 if OK
*/
function dol_mkdir($dir, $dataroot='')
function dol_mkdir($dir, $dataroot='', $newmask=0)
{
global $conf;
@@ -3767,8 +3768,8 @@ function dol_mkdir($dir, $dataroot='')
dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.",LOG_DEBUG);
umask(0);
$dirmaskdec=octdec('0755');
if (! empty($conf->global->MAIN_UMASK)) $dirmaskdec=octdec($conf->global->MAIN_UMASK);
$dirmaskdec=octdec($newmask);
if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $dirmaskdec=octdec($conf->global->MAIN_UMASK);
$dirmaskdec |= octdec('0111'); // Set x bit required for directories
if (! @mkdir($ccdir_osencoded, $dirmaskdec))
{