if (isset($_GET['langCode'])) {
    $PGRLang = $_GET['langCode'];
} else {
    $PGRLang = 'en';
}
include_once dirname(__FILE__) . '/auth.php';
$PGRUploaderDescription = 'all files';
//For fckeditor
if (isset($_GET['type'])) {
    $type = $_GET['type'];
    if ($type === 'Image') {
        PGRFileManagerConfig::$allowedExtensions = PGRFileManagerConfig::$imagesExtensions;
        $PGRUploaderDescription = 'images';
    } else {
        if ($type === 'Flash') {
            PGRFileManagerConfig::$allowedExtensions = 'swf|flv';
            $PGRUploaderDescription = 'flash';
        } else {
            $PGRUploaderDescription = 'all files';
        }
    }
    $PGRUploaderType = $_GET['type'];
} else {
    $PGRUploaderType = 'all files';
}
//for ckeditor
if (isset($_GET['CKEditorFuncNum'])) {
    $ckEditorFuncNum = $_GET['CKEditorFuncNum'];
} else {
    $ckEditorFuncNum = '1';
}
Example #2
0
//PGRFileManagerConfig::$urlPath = "";
//    !!!How to determine rootPath and urlPath!!!
//    1. Copy mypath.php file to directory which you want to use with PGRFileManager
//    2. Run mypath.php script, i.e http://my-super-web-page/gallery/mypath.php
//    3. Insert correct values to myconfig.php
//    4. Delete mypath.php from your root directory
//Max file upload size in bytes
PGRFileManagerConfig::$fileMaxSize = 1024 * 1024 * 10;
//Allowed file extensions
//PGRFileManagerConfig::$allowedExtensions = '' means all files
PGRFileManagerConfig::$allowedExtensions = '';
//Allowed image extensions
PGRFileManagerConfig::$imagesExtensions = 'jpg|gif|jpeg|png|bmp';
//Max image file height in px
PGRFileManagerConfig::$imageMaxHeight = 724;
//Max image file width in px
PGRFileManagerConfig::$imageMaxWidth = 1280;
//Thanks to Cycle.cz
//Allow or disallow edit, delete, move, upload, rename files and folders
PGRFileManagerConfig::$allowEdit = true;
// true - false
//Autorization
PGRFileManagerConfig::$authorize = false;
// true - false
PGRFileManagerConfig::$authorizeUser = '******';
PGRFileManagerConfig::$authorizePass = '******';
//Path to CKEditor script
//i.e. http://mypage/ckeditor/ckeditor.js
//PGRFileManagerConfig::$ckEditorScriptPath = '/ckeditor/ckeditor.js';
//File extensions editable by CKEditor
//PGRFileManagerConfig::$ckEditorExtensions = 'html|html|txt';
Example #3
0
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

PGRFileManager IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
include_once dirname(__FILE__) . '/init.php';
include_once dirname(__FILE__) . '/utils.php';
require_once realpath(dirname(__FILE__) . '/../PGRThumb/myconfig.php');
PGRFileManagerConfig::$pgrThumbPath = 'http://' . $_SERVER['SERVER_NAME'] . substr(dirname($_SERVER['PHP_SELF']), 0, strlen(dirname($_SERVER['PHP_SELF'])) - 3) . 'PGRThumb';
//get dir from post
if (isset($_POST['dir'])) {
    $directory = realpath(PGRFileManagerConfig::$rootDir . $_POST['dir']);
} else {
    $directory = realpath(PGRFileManagerConfig::$rootDir);
}
//check if dir exist
if (!is_dir($directory)) {
    die;
}
//check if dir is in rootdir
if (strpos($directory, realpath(PGRFileManagerConfig::$rootDir)) !== 0) {
    die;
}
//check for extra function to do