<?php

$index = $REQUEST['index'];
$url = $REQUEST['url'];
// Quick sanity check to make sure we are not getting stale or bogus info
if ($_SESSION['links'][$index]->url != $url) {
    showFatalError("Bookmark garbled!  Please <a href=\"?action=restart\">" . "restart.</a>");
}
$_SESSION['links'][$index]->lastVisitedTimestamp = time();
$_SESSION['links'][$index]->visitCount++;
writeLinkFile($bookmarkFile, $_SESSION['links']);
refreshLinks($bookmarkFile);
header("Location: {$_SESSION['links'][$index]->url}\r\n");
Example #2
0
    if (!createDir($_CONFIG['log_dir'])) {
        if ($_INI['debug_ajax']) {
            showDebugMessage('Failed to create log_dir ' . $_CONFIG['log_dir']);
        }
        showAlertMessage("<span class='ubrError'>ERROR</span>: Failed to create log_dir", 1);
    }
}
// Purge old .link files
if ($_INI['purge_link_files']) {
    purgeFiles($TEMP_DIR, $_INI['purge_link_limit'], 'link', $_INI['debug_ajax']);
}
// Purge old .redirect files
if ($_INI['purge_redirect_files']) {
    purgeFiles($TEMP_DIR, $_INI['purge_redirect_limit'], 'redirect', $_INI['debug_ajax']);
}
// Show debug message
if ($_INI['debug_ajax']) {
    showDebugMessage("Upload ID = {$UPLOAD_ID}");
}
// Write link file
if (writeLinkFile($_CONFIG, $DATA_DELIMITER)) {
    if ($_INI['debug_ajax']) {
        showDebugMessage('Created link file ' . $PATH_TO_LINK_FILE);
    }
    startUpload($UPLOAD_ID, $_INI['debug_upload'], $_INI['debug_ajax']);
} else {
    if ($_INI['debug_ajax']) {
        showDebugMessage('Failed to create link file ' . $PATH_TO_LINK_FILE);
    }
    showAlertMessage("<span class='ubrError'>ERROR</span>: Failed to create link file: {$UPLOAD_ID}.link", 1);
}