PMC-235
This commit is contained in:
@@ -5490,7 +5490,7 @@ class G
|
|||||||
public static function verifyInputDocExtension($InpDocAllowedFiles, $fileName, $filesTmpName)
|
public static function verifyInputDocExtension($InpDocAllowedFiles, $fileName, $filesTmpName)
|
||||||
{
|
{
|
||||||
$error = null;
|
$error = null;
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) use(&$error) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) use(&$error) {
|
||||||
$error = new stdclass();
|
$error = new stdclass();
|
||||||
$error->status = false;
|
$error->status = false;
|
||||||
$error->message = $validator->getMessage();
|
$error->message = $validator->getMessage();
|
||||||
|
|||||||
@@ -1026,7 +1026,7 @@ class adminProxy extends HttpProxyController
|
|||||||
*/
|
*/
|
||||||
public function uploadImage()
|
public function uploadImage()
|
||||||
{
|
{
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
echo G::json_encode([
|
echo G::json_encode([
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'failed' => true,
|
'failed' => true,
|
||||||
|
|||||||
@@ -725,7 +725,7 @@ class pmTablesProxy extends HttpProxyController
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
throw new ExceptionRestApi($validator->getMessage());
|
throw new ExceptionRestApi($validator->getMessage());
|
||||||
});
|
});
|
||||||
$result = new stdClass();
|
$result = new stdClass();
|
||||||
|
|||||||
@@ -1446,7 +1446,7 @@ function checkTree($uidOriginFolder, $uidNewFolder)
|
|||||||
*/
|
*/
|
||||||
function uploadExternalDocument()
|
function uploadExternalDocument()
|
||||||
{
|
{
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
$response = [
|
$response = [
|
||||||
'error' => $validator->getMessage(),
|
'error' => $validator->getMessage(),
|
||||||
'message' => $validator->getMessage(),
|
'message' => $validator->getMessage(),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function runBgProcessmaker($task, $log)
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
throw new ExceptionRestApi($validator->getMessage());
|
throw new ExceptionRestApi($validator->getMessage());
|
||||||
});
|
});
|
||||||
if (isset($_REQUEST["action"])) {
|
if (isset($_REQUEST["action"])) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ $response = array();
|
|||||||
$status = 1;
|
$status = 1;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
throw new Exception($validator->getMessage());
|
throw new Exception($validator->getMessage());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
use \ProcessMaker\Importer\XmlImporter;
|
use \ProcessMaker\Importer\XmlImporter;
|
||||||
use ProcessMaker\Validation\ValidationUploadedFiles;
|
use ProcessMaker\Validation\ValidationUploadedFiles;
|
||||||
|
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
echo G::json_encode([
|
echo G::json_encode([
|
||||||
'status' => 'ERROR',
|
'status' => 'ERROR',
|
||||||
'success' => true,
|
'success' => true,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
$response = [
|
$response = [
|
||||||
'result' => 0,
|
'result' => 0,
|
||||||
'msg' => $validator->getMessage()
|
'msg' => $validator->getMessage()
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if ($access != 1) {
|
|||||||
$result = new stdClass();
|
$result = new stdClass();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
throw new Exception($validator->getMessage());
|
throw new Exception($validator->getMessage());
|
||||||
});
|
});
|
||||||
//if the xmlform path is writeable
|
//if the xmlform path is writeable
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ global $RBAC;
|
|||||||
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
throw new Exception($validator->getMessage());
|
throw new Exception($validator->getMessage());
|
||||||
});
|
});
|
||||||
//load the variables
|
//load the variables
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ function newSkin ($baseSkin = 'classic')
|
|||||||
function importSkin ()
|
function importSkin ()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
throw new Exception($validator->getMessage());
|
throw new Exception($validator->getMessage());
|
||||||
});
|
});
|
||||||
if (! isset( $_FILES['uploadedFile'] )) {
|
if (! isset( $_FILES['uploadedFile'] )) {
|
||||||
|
|||||||
@@ -937,7 +937,7 @@ class InputDocument
|
|||||||
*/
|
*/
|
||||||
public function uploadFileCase($files, $caseInstance, $aData, $userUid, $appUid, $delIndex)
|
public function uploadFileCase($files, $caseInstance, $aData, $userUid, $appUid, $delIndex)
|
||||||
{
|
{
|
||||||
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) {
|
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
|
||||||
G::SendMessageText($validator->getMessage(), "ERROR");
|
G::SendMessageText($validator->getMessage(), "ERROR");
|
||||||
$url = explode("sys" . config("system.workspace"), $_SERVER['HTTP_REFERER']);
|
$url = explode("sys" . config("system.workspace"), $_SERVER['HTTP_REFERER']);
|
||||||
G::header("location: " . "/sys" . config("system.workspace") . $url[1]);
|
G::header("location: " . "/sys" . config("system.workspace") . $url[1]);
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class ValidationUploadedFiles
|
|||||||
* @param function $callback
|
* @param function $callback
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function dispach($callback)
|
public function dispatch($callback)
|
||||||
{
|
{
|
||||||
if (!empty($this->fails[0])) {
|
if (!empty($this->fails[0])) {
|
||||||
if (!empty($callback) && is_callable($callback)) {
|
if (!empty($callback) && is_callable($callback)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user