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:
Ingo Schommer 2011-10-07 11:14:55 +02:00
parent f98bc8480c
commit 3809c1614f

View File

@ -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 = "";