Hello.
I have an external management interface for some products. I want to create a link to this in the manager interface in modx revolution and use manager authentication for my external script. I put this lines in the beginning of the script. Is this sufficient for security?
<?php
define('__ROOT__', dirname(__FILE__));
require_once(__ROOT__.'\config.core.php');
require_once MODX_CORE_PATH.'/model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->getService('error','error.modError');
if (!$modx || !($modx instanceof modX)) { die('No direct access allowed'); }
if (!$modx->user || !$modx->user->hasSessionContext('mgr')) { die ('Please make sure you are logged in to the MODX Manager'); }
?>
If not, where could I find an CMP example which use smarty without extjs and without ajax with return in the same page after committing some db queries (update, insert, etc.)?
Thank a lot!