I’m not totally sure if you don’t want to load the framework for a reason. Also don’t know if my solution is elegant and/or there are better ways, but what I did with my cronjob works:
- Used an generated empty PHPMaker page, and put the standalone code in there. Name: cronmailer.php
- Gave the cronjob it’s own username/password, i.e. cjmailer
- The cronjob accesses login.php via wget (/usr/bin/wget) w un/pw
- I redirect in Server Events/Other/Default Page/Page_Redirecting with
if (IsLoggedIn()) {
$username=CurrentUserName();
$userlevel=CurrentUserLevel();
if ($username==“cjmailer”) {
$url=“cronmailer.php”;
}
}
works without any hassles