<?php

if (empty($_POST['submit'])) {
    $content = api_query('https://' . $server . '/manager/ispmgr?func=cron.prop&out=xml&authinfo=' . urlencode($_SESSION['username']) . ':' . urlencode($_SESSION['password']));
    $parse_xml = simplexml_load_string($content);
    echo '<div class="menu"><b>Глобальные настройки</b>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="post"><form action="?func=cron.prop" method="post">' . "\n";
    echo 'E-mail:<br />' . "\n";
    echo '<input name="email"';
    if (isset($parse_xml->email)) {
        echo ' value="' . htmlentities((string)$parse_xml->email, ENT_QUOTES, 'UTF-8') . '"';
    }
    echo ' /><br />' . "\n";
    echo '<input name="submit" type="submit" value="OK" />' . "\n";
    echo '</form>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="post"><img src="images/t-back.png" alt=".." /><a href="?func=cron">Вернуться</a></div>' . "\n";
} else {
    $content = api_query('https://' . $server . '/manager/ispmgr?func=cron.prop&email=' . urlencode($_POST['email']) . '&sok=ok&out=xml&authinfo=' . urlencode($_SESSION['username']) . ':' . urlencode($_SESSION['password']));
    echo '<div class="post"><div style="text-align:center">' . "\n";
    echo 'Настройки успешно изменены!<br />' . "\n";
    echo '<a href="?func=cron">Продолжить&#187;</a>' . "\n";
    echo '</div></div>' . "\n";
}

?>