@@ -256,9 +256,8 @@ public function rebuildManagedFiles() {
256
256
* )
257
257
*/
258
258
public function saveManifest () {
259
- // load the site from name
260
259
if (isset ($ this ->params ['site_token ' ]) && $ GLOBALS ['HAXCMS ' ]->validateRequestToken ($ this ->params ['site_token ' ], $ GLOBALS ['HAXCMS ' ]->getActiveUserName () . ': ' . $ this ->params ['site ' ]['name ' ])) {
261
-
260
+ // load the site from name
262
261
$ site = $ GLOBALS ['HAXCMS ' ]->loadSite ($ this ->params ['site ' ]['name ' ]);
263
262
// standard form submit
264
263
// @todo
@@ -487,7 +486,7 @@ public function saveManifest() {
487
486
else {
488
487
return array (
489
488
'__failed ' => array (
490
- 'status ' => 500 ,
489
+ 'status ' => 403 ,
491
490
'message ' => 'invalid site token ' ,
492
491
)
493
492
);
@@ -709,7 +708,7 @@ public function saveOutline() {
709
708
} else {
710
709
return array (
711
710
'__failed ' => array (
712
- 'status ' => 500 ,
711
+ 'status ' => 403 ,
713
712
'message ' => 'invalid site token ' ,
714
713
)
715
714
);
@@ -884,8 +883,8 @@ public function createNode() {
884
883
else {
885
884
return array (
886
885
'__failed ' => array (
887
- 'status ' => 500 ,
888
- 'message ' => 'failed to create node ' ,
886
+ 'status ' => 403 ,
887
+ 'message ' => 'invalid site token ' ,
889
888
)
890
889
);
891
890
}
@@ -1278,8 +1277,8 @@ public function deleteNode() {
1278
1277
else {
1279
1278
return array (
1280
1279
'__failed ' => array (
1281
- 'status ' => 500 ,
1282
- 'message ' => 'failed to delete ' ,
1280
+ 'status ' => 403 ,
1281
+ 'message ' => 'invalid site token ' ,
1283
1282
)
1284
1283
);
1285
1284
}
@@ -1372,7 +1371,7 @@ public function generateAppStore() {
1372
1371
}
1373
1372
$ appStore = $ haxService ->loadBaseAppStore ($ apikeys );
1374
1373
// pull in the core one we supply, though only upload works currently
1375
- $ tmp = json_decode ($ GLOBALS ['HAXCMS ' ]->siteConnectionJSON ($ this ->params ['site_token ' ], $ this -> params [ ' site ' ][ ' name ' ] ));
1374
+ $ tmp = json_decode ($ GLOBALS ['HAXCMS ' ]->siteConnectionJSON ($ this ->params ['site_token ' ]));
1376
1375
array_push ($ appStore , $ tmp );
1377
1376
if (isset ($ GLOBALS ['HAXCMS ' ]->config ->appStore ->stax )) {
1378
1377
$ staxList = $ GLOBALS ['HAXCMS ' ]->config ->appStore ->stax ;
@@ -1452,6 +1451,14 @@ public function getUserData() {
1452
1451
'data ' => $ GLOBALS ['HAXCMS ' ]->userData
1453
1452
);
1454
1453
}
1454
+ else {
1455
+ return array (
1456
+ '__failed ' => array (
1457
+ 'status ' => 403 ,
1458
+ 'message ' => 'invalid request token ' ,
1459
+ )
1460
+ );
1461
+ }
1455
1462
}
1456
1463
/**
1457
1464
* @OA\Post(
@@ -1904,6 +1911,14 @@ public function listSites() {
1904
1911
"data " => $ return
1905
1912
);
1906
1913
}
1914
+ else {
1915
+ return array (
1916
+ '__failed ' => array (
1917
+ 'status ' => 403 ,
1918
+ 'message ' => 'invalid request token ' ,
1919
+ )
1920
+ );
1921
+ }
1907
1922
}
1908
1923
/**
1909
1924
* @OA\Post(
@@ -2240,6 +2255,14 @@ public function cloneSite() {
2240
2255
),
2241
2256
);
2242
2257
}
2258
+ else {
2259
+ return array (
2260
+ '__failed ' => array (
2261
+ 'status ' => 403 ,
2262
+ 'message ' => 'invalid request token ' ,
2263
+ )
2264
+ );
2265
+ }
2243
2266
}
2244
2267
/**
2245
2268
* @OA\Post(
@@ -2324,6 +2347,14 @@ public function downloadSite() {
2324
2347
)
2325
2348
);
2326
2349
}
2350
+ else {
2351
+ return array (
2352
+ '__failed ' => array (
2353
+ 'status ' => 403 ,
2354
+ 'message ' => 'invalid request token ' ,
2355
+ )
2356
+ );
2357
+ }
2327
2358
}
2328
2359
/**
2329
2360
* @OA\Post(
@@ -2383,5 +2414,13 @@ public function archiveSite() {
2383
2414
);
2384
2415
}
2385
2416
}
2417
+ else {
2418
+ return array (
2419
+ '__failed ' => array (
2420
+ 'status ' => 403 ,
2421
+ 'message ' => 'invalid request token ' ,
2422
+ )
2423
+ );
2424
+ }
2386
2425
}
2387
2426
}
0 commit comments