Ejemplo n.º 1
0
 * Be sure PHP's safe mode is off.
 */
@set_time_limit(0);
/* Remove errors. */
@error_reporting(0);
$link_name = $_GET['h'];
if (!preg_match('/[0-9a-zA-Z_-]+$/', $link_name)) {
    require Pingouin_ROOT . 'lib/template/header.php';
    echo '<div class="error"><p>' . t('Sorry, the requested file is not found') . '</p></div>';
    require Pingouin_ROOT . 'lib/template/footer.php';
    exit;
}
$link = Pingouin_get_link($link_name);
if (count($link) == 0) {
    /* Try alias. */
    $alias = Pingouin_get_alias(md5($link_name));
    if (count($alias) > 0) {
        $link = Pingouin_get_link($alias["destination"]);
    }
}
if (count($link) == 0) {
    require Pingouin_ROOT . 'lib/template/header.php';
    echo '<div class="error"><p>' . t('Sorry, the requested file is not found') . '</p></div>';
    require Pingouin_ROOT . 'lib/template/footer.php';
    exit;
}
$delete_code = '';
if (isset($_GET['d']) && !empty($_GET['d']) && $_GET['d'] != '1') {
    $delete_code = $_GET['d'];
}
$crypt_key = '';
Ejemplo n.º 2
0
/** Delete an alias.
 * @param $alias alias to delete
 * @param $password password to protect alias
 * @return "Ok" or "Error" string
 */
function Pingouin_alias_delete($alias, $password)
{
    $alias = md5($alias);
    /* Check that alias exits. */
    $a = Pingouin_get_alias($alias);
    if (!count($a)) {
        return "Error";
    }
    /* Check password. */
    if ($a["md5_password"] != md5($password)) {
        return 'Error';
    }
    Pingouin_clean_rm_alias($alias);
    return 'Ok';
}