<?php
// Parser function to parse document page into html string
function parseWebPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
$xml = curl_exec ($ch);
curl_close ($ch);
return $xml;
}
?>

$store = curl_exec ($ch);
$ch = curl_init("http://www.spcs.eu/");
$fp = fopen("example_homepage.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
function parseWebPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
$xml = curl_exec ($ch);
curl_close ($ch);
return $xml;
}
function parseWebPage($url,$siteurl) {
$assets = ’"’ .$siteurl .’/assets/’;
$spage = ’"’ .$siteurl;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
$xml = curl_exec ($ch);
curl_close ($ch);
$xml = str_replace(’"assets/’, $assets, $xml);
$xml = str_replace(’"/assets/’, $assets, $xml);
$xml = str_replace(’"index.php’, $spage, $xml);
return $xml;
}
$url = $modx->config[’site_url’].ltrim($modx->makeUrl($docid), ’/’);
$webPageHtml = parseWebPage($url);
$url = $modx->config[’site_url’].ltrim($modx->makeUrl($docid), ’/’);
$siteurl = $modx->config["site_url"];
$webPageHtml = parseWebPage($url,$siteurl);
You are not allowed to access this area!
// Check user permission
$allowAdmin = false;
// -- Web Group Check
$WebGroup = explode(’|’, $accessWeb);
if($modx->isMemberOfWebGroup($WebGroup))
$allowAdmin = true;
// -- Manager Group Check
if(isMemberOfMgrGroup($modx->documentIdentifier))
$allowAdmin = true;
// Check user permission
$allowAdmin = false;
// -- Web Group Check
$WebGroup = explode(’|’, $accessWeb);
if($modx->isMemberOfWebGroup($WebGroup))
$allowAdmin = true;
// -- Manager Group Check
if(isMemberOfMgrGroup($modx->documentIdentifier))
$allowAdmin = true;
if ($_SESSION[’mgrValidated’]==1) {
$allowAdmin = true;
}
Thanks to awardle, ive got my snippet working for me, but when another user (with full admin rights) logs in and tries to send a newsletter, they getYou are not allowed to access this area!

// -- $docGroup // -- -- Allowed document group to be emailed [name_doc_group | *] (default to *) // -- -- * means every document group // -- -- name_doc_group means any document group separated by coma (ex: docgroup1, docgroup2)