I am currently in need of giving access to authenticated web users to MCPUK to update an image TV in the context of an FDM form.
Jeff hinted
here that it would be possible to replace the manager check with a webuser check.
Now if I am not wrong, the code which limits the access to manager users is in [tt]manager/media/browser/mcpuk/connectors/php/config.php[/tt]
/**
* Security check user MUST be logged into manager
* before being able to run this script
*/
startCMSSession();
if(!isset($_SESSION[’mgrValidated’])) {
die("<b>INCLUDE_ORDERING_ERROR</b>
Please use the MODx Content Manager instead of accessing this file directly.");
}
(...)
// Override system settings with user settings
define(’IN_MANAGER_MODE’, ’true’); // set this so that user_settings will trust us.
include("../../../../../includes/settings.inc.php");
include("../../../../../includes/user_settings.inc.php");
How could I check that the user is logged in as a webuser ?
Maybe even slightly better, add check that he belongs to a given web user group ?
How about
if($modx->getLoginUserName() !=’’) {
?
Thanks for any pointer !