Bitrix Site Manager

OnBeforeProlog event

event_handler();

The OnBeforeProlog event fires in the executable section of a site prologue (after OnPageStart).

Parameters

No parameters.

See Also

Example



<?
// file /bitrix/php_interface/init.php
AddEventHandler("main", 
                "OnBeforeProlog", 
                "MyOnBeforePrologHandler", 
                50);

function MyOnBeforePrologHandler()
{
    global $USER;
    if (SITE_TEMPLATE_ID=='mynewtemplate' && 
        $_SERVER['REMOTE_ADDR']!='127.0.0.1' && 
        !$USER->IsAdmin())
    {
        die('This template is temporary unavailable.');
    }
}
?>