55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
session_start();
|
||
|
|
||
|
/** Full path to the folder that images will be used as library and upload. Include trailing slash */
|
||
|
#define('LIBRARY_FOLDER_PATH', $_SERVER['DOCUMENT_ROOT'] . 'uploads/');
|
||
|
define('LIBRARY_FOLDER_PATH', $_SERVER['DOCUMENT_ROOT'] . '/img/users/' . $_SESSION['user_id'] . '/');
|
||
|
|
||
|
define('LIBRARY_FOLDER_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/img/users/' . $_SESSION['user_id'] . '/');
|
||
|
|
||
|
@mkdir( $_SERVER['DOCUMENT_ROOT'] . '/img/users/', 0777);
|
||
|
@mkdir( LIBRARY_FOLDER_PATH, 0777);
|
||
|
|
||
|
/** Full URL to the folder that images will be used as library and upload. Include trailing slash and protocol (i.e. http://) */
|
||
|
//define('LIBRARY_FOLDER_URL', '');
|
||
|
|
||
|
/** The extensions for to use in validation */
|
||
|
define('ALLOWED_IMG_EXTENSIONS', 'gif,jpg,jpeg,png,jpe');
|
||
|
|
||
|
/** Use these 3 functions to check cookies and sessions for permission.
|
||
|
Simply write your code and return true or false */
|
||
|
|
||
|
|
||
|
function CanAcessLibrary(){
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function CanAcessUploadForm(){
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function CanAcessAllRecent(){
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function CanCreateFolders(){
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function CanDeleteFiles(){
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function CanDeleteFolder(){
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function CanRenameFiles(){
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function CanRenameFolder(){
|
||
|
return true;
|
||
|
}
|