I have created a snippet that contains php and JavaScript code. The code will auto submit stories on submit step 3 page (preview). The problem is that I only want this auto submit for god users, not for normal users. How do I modify the code so that the JavaScript only works for god?
{php}
echo "<script>submitEdgeStory();</script>";
{/php}
The submitEdgeStory(); will automatically "push" the submit button on submit step 3 page (the preview page) for ALL users, but I want it to only automatically submit stories for the god user.
Maybe there will be a way to combine the code above and the php script that disable submits for non-god users. This code will disable the normal users to submit stories and only let god submit an url at submit step 1 page. Maybe the first problem will be solved using this code together with the first one?
{php}
// require user to log in
force_authentication();
// restrict access to god only
$canIhaveAccess = 0;
$canIhaveAccess = $canIhaveAccess + checklevel('god');
if($canIhaveAccess == 0){
header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
die();
}
{/php}







Linear Mode




