mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-15 04:28:01 +00:00
implemented alt_folder and reorganized interface class code
This commit is contained in:
@@ -10,10 +10,10 @@ include_once(ROOT.DS.'inc'.DS.'config.inc.php');
|
||||
|
||||
//loading core and controllers
|
||||
include_once(ROOT . DS . 'inc' . DS. 'core.php');
|
||||
require_once(ROOT . DS . 'controllers' . DS. 'image'. DS . 'image.controller.php');
|
||||
require_once(ROOT . DS . 'controllers' . DS. 'text'. DS . 'text.controller.php');
|
||||
require_once(ROOT . DS . 'controllers' . DS. 'url'. DS . 'url.controller.php');
|
||||
require_once(ROOT . DS . 'controllers' . DS. 'video'. DS . 'video.controller.php');
|
||||
require_once(ROOT . DS . 'content-controllers' . DS. 'image'. DS . 'image.controller.php');
|
||||
require_once(ROOT . DS . 'content-controllers' . DS. 'text'. DS . 'text.controller.php');
|
||||
require_once(ROOT . DS . 'content-controllers' . DS. 'url'. DS . 'url.controller.php');
|
||||
require_once(ROOT . DS . 'content-controllers' . DS. 'video'. DS . 'video.controller.php');
|
||||
|
||||
// check write permissions first
|
||||
if(!isFolderWritable(ROOT.DS.'data'))
|
||||
@@ -57,8 +57,19 @@ if ($_FILES['file']["error"] == UPLOAD_ERR_OK)
|
||||
$answer = array('status'=>'err','reason'=>'Unsupported filetype');
|
||||
|
||||
if($answer['hash'])
|
||||
{
|
||||
//add this sha1 to the list
|
||||
addSha1($answer['hash'],$sha1);
|
||||
|
||||
// Lets' check all storage controllers and tell them that a new file was uploaded
|
||||
$sc = getStorageControllers();
|
||||
foreach($sc as $contr)
|
||||
{
|
||||
if((new $contr())->isEnabled()===true)
|
||||
(new $contr())->pushFile($answer['hash']);
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($answer);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user