Access denied when executing processor system/settings/update


I wrote a script to update some settings on multiple instances of MIodX.
My script is on the same server and can access to the ModX core.
I can initialize ModX and receive correct information for some method/command like getting current user or the whole user list.

But the processor to update some settings return an error.

An idea?

My pseudo code:

require_once (INSTALLFOLDER.$install['folder'].'/config.core.php');
require_once (MODX_CORE_PATH.'model/modx/modx.class.php');
$modx = new modX();
$modx->getService('error','error.modError', '', '');

$s= array(	"key"=> "login_text",
			"value"=> "Login with My Account",
$processor = "system/settings/update";
    $options = array();
    $result = $modx->runProcessor($processor, $s, $options);
    if (method_exists($result,"isError"))
		echo  "Unable to update ".$s['key'].": ".$s['value']."\n";
		echo "Error: ".$result->getMessage();
	    } else {
		echo 'all done';

Thank you

What’s the error message? You can check the error message(s) using $result->getAllErrors().

Hi Joshua, the error is

An idea?


When I use the deprecated syntax, it works fine.

So I will use the deprecated syntax:

define('MODX_API_MODE', true);
$modx = new modX();