Show
Ignore:
Timestamp:
2008-02-25 17:13:58 (8 months ago)
Author:
wwalc
Message:

Fix for #1871. Permissions applied with chmod commmand are now configurable (php).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/filemanager/connectors/php/io.php

    r1565 r1625  
    8989function CreateServerFolder( $folderPath, $lastFolder = null ) 
    9090{ 
     91        global $Config ; 
    9192        $sParent = GetParentFolder( $folderPath ) ; 
    9293 
     
    118119                // Enable error tracking to catch the error. 
    119120                ini_set( 'track_errors', '1' ) ; 
    120  
    121                 // To create the folder with 0777 permissions, we need to set umask to zero. 
    122                 $oldumask = umask(0) ; 
    123                 mkdir( $folderPath, 0777 ) ; 
    124                 umask( $oldumask ) ; 
     121                 
     122                if ( isset( $Config['ChmodOnFolderCreate'] ) && !$Config['ChmodOnFolderCreate'] ) 
     123                { 
     124                        mkdir( $folderPath ) ; 
     125                } 
     126                else  
     127                { 
     128                        $permissions = 0777 ; 
     129                        if ( isset( $Config['ChmodOnFolderCreate'] ) ) 
     130                        { 
     131                                $permissions = $Config['ChmodOnFolderCreate'] ; 
     132                        } 
     133                        // To create the folder with 0777 permissions, we need to set umask to zero. 
     134                        $oldumask = umask(0) ; 
     135                        mkdir( $folderPath, $permissions ) ; 
     136                        umask( $oldumask ) ;                     
     137                }                
    125138 
    126139                $sErrorMsg = $php_errormsg ;