Ejemplo n.º 1
0
function doInit()
{
    if (Config::$pass == null) {
        Config::$pass = trim(file_get_contents(getenv("HOME") . '/.cluebotng.password.only'));
    }
    API::init();
    API::$a->login(Config::$user, Config::$pass);
    Globals::$mysql = false;
    checkMySQL();
    Globals::$tfas = 0;
    Globals::$stdin = fopen('php://stdin', 'r');
    Globals::$run = API::$q->getpage('User:'******'/Run');
    Globals::$wl = API::$q->getpage('Wikipedia:Huggle/Whitelist');
    Globals::$optin = API::$q->getpage('User:'******'/Optin');
    Globals::$aoptin = API::$q->getpage('User:'******'/AngryOptin');
    Globals::$stalk = array();
    Globals::$edit = array();
    $tmp = explode("\n", API::$q->getpage('User:'******'/CBAutostalk.js'));
    foreach ($tmp as $tmp2) {
        if (substr($tmp2, 0, 1) != '#') {
            $tmp3 = explode('|', $tmp2, 2);
            Globals::$stalk[$tmp3[0]] = trim($tmp3[1]);
        }
    }
    $tmp = explode("\n", API::$q->getpage('User:'******'/CBAutoedit.js'));
    foreach ($tmp as $tmp2) {
        if (substr($tmp2, 0, 1) != '#') {
            $tmp3 = explode('|', $tmp2, 2);
            Globals::$edit[$tmp3[0]] = trim($tmp3[1]);
        }
    }
}
Ejemplo n.º 2
0
<?php

require_once 'wp-config.php';
require_once 'testlib/testlib.php';
// Get DB_NAME
if (MULTISITE === true) {
    $dbname = DB_NAME;
} else {
    $dbname = DB_NAME . '_global';
}
// Get DB_HOST and DB_PORT
if (strrpos(DB_HOST, ':') > 0) {
    $dbhost = substr(DB_HOST, 0, strrpos(DB_HOST, ':'));
    $dbport = substr(DB_HOST, strrpos(DB_HOST, ':') + 1);
} else {
    $dbhost = DB_HOST;
    $dbport = 3306;
}
checkMySQL($dbhost, $dbport, $dbname, DB_USER, DB_PASSWORD, 'wp_users');
test_mail('XTECBLOCS', false, ENVIRONMENT, get_site_option('xtec_mail_logpath'));
test_ldap(false, ENVIRONMENT);
test_proxy('http://www.google.com');
test_server('UTC');
Ejemplo n.º 3
0
 * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0 Unported License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/3.0/.
 *
 * @link 		http://www.easyscp.net
 * @author 		EasySCP Team
 */
require 'easyscp-setup-lib.php';
# Es soll unsere eigene Fehlerbehandlung genutzt werden
set_error_handler("errorHandler");
$tpl = EasySCP_TemplateEngine::getInstance();
$template = 'index.tpl';
$xml = simplexml_load_file("config.xml");
if (isset($_POST['uaction']) && $_POST['uaction'] != '') {
    switch ($_POST['uaction']) {
        case 'step1':
            if (checkMySQL($xml)) {
                $template = 'index2.tpl';
            }
            break;
        case 'step2':
            if (checkData($xml)) {
                $template = 'index_finisch.tpl';
            } else {
                $template = 'index2.tpl';
            }
            break;
        default:
            $template = 'index.tpl';
    }
}
// static page messages
Ejemplo n.º 4
0
<td class="content_key top c"><strong>PHP</strong></td>
<td class="content_value top c"><strong>Version</strong></td>
<td class="content_desc top r" colspan="2"><strong>Summary</strong></td>
</tr>
<?php 
checkPHP();
?>
<tr>
<td class="content_key top c"><strong>Database</strong></td>
<td class="content_value top c"><strong>Version</strong></td>
<td class="content_desc top r" colspan="2"><strong>Summary</strong></td>
</tr>
<?php 
// Database Checks
checkSQLite3();
checkMySQL();
checkPostgreSQL();
?>
</table>
</div>
<div class="spacer"></div>
<div class="diag_header"><h1>Utilities</h1></div>
<div class="content_wrap">
<table class="content_table" cellpadding='0' cellspacing='0'>
<?php 
// Database Utilities
utilSQLite3();
utilMySQL();
//utilPostgreSQL();
?>
</table>
Ejemplo n.º 5
0
 public static function processEditThread($change)
 {
     $change['edit_status'] = 'not_reverted';
     if (!isset($s)) {
         $change['edit_score'] = 'N/A';
     } else {
         $change['edit_score'] = $s;
     }
     if (!isVandalism($change['all'], $s)) {
         Feed::bail($change, 'Below threshold', $s);
         return;
     }
     echo 'Is ' . $change['user'] . ' whitelisted ?' . "\n";
     if (Action::isWhitelisted($change['user'])) {
         Feed::bail($change, 'Whitelisted', $s);
         return;
     }
     echo 'No.' . "\n";
     $reason = 'ANN scored at ' . $s;
     $heuristic = '';
     $log = null;
     $diff = 'https://en.wikipedia.org/w/index.php' . '?title=' . urlencode($change['title']) . '&diff=' . urlencode($change['revid']) . '&oldid=' . urlencode($change['old_revid']);
     $report = '[[' . str_replace('File:', ':File:', $change['title']) . ']] was ' . '[' . $diff . ' changed] by ' . '[[Special:Contributions/' . $change['user'] . '|' . $change['user'] . ']] ' . '[[User:'******'user'] . '|(u)]] ' . '[[User talk:' . $change['user'] . '|(t)]] ' . $reason . ' on ' . gmdate('c');
     $oftVand = unserialize(file_get_contents('oftenvandalized.txt'));
     if (rand(1, 50) == 2) {
         foreach ($oftVand as $art => $artVands) {
             foreach ($artVands as $key => $time) {
                 if (time() - $time > 2 * 24 * 60 * 60) {
                     unset($oftVand[$art][$key]);
                 }
             }
         }
     }
     $oftVand[$change['title']][] = time();
     if (count($oftVand[$change['title']]) >= 30) {
         IRC::say('reportchannel', '!admin [[' . $change['title'] . ']] has been vandalized ' . count($oftVand[$change['title']]) . ' times in the last 2 days.');
     }
     file_put_contents('oftenvandalized.txt', serialize($oftVand));
     //IRC::say( 'debugchannel', 'Possible vandalism: ' . $change[ 'title' ] . ' changed by ' . $change[ 'user' ] . ' ' . $reason . '(' . $s . ')' );
     //IRC::say( 'debugchannel', '( https://en.wikipedia.org/w/index.php?title=' . urlencode( $change[ 'title' ] ) . '&action=history | ' . $change[ 'url' ] . ' )' );
     $ircreport = "15[[07" . $change['title'] . "15]] by \"03" . $change['user'] . "15\" (12 " . $change['url'] . " 15) 06" . $s . "15 (";
     checkMySQL();
     $query = 'INSERT INTO `vandalism` ' . '(`id`,`user`,`article`,`heuristic`' . (is_array($log) ? ',`regex`' : '') . ',`reason`,`diff`,`old_id`,`new_id`,`reverted`) ' . 'VALUES ' . '(NULL,\'' . mysql_real_escape_string($change['user']) . '\',' . '\'' . mysql_real_escape_string($change['title']) . '\',' . '\'' . mysql_real_escape_string($heuristic) . '\',' . (is_array($log) ? '\'' . mysql_real_escape_string($logt) . '\',' : '') . '\'' . mysql_real_escape_string($reason) . '\',' . '\'' . mysql_real_escape_string($change['url']) . '\',' . '\'' . mysql_real_escape_string($change['old_revid']) . '\',' . '\'' . mysql_real_escape_string($change['revid']) . '\',0)';
     mysql_query($query, Globals::$mysql);
     $change['mysqlid'] = mysql_insert_id();
     echo 'Should revert?' . "\n";
     list($shouldRevert, $revertReason) = Action::shouldRevert($change);
     $change['revert_reason'] = $revertReason;
     if ($shouldRevert) {
         echo 'Yes.' . "\n";
         $rbret = Action::doRevert($change);
         if ($rbret !== false) {
             $change['edit_status'] = 'reverted';
             RedisProxy::send($change);
             //IRC::say( 'debugchannel', 'Reverted. (' . ( microtime( true ) - $change[ 'startTime' ] ) . ' s)' );
             IRC::say('debugchannel', $ircreport . "04Reverted15) (13" . $revertReason . "15) (02" . (microtime(true) - $change['startTime']) . " 15s)");
             Action::doWarn($change, $report);
             checkMySQL();
             mysql_query('UPDATE `vandalism` SET `reverted` = 1 WHERE `id` = \'' . mysql_real_escape_string($change['mysqlid']) . '\'', Globals::$mysql);
             Feed::bail($change, $revertReason, $s, true);
         } else {
             $change['edit_status'] = 'beaten';
             $rv2 = API::$a->revisions($change['title'], 1);
             if ($change['user'] != $rv2[0]['user']) {
                 //IRC::say( 'debugchannel', 'Grr! Beaten by ' . $rv2[ 0 ][ 'user' ] );
                 RedisProxy::send($change);
                 IRC::say('debugchannel', $ircreport . "03Not Reverted15) (13Beaten by " . $rv2[0]['user'] . "15) (02" . (microtime(true) - $change['startTime']) . " 15s)");
                 checkMySQL();
                 mysql_query('INSERT INTO `beaten` (`id`,`article`,`diff`,`user`) VALUES (NULL,\'' . mysql_real_escape_string($change['title']) . '\',\'' . mysql_real_escape_string($change['url']) . '\',\'' . mysql_real_escape_string($rv2[0]['user']) . '\')', Globals::$mysql);
                 Feed::bail($change, 'Beaten by ' . $rv2[0]['user'], $s);
             }
         }
     } else {
         RedisProxy::send($change);
         IRC::say('debugchannel', $ircreport . "03Not Reverted15) (13" . $revertReason . "15) (02" . (microtime(true) - $change['startTime']) . " 15s)");
         Feed::bail($change, $revertReason, $s);
     }
 }