mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
API CHANGE Require ADMIN permissions for performance-heavy tasks in CMSMain: getpagecount() and publishall(), and using increase_time_limit_to() which respects higher max_execution_time settings
This commit is contained in:
parent
f98bc8480c
commit
3809c1614f
@ -1006,8 +1006,6 @@ JS;
|
||||
$page->HasBrokenLink = 0;
|
||||
$page->HasBrokenFile = 0;
|
||||
|
||||
$lastUsage = (memory_get_usage() - $lastPoint);
|
||||
$lastPoint = memory_get_usage();
|
||||
$content->setValue($page->Content);
|
||||
$content->saveInto($page);
|
||||
|
||||
@ -1066,7 +1064,11 @@ JS;
|
||||
* Helper function to get page count
|
||||
*/
|
||||
function getpagecount() {
|
||||
ini_set('max_execution_time', 0);
|
||||
if(!Permission::check('ADMIN')) return Security::permissionFailure($this);
|
||||
|
||||
increase_time_limit_to();
|
||||
increase_memory_limit_to();
|
||||
|
||||
$excludePages = split(" *, *", $_GET['exclude']);
|
||||
|
||||
$pages = DataObject::get("SiteTree", "\"ParentID\" = 0");
|
||||
@ -1093,8 +1095,10 @@ JS;
|
||||
}
|
||||
|
||||
function publishall($request) {
|
||||
ini_set("memory_limit", -1);
|
||||
ini_set('max_execution_time', 0);
|
||||
if(!Permission::check('ADMIN')) return Security::permissionFailure($this);
|
||||
|
||||
increase_time_limit_to();
|
||||
increase_memory_limit_to();
|
||||
|
||||
$response = "";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user