Exemple #1
0
<?php

define('debug', false);
// settare a true per l'output di debug
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once 'Final/Fun_ChangePhase.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/Lib/ArrTargets.inc.php';
require_once 'Common/Fun_Phases.inc.php';
require_once 'HHT/Fun_HHT.local.inc.php';
if (!CheckTourSession() || !isset($_REQUEST['d_Phase'])) {
    PrintCrackError();
}
$Cols2Remove = isset($_REQUEST['d_Tie']) && $_REQUEST['d_Tie'] == 1 ? 0 : 2;
$Error = false;
$Tie_Error = array();
// Contiene gl'indici delle tendine Tie con errore
$Score_Error = array();
// contiene gl'indici degli score che superano il max
$Set_Error = array();
// contiene gl'indici dei set che superano il max
if (isset($_REQUEST['Command']) && $_REQUEST['Command'] == 'SAVE' && !IsBlocked(BIT_BLOCK_IND)) {
    // Update dei punti e dei tie
    $AllowedEvents = array();
    foreach ($_REQUEST as $Key => $Value) {
        if (strpos($Key, 'S_') === 0) {
            if (!(is_numeric($Value) && $Value >= 0)) {
                $Value = 0;
            }
            $ee = "";
            $mm = "";
Exemple #2
0
<?php

require_once dirname(__FILE__) . '/config.php';
if (empty($_GET['help'])) {
    PrintCrackError('popup');
}
$helpfile = $_GET['help'];
include 'Common/Templates/head-popup.php';
if (file_exists($CFG->DOCUMENT_PATH . 'Common/Help/' . $helpfile)) {
    include $CFG->DOCUMENT_PATH . 'Common/Help/' . $helpfile;
} else {
    echo get_text('CrackError');
}
include 'Common/Templates/tail-popup.php';
Exemple #3
0
function CheckTourSession($PrintCrack = false, $popup = false)
{
    global $CFG;
    // E' selezionato un torneo
    if (isset($_SESSION['TourId']) && $_SESSION['TourId'] > 0 && isset($_SESSION['TourName']) && strlen($_SESSION['TourName']) > 0 && isset($_SESSION['TourWhere']) && strlen($_SESSION['TourWhere']) > 0 && isset($_SESSION['TourWhenFrom']) && $_SESSION['TourWhenFrom'] != '0000-00-00' && isset($_SESSION['TourWhenTo']) && $_SESSION['TourWhenTo'] != '0000-00-00') {
        if (!defined("TargetNoPadding")) {
            define("TargetNoPadding", 3);
        }
        return true;
    } elseif ($PrintCrack) {
        PrintCrackError($popup);
    } else {
        return false;
    }
}
function CheckDbStructure()
{
    global $CFG;
    if (!file_exists($CFG->DOCUMENT_PATH . 'Common/DbStruct.inc.php') or !($IanseoTables = unserialize(file_get_contents($CFG->DOCUMENT_PATH . 'Common/DbStruct.inc.php')))) {
        PrintCrackError('', 'InvalidIanseo');
    }
    if ($IanseoTables->ProgramVersion != ProgramVersion or $IanseoTables->ProgramName != ProgramName) {
        PrintCrackError('', 'PrgVersMismatch');
    }
    foreach ($IanseoTables->Data as $Table => $data) {
        $passed = false;
        $t = safe_w_sql("show create table `{$Table}`", '', array(1146));
        if ($u = safe_fetch($t)) {
            if (!empty($u->{'Create View'})) {
                $u->{'Create View'} = preg_replace('/CREATE .* `' . $u->{'View'} . '`/', 'CREATE VIEW `' . $u->{'View'} . '`', $u->{'Create View'});
                if ($u->{'Create View'} != $data->{'Create View'}) {
                    debug_svela('REBUILD VIEW: STOPS HERE AS A DEVELOPMENT FEATURE');
                    // rebuild the view
                    safe_w_sql("drop view {$Table}");
                    safe_w_sql($data->{'Create View'});
                }
            } else {
                if ($u->{'Create Table'} != $data->{'Create Table'}) {
                    // recreates the table
                    debug_svela('RECREATES TABLE: STOPS HERE AS A DEVELOPMENT FEATURE');
                    safe_w_sql("alter table `{$Table}` rename `old_{$Table}`");
                    safe_w_sql($data->{'Create Table'});
                    $old = safe_r_sql("show fields in `old_{$Table}`");
                    $new = safe_r_sql("show fields in `{$Table}`");
                    $NewTable = array();
                    while ($newRow = safe_fetch($new)) {
                        $NewTable[] = $newRow->Field;
                    }
                    while ($oldRow = safe_fetch($old)) {
                        if (!in_array($oldRow->Field, $NewTable)) {
                            PrintCrackError('', 'DbTooMessy');
                        }
                    }
                    safe_w_sql("insert into `{$Table}` (`" . implode('`, `', $NewTable) . "`) select `" . implode('`, `', $NewTable) . "` from `old_{$Table}`");
                    //					safe_w_sql("drop table `old_$Table`");
                }
            }
        } else {
            PrintCrackError('', 'InvalidIanseo');
        }
    }
}