Пример #1
0
}
if (!fwrite($fp, $thread_id)) {
    echo "  <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n     <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n        <head>\n            <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n            <title>Sphider-plus v.{$plus_nr} Error output</title>\n            <link rel='stylesheet' href='{$template_path}/adminstyle.css' media='screen' type='text/css' />\n            <meta http-equiv='X-UA-Compatible' content='IE=9' />\n            <link href='../templates/html/sphider-plus.ico' rel='shortcut icon' type='image/x-icon' />\n        </head>\n        <body>\n            <p class='warnadmin cntr'>\n            <br /><br />\n            Unable to write the actual MySQL thread-id into file " . $tmp_dir . "/thread_ids.txt\n            <br /><br />\n            Index procedure aborted.\n            <br /><br /></p>\n            <br /><br />\n            <p class='evrow'><a class='bkbtn' href='admin.php' title='Go back to Admin'>Back to admin</a></p>\n            <br /><br />\n        </body>\n    </html>\n        ";
    exit;
}
fclose($fp);
if (!$started) {
    $started = '0';
    //  initialize this variable(will become timestamp when first indexer was started)
}
if ($multi == '2') {
    //  Admin started the first indexer
    $started = time();
}
if ($all != '6') {
    printHTMLHeader($omit, $url, $cl, $multi, $all, $started);
}
if ($multi == '1' && !$url) {
    //  Wait for admin's first thread activation
    die;
}
if ($multi_indexer > '1') {
    // superess output for multithreaded indexing
    $cl = '1';
    $command_line = '1';
}
if ($all == '1') {
    //  for command line operation: index all sites in database
    index_all();
}
if ($all == '2') {
Пример #2
0
require_once ".ht-inc/states.php";
require_once '.ht-inc/errors.php';
require_once '.ht-inc/utils.php';
dbConnect();
initGlobals();
$modes = array_keys($actions['mode']);
$args = array_keys($actions['args']);
$hasArg = 0;
if (in_array($mode, $modes)) {
    $actionFunction = $actions['mode'][$mode];
    if (in_array($mode, $args)) {
        $hasArg = 1;
        $arg = $actions['args'][$mode];
    }
} else {
    $actionFunction = "main";
}
checkAccess();
sendHeaders();
printHTMLHeader();
if ($viewmode == ADMIN_DEVELOPER) {
    set_error_handler("errorHandler");
}
if ($hasArg) {
    $actionFunction($arg);
} else {
    $actionFunction();
}
printHTMLFooter();
dbDisconnect();
semUnlock();
Пример #3
0
function checkExpiredDemoUser($userid, $groups = 0)
{
    global $mode, $skin, $noHTMLwrappers;
    if ($groups == 0) {
        $groups = getUsersGroups($userid, 1);
    }
    if (count($groups) != 1) {
        return;
    }
    $tmp = array_values($groups);
    if ($tmp[0] != 'demo') {
        return;
    }
    $query = "SELECT start " . "FROM log " . "WHERE userid = {$userid} " . "AND finalend < NOW() " . "ORDER BY start " . "LIMIT 3";
    $qh = doQuery($query, 101);
    $expire = time() - SECINDAY * 3;
    $rows = mysql_num_rows($qh);
    if ($row = mysql_fetch_assoc($qh)) {
        if ($rows >= 3 || datetimeToUnix($row['start']) < $expire) {
            if (in_array($mode, $noHTMLwrappers)) {
                # do a redirect and handle removal on next page load so user can
                #   be notified - doesn't always work, but handles a few extra
                #   cases
                header("Location: " . BASEURL . SCRIPT);
            } else {
                $nodemoid = getUserGroupID('nodemo', getAffiliationID('ITECS'));
                $query = "DELETE FROM usergroupmembers " . "WHERE userid = {$userid}";
                # because updateGroups doesn't
                # delete from custom groups
                doQuery($query, 101);
                updateGroups(array($nodemoid), $userid);
                checkUpdateServerRequestGroups($groupid);
                if (empty($skin)) {
                    $skin = 'default';
                    require_once "themes/{$skin}/page.php";
                }
                $mode = 'expiredemouser';
                printHTMLHeader();
                print "<h2>Account Expired</h2>\n";
                print "The account you are using is a demo account that has now expired. ";
                print "You cannot make any more reservations. Please contact <a href=\"";
                print "mailto:" . HELPEMAIL . "\">" . HELPEMAIL . "</a> if you need ";
                print "further access to VCL.<br>\n";
            }
            cleanSemaphore();
            # probably not needed but ensures we do not leave stale entries
            printHTMLFooter();
            dbDisconnect();
            exit;
        }
    }
}
Пример #4
0
/**
 * Displays both the "List of current recipes" and
 * "Insert a new recipe" panels in a single table.
 * @param string $tableTitle The title to display in the html table
 * @param string $sessionToken A session token
 * @return void
 */
function showMainMenu($tableTitle, $sessionToken)
{
    printHTMLHeader();
    print '<table style="width: 75%;text-align:center">' . "\n" . '<tr>' . "\n" . '<th colspan="2" style="text-align:center;">' . 'PHP Demo: Google Base data API<br />' . '<font size="-1">' . '<span style="font-variant: small-caps;">Powered By</span> ' . '<a href="http://framework.zend.com/download/gdata">' . 'Zend Google Data Client Library</a></font></th>' . "\n" . '</tr>' . "\n" . '<tr><td colspan="2" align="center">' . $tableTitle . "</td></tr>\n" . '<tr>' . "\n";
    // Create the two sub-tables.
    showRecipeListPane($sessionToken);
    showRecipeInsertPane($sessionToken);
    // Add a "Sign out" link.
    print '<tr><th colspan="2" style="text-align: center">Or click here to' . ' <a href="http://www.google.com/accounts/Logout">sign out</a>' . ' of your Google account.</th></tr>' . "\n";
    // Close the master table.
    print '</table>' . "\n";
    printHTMLFooter();
}
Пример #5
0
function continuationsError()
{
    global $contdata, $printedHTMLheader, $HTMLheader;
    if (empty($HTMLheader)) {
        printHTMLHeader();
    }
    if (!$printedHTMLheader) {
        $printedHTMLheader = 1;
        print $HTMLheader;
    }
    if (array_key_exists('error', $contdata)) {
        switch ($contdata['error']) {
            case 'invalid input':
                print "<h2>Error: Invalid Input</h2><br>\n";
                print "You submitted input invalid for this web site. If you have no ";
                print "idea why this happened and the problem persists, please email ";
                print "<a href=\"mailto:" . HELPEMAIL . "?Subject=Problem%20With%20VCL\">";
                print HELPEMAIL . "</a> for further assistance.  Please include the ";
                print "steps you took that led up to this problem in your email message.";
                break;
            case 'continuation does not exist':
            case 'expired':
                print "<h2>Error: Invalid Input</h2><br>\n";
                print "You submitted expired data to this web site. Please restart the ";
                print "steps you were following without using your browser's <strong>";
                print "Back</strong> button.";
                break;
            default:
                print "<h2>Error: Invalid Input</h2><br>\n";
                print "An error has occurred.  If this problem persists, please email ";
                print "<a href=\"mailto:" . HELPEMAIL . "?Subject=Problem%20With%20VCL\">";
                print HELPEMAIL . "</a> for further assistance.  Please include the ";
                print "steps you took that led up to this problem in your email message.";
        }
    }
    printHTMLFooter();
    dbDisconnect();
    exit;
}
Пример #6
0
function continuationsError()
{
    global $contdata, $printedHTMLheader, $HTMLheader;
    if (!array_key_exists('noHTMLwrappers', $contdata) || $contdata['noHTMLwrappers'] == 0) {
        if (empty($HTMLheader)) {
            printHTMLHeader();
        }
        if (!$printedHTMLheader) {
            $printedHTMLheader = 1;
            print $HTMLheader;
        }
    }
    if (array_key_exists('error', $contdata)) {
        print "<!-- continuationserror -->\n";
        print "<div id=\"continuationserrormessage\">\n";
        $subj = rawurlencode(i("Problem With VCL"));
        $href = "<a href=\"mailto:" . HELPEMAIL . "?Subject={$subj}\">" . HELPEMAIL . "</a>";
        switch ($contdata['error']) {
            case 'invalid input':
                print "<h2>" . i("Error: Invalid Input") . "</h2><br>\n";
                printf(i("You submitted input invalid for this web site. If you have no idea why this happened and the problem persists, please email %s for further assistance. Please include the steps you took that led up to this problem in your email message."), $href);
                break;
            case 'continuation does not exist':
            case 'expired':
                print "<h2>" . i("Error: Invalid Input") . "</h2><br>\n";
                print i("You submitted expired data to this web site. Please restart the steps you were following without using your browser's <strong>Back</strong> button.");
                break;
            default:
                print "<h2>" . i("Error: Invalid Input") . "</h2><br>\n";
                printf(i("An error has occurred. If this problem persists, please email %s for further assistance. Please include the steps you took that led up to this problem in your email message."), $href);
        }
        print "</div>\n";
    }
    if (!array_key_exists('noHTMLwrappers', $contdata) || $contdata['noHTMLwrappers'] == 0) {
        printHTMLFooter();
    }
    dbDisconnect();
    exit;
}
Пример #7
0
    $log_file = $log_dir . "/" . Date("ymdHi") . ".html";
    if (!($log_handle = fopen($log_file, 'w'))) {
        //      create a new log file
        $logdir = mkdir($log_dir);
        //      try to create a log directory
        if ($logdir != '1') {
            die("Logging option is set, but cannot create folder for logging files.");
        } else {
            if (!($log_handle = fopen($log_file, 'w'))) {
                //      try again to create a log file
                die("Logging option is set, folder was created, but cannot open a file for logging.");
            }
        }
    }
}
printHTMLHeader($omit, $url, $cl);
if ($all == '1') {
    index_all();
}
if ($all == '2') {
    index_new();
}
if ($all != '1' && $all != '2') {
    if ($reindex == 1 && $command_line == 1) {
        $result = mysql_query("select url, spider_depth, required, disallowed, can_leave_domain from " . $mysql_table_prefix . "sites where url='{$url}'");
        echo mysql_error();
        if ($row = mysql_fetch_row($result)) {
            $url = $row[0];
            $maxlevel = $row[1];
            $in = $row[2];
            $out = $row[3];
Пример #8
0
///////////////////////////////////////////////////////////////////////////////////////////
//                                                                                       //
//                              Main program execution                                   //
//                                                                                       //
///////////////////////////////////////////////////////////////////////////////////////////
// Establish a new CLCSConfiguration object
$cfg_file = new CLCSConfiguration("Courthouse");
// Check for a specified action, build out parameters, and execute
if ($_POST["CLCSA"]) {
    $clcsAction = $_POST["CLCSA"];
    $clcsNodeID = $_POST["NodeID"];
    $clcsIPAddress = $_POST["IPA"];
    $clcsGPU = $_POST["GPU"];
    $clcsJobID = $_POST["JOBID"];
    $clcsResults = $_POST["RESULTS"];
    switch ($clcsAction) {
        case 'Register':
            registerNode($cfg_file, $clcsNodeID, $clcsGPU, $clcsIPAddress);
            break;
        case 'SubmitResult':
            processResult($cfg_file, $clcsNodeID, $clcsJobID, $clcsResults);
            break;
        default:
            echo "Received.\n";
            break;
    }
} else {
    printHTMLHeader("Courthouse");
    echo "No action specified.";
    printHTMLFooter();
}