Пример #1
0
    if (isset($_POST['new_password'])) {
        $new_password = $_POST['new_password'];
    }
    echo Pingouin_alias_update($_POST['alias'], $_POST['destination'], $_POST['password'], $new_password, get_ip_address($cfg));
} elseif (isset($_GET['alias_delete'])) {
    if (!isset($_POST['alias']) || !isset($_POST['password'])) {
        echo 'Error';
        exit;
    }
    echo Pingouin_alias_delete($_POST['alias'], $_POST['password']);
} elseif (isset($_GET['init_async'])) {
    if (!Pingouin_challenge_upload_ip($cfg, get_ip_address($cfg))) {
        echo 'Error';
        exit;
    }
    if (Pingouin_has_upload_password($cfg) && (!isset($_POST['upload_password']) || !Pingouin_challenge_upload_password($cfg, $_POST['upload_password']))) {
        echo 'Error';
        exit;
    }
    if (!isset($_POST['filename'])) {
        echo 'Error';
        exit;
    }
    $type = '';
    if (isset($_POST['type'])) {
        $type = $_POST['type'];
    }
    $key = '';
    if (isset($_POST['key'])) {
        $key = $_POST['key'];
    }
Пример #2
0
/* Check if user is allowed to upload. */
if (!Pingouin_challenge_upload_ip($cfg, get_ip_address($cfg))) {
    echo '<div class="error"><p>' . t('Access denied') . '</p></div>';
    require Pingouin_ROOT . 'lib/template/footer.php';
    exit;
}
/* Ask password if upload password is set. */
if (Pingouin_has_upload_password($cfg)) {
    session_start();
    /* Unlog if asked. */
    if (isset($_POST['action']) && strcmp($_POST['action'], 'logout') == 0) {
        session_unset();
    }
    /* Auth. */
    if (isset($_POST['upload_password'])) {
        if (Pingouin_challenge_upload_password($cfg, $_POST['upload_password'])) {
            $_SESSION['upload_auth'] = true;
            $_SESSION['user_upload_password'] = $_POST['upload_password'];
        } else {
            $_SESSION['admin_auth'] = false;
            echo '<div class="error"><p>' . t('Wrong password.') . '</p></div>';
            require Pingouin_ROOT . 'lib/template/footer.php';
            exit;
        }
    }
    /* Show auth page. */
    if (!isset($_SESSION['upload_auth']) || $_SESSION['upload_auth'] != true) {
        ?>
        <form action = "<?php 
        echo basename(__FILE__);
        ?>