mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-13 03:36:21 +00:00
extended subnet access control
This commit is contained in:
@@ -12,6 +12,10 @@ include_once(ROOT.DS.'inc'.DS.'config.inc.php');
|
||||
include_once(ROOT . DS . 'inc' . DS. 'core.php');
|
||||
loadAllContentControllers();
|
||||
|
||||
// check if client has permission to upload
|
||||
if(defined('ALLOWED_SUBNET') && !isIPInRange( getUserIP(), ALLOWED_SUBNET ))
|
||||
exit(json_encode(array('status'=>'err','reason'=> 'Access denied')));
|
||||
|
||||
// check write permissions first
|
||||
if(!isFolderWritable(ROOT.DS.'data'))
|
||||
exit(json_encode(array('status'=>'err','reason'=>'Data directory not writable')));
|
||||
|
||||
@@ -12,6 +12,10 @@ include_once(ROOT.DS.'inc'.DS.'config.inc.php');
|
||||
include_once(ROOT . DS . 'inc' . DS. 'core.php');
|
||||
loadAllContentControllers();
|
||||
|
||||
// check if client has permission to upload
|
||||
if(defined('ALLOWED_SUBNET') && !isIPInRange( getUserIP(), ALLOWED_SUBNET ))
|
||||
exit(json_encode(array('status'=>'err','reason'=> 'Access denied')));
|
||||
|
||||
// check write permissions first
|
||||
if(!isFolderWritable(ROOT.DS.'data'))
|
||||
exit(json_encode(array('status'=>'err','reason'=>'Data directory not writable')));
|
||||
|
||||
@@ -14,6 +14,10 @@ $controllers = loadAllContentControllers();
|
||||
if(!in_array('TextController',$controllers))
|
||||
exit(json_encode(array('status'=>'err','reason'=>'Text controller not enabled')));
|
||||
|
||||
// check if client has permission to upload
|
||||
if(defined('ALLOWED_SUBNET') && !isIPInRange( getUserIP(), ALLOWED_SUBNET ))
|
||||
exit(json_encode(array('status'=>'err','reason'=> 'Access denied')));
|
||||
|
||||
// check write permissions first
|
||||
if(!isFolderWritable(ROOT.DS.'data'))
|
||||
exit(json_encode(array('status'=>'err','reason'=>'Data directory not writable')));
|
||||
|
||||
Reference in New Issue
Block a user