Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 19. apríl 2024

Súbor: [Platon] / Metafox / admin / inc-db / maintenance.inc.php (stiahnutie)

Revízia 1.18, Tue Oct 27 11:14:13 2015 UTC (8 years, 5 months ago) by igor

Zmeny od 1.17: +32 -0 [lines]

added option for Article items Loadmore

<?php

if (@file_exists('inc/auth.inc.php') && @include_once 'inc/auth.inc.php');
else exit;

function ezin_admin_maintenance_main($restricted = 0) {

    global $rest;
    $rest = $restricted;

    /**
     *    Kontrola databazy na jednotlive update
     *
     *    Vyzaduje:
     *        - PEAR::DB
     *        - nastavenie pripojenia k databaze (pouziva /config/db-config.inc.php)
     *
     *    Jednotlive polozky je mozne definovat ako "komentar", ktory sa zobrazi
     *    ako <H2>, ako "update", alebo ako "repair".
     *
     *    Pri polozke typu "komentar" je potrebne definovat atributy:
     *        - "type" kde sa uvedie "comment"
     *        - "description" kde sa uvedie samotny komentar (nadpis)
     *
     *    Pri polozke typu "update" je potrebje definovat atributy:
     *        - "type" kde sa uvedie "update"
     *        - "description" = nejaky komentar preco je tento update
     *        - "test" = testovaci SQL dopyt
     *        - "method" = sposob spracovania dopytu pre ucel porovnania, tu su mozne
     *            nasledujuce hodnoty: one, col, all (su totozne s metodamy v PEAR::DB getOne, getCol, getAll)
     *        - "correct_answer" = tato hodnota bude porovnavana s vysledkom dopytu testu
     *        - "repair" = samotny SQL dopyt updatu
     *
     *    Pri polozke typu "repair" je potrebje definovat atributy:
     *        - "type" kde sa uvedie "repair"
     *        - "description" = nejaky komentar preco je tato oprava
     *        - "repair" = samotny SQL dopyt opravy
     *
     *    Autor:    Igor Mino, igor@platon.sk
     *
     *    Verzia:    1.0    2011-05-14 17:41
     *            1.1    2011-05-15 22:38
     *            1.2    2011-05-24 16:47    - integrovane do admin rozhrania Metafox
     *            1.3    2011-06-09 18:40    - doplnene testy v CONFIG DATA, spustanie testov synchronizovane
     *            1.4    2011-06-17 16:48    - doplnene testy pre Sources
     *            1.5    2012-05-02 14:28    - prepisanie verzii updatov
     *            1.6    2012-05-14 15:38    - doplnene pre Boxes
     *            1.7    2012-05-15 12:47    - link redirect
     *            1.8 2013-07-24 08:32    - feedback flood timeout
     *            2015-01-15 16:56        - datetime filter for article
     *
     */

    global $tests;
    $tests = array();
    global $protocol;
    $protocol = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http';

    // ====[ Definovanie jednotlivych update ]======================================


    // ----[ UPDATE 0.8.13 ]----
    $tests[] = array(
        'type' => 'comment',
        'description' => 'Update 0.8.13'
    );
    
    // ID fields resize
    $tests[] = array(
        'type' => 'update',
        'description' => 'ID fields resize - ezin_cache',
        'test' => 'show columns from ezin_cache where field = "id" and type = "varchar(64)"',
        'method' => 'one',
        'correct_answer' => 'id',
        'repair' => 'alter table ezin_cache modify id varchar(64)'
    );

    // Feedback data integrity
    $tests[] = array(
        'type' => 'update',
        'description' => 'Feedback data integrity',
        'test' => 'select count(*) from ezin_feedback_data where feedback_id not in (select id from ezin_feedbacks)',
        'method' => 'one',
        'correct_answer' => '0',
        'repair' => 'delete from ezin_feedback_data where feedback_id not in (select id from ezin_feedbacks)'
    );

    // Modify bodytext to longtext
    $tests[] = array(
        'type' => 'update',
        'description' => 'Modify bodytext to longtext - ezin_articles',
        'test' => 'show columns from ezin_articles where field = "bodytext" and type = "longtext"',
        'method' => 'one',
        'correct_answer' => 'bodytext',
        'repair' => 'alter table ezin_articles modify bodytext longtext'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Clear "lang" where is null - ezin_sections',
        'repair' => 'update ezin_sections set lang = "" where lang is null'
    );
    
    $tests[] = array(
        'type' => 'update',
        'description' => 'Add "type" - ezin_authors',
        'test' => 'describe ezin_authors type',
        'method' => 'one',
        'correct_answer' => 'type',
        'repair' => 'alter table ezin_authors add type enum("internal","external") after id'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Set "internal" where is null or empty - ezin_authors',
        'repair' => 'update ezin_authors set type = "internal" where type is NULL or type = ""'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'Author name resize',
        'test' => 'show columns from ezin_authors where field = "name" and type = "varchar(255)"',
        'method' => 'one',
        'correct_answer' => 'name',
        'repair' => 'alter table ezin_authors modify name varchar(255)'
    );

    // credentials - ezin_articles
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_articles - add created_id',
        'test' => 'describe ezin_articles created_id',
        'method' => 'one',
        'correct_answer' => 'created_id',
        'repair' => 'alter table ezin_articles add column created_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_articles - add created_by',
        'test' => 'describe ezin_articles created_by',
        'method' => 'one',
        'correct_answer' => 'created_by',
        'repair' => 'alter table ezin_articles add column created_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_articles - add created_dt',
        'test' => 'describe ezin_articles created_dt',
        'method' => 'one',
        'correct_answer' => 'created_dt',
        'repair' => 'alter table ezin_articles add column created_dt datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_articles - add changed_id',
        'test' => 'describe ezin_articles changed_id',
        'method' => 'one',
        'correct_answer' => 'changed_id',
        'repair' => 'alter table ezin_articles add column changed_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_articles - add changed_by',
        'test' => 'describe ezin_articles changed_by',
        'method' => 'one',
        'correct_answer' => 'changed_by',
        'repair' => 'alter table ezin_articles add column changed_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_articles - add changed_dt',
        'test' => 'describe ezin_articles changed_dt',
        'method' => 'one',
        'correct_answer' => 'changed_dt',
        'repair' => 'alter table ezin_articles add column changed_dt datetime'
    );
    
    // credentials - ezin_authors
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors - add created_id',
        'test' => 'describe ezin_authors created_id',
        'method' => 'one',
        'correct_answer' => 'created_id',
        'repair' => 'alter table ezin_authors add column created_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors - add created_by',
        'test' => 'describe ezin_authors created_by',
        'method' => 'one',
        'correct_answer' => 'created_by',
        'repair' => 'alter table ezin_authors add column created_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors - add created_dt',
        'test' => 'describe ezin_authors created_dt',
        'method' => 'one',
        'correct_answer' => 'created_dt',
        'repair' => 'alter table ezin_authors add column created_dt datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors - add changed_id',
        'test' => 'describe ezin_authors changed_id',
        'method' => 'one',
        'correct_answer' => 'changed_id',
        'repair' => 'alter table ezin_authors add column changed_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors - add changed_by',
        'test' => 'describe ezin_authors changed_by',
        'method' => 'one',
        'correct_answer' => 'changed_by',
        'repair' => 'alter table ezin_authors add column changed_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors - add changed_dt',
        'test' => 'describe ezin_authors changed_dt',
        'method' => 'one',
        'correct_answer' => 'changed_dt',
        'repair' => 'alter table ezin_authors add column changed_dt datetime'
    );

    // credentials - ezin_sections
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_sections - add created_id',
        'test' => 'describe ezin_sections created_id',
        'method' => 'one',
        'correct_answer' => 'created_id',
        'repair' => 'alter table ezin_sections add column created_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_sections - add created_by',
        'test' => 'describe ezin_sections created_by',
        'method' => 'one',
        'correct_answer' => 'created_by',
        'repair' => 'alter table ezin_sections add column created_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_sections - add created_dt',
        'test' => 'describe ezin_sections created_dt',
        'method' => 'one',
        'correct_answer' => 'created_dt',
        'repair' => 'alter table ezin_sections add column created_dt datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_sections - add changed_id',
        'test' => 'describe ezin_sections changed_id',
        'method' => 'one',
        'correct_answer' => 'changed_id',
        'repair' => 'alter table ezin_sections add column changed_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_sections - add changed_by',
        'test' => 'describe ezin_sections changed_by',
        'method' => 'one',
        'correct_answer' => 'changed_by',
        'repair' => 'alter table ezin_sections add column changed_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_sections - add changed_dt',
        'test' => 'describe ezin_sections changed_dt',
        'method' => 'one',
        'correct_answer' => 'changed_dt',
        'repair' => 'alter table ezin_sections add column changed_dt datetime'
    );
    
    // credentials - ezin_editorials
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_editorials - add created_id',
        'test' => 'describe ezin_editorials created_id',
        'method' => 'one',
        'correct_answer' => 'created_id',
        'repair' => 'alter table ezin_editorials add column created_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_editorials - add created_by',
        'test' => 'describe ezin_editorials created_by',
        'method' => 'one',
        'correct_answer' => 'created_by',
        'repair' => 'alter table ezin_editorials add column created_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_editorials - add created_dt',
        'test' => 'describe ezin_editorials created_dt',
        'method' => 'one',
        'correct_answer' => 'created_dt',
        'repair' => 'alter table ezin_editorials add column created_dt datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_editorials - add changed_id',
        'test' => 'describe ezin_editorials changed_id',
        'method' => 'one',
        'correct_answer' => 'changed_id',
        'repair' => 'alter table ezin_editorials add column changed_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_editorials - add changed_by',
        'test' => 'describe ezin_editorials changed_by',
        'method' => 'one',
        'correct_answer' => 'changed_by',
        'repair' => 'alter table ezin_editorials add column changed_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_editorials - add changed_dt',
        'test' => 'describe ezin_editorials changed_dt',
        'method' => 'one',
        'correct_answer' => 'changed_dt',
        'repair' => 'alter table ezin_editorials add column changed_dt datetime'
    );

    // credentials - ezin_users
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_users - add created_id',
        'test' => 'describe ezin_users created_id',
        'method' => 'one',
        'correct_answer' => 'created_id',
        'repair' => 'alter table ezin_users add column created_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_users - add created_by',
        'test' => 'describe ezin_users created_by',
        'method' => 'one',
        'correct_answer' => 'created_by',
        'repair' => 'alter table ezin_users add column created_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_users - add created_dt',
        'test' => 'describe ezin_users created_dt',
        'method' => 'one',
        'correct_answer' => 'created_dt',
        'repair' => 'alter table ezin_users add column created_dt datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_users - add changed_id',
        'test' => 'describe ezin_users changed_id',
        'method' => 'one',
        'correct_answer' => 'changed_id',
        'repair' => 'alter table ezin_users add column changed_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_users - add changed_by',
        'test' => 'describe ezin_users changed_by',
        'method' => 'one',
        'correct_answer' => 'changed_by',
        'repair' => 'alter table ezin_users add column changed_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_users - add changed_dt',
        'test' => 'describe ezin_users changed_dt',
        'method' => 'one',
        'correct_answer' => 'changed_dt',
        'repair' => 'alter table ezin_users add column changed_dt datetime'
    );
    
    // credentials - ezin_roles
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_roles - add created_id',
        'test' => 'describe ezin_roles created_id',
        'method' => 'one',
        'correct_answer' => 'created_id',
        'repair' => 'alter table ezin_roles add column created_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_roles - add created_by',
        'test' => 'describe ezin_roles created_by',
        'method' => 'one',
        'correct_answer' => 'created_by',
        'repair' => 'alter table ezin_roles add column created_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_roles - add created_dt',
        'test' => 'describe ezin_roles created_dt',
        'method' => 'one',
        'correct_answer' => 'created_dt',
        'repair' => 'alter table ezin_roles add column created_dt datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_roles - add changed_id',
        'test' => 'describe ezin_roles changed_id',
        'method' => 'one',
        'correct_answer' => 'changed_id',
        'repair' => 'alter table ezin_roles add column changed_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_roles - add changed_by',
        'test' => 'describe ezin_roles changed_by',
        'method' => 'one',
        'correct_answer' => 'changed_by',
        'repair' => 'alter table ezin_roles add column changed_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_roles - add changed_dt',
        'test' => 'describe ezin_roles changed_dt',
        'method' => 'one',
        'correct_answer' => 'changed_dt',
        'repair' => 'alter table ezin_roles add column changed_dt datetime'
    );

    // credentials - ezin_polls
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_polls - add created_id',
        'test' => 'describe ezin_polls created_id',
        'method' => 'one',
        'correct_answer' => 'created_id',
        'repair' => 'alter table ezin_polls add column created_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_polls - add created_by',
        'test' => 'describe ezin_polls created_by',
        'method' => 'one',
        'correct_answer' => 'created_by',
        'repair' => 'alter table ezin_polls add column created_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_polls - add created_dt',
        'test' => 'describe ezin_polls created_dt',
        'method' => 'one',
        'correct_answer' => 'created_dt',
        'repair' => 'alter table ezin_polls add column created_dt datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_polls - add changed_id',
        'test' => 'describe ezin_polls changed_id',
        'method' => 'one',
        'correct_answer' => 'changed_id',
        'repair' => 'alter table ezin_polls add column changed_id int(10)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_polls - add changed_by',
        'test' => 'describe ezin_polls changed_by',
        'method' => 'one',
        'correct_answer' => 'changed_by',
        'repair' => 'alter table ezin_polls add column changed_by varchar(60)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_polls - add changed_dt',
        'test' => 'describe ezin_polls changed_dt',
        'method' => 'one',
        'correct_answer' => 'changed_dt',
        'repair' => 'alter table ezin_polls add column changed_dt datetime'
    );
    
    // ----[ UPDATE 0.9.0 ]----
    $tests[] = array(
        'type' => 'comment',
        'description' => 'Update 0.9.0'
    );

    // Home text for global sections
    // (created for www.amrophever.sk)

    $tests[] = array(
        'type' => 'update',
        'description' => 'Home text for global sections (created for www.amrophever.sk) - ghometext',
        'test' => 'describe ezin_articles ghometext',
        'method' => 'one',
        'correct_answer' => 'ghometext',
        'repair' => 'alter table ezin_articles add ghometext text after atitle'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'Home text for global sections (created for www.amrophever.sk) - ghometext_wordcount',
        'test' => 'describe ezin_articles ghometext_wordcount',
        'method' => 'one',
        'correct_answer' => 'ghometext_wordcount',
        'repair' => 'alter table ezin_articles add ghometext_wordcount int(11) after datetime'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'Home text for global sections (created for www.amrophever.sk) - ghometext_flags',
        'test' => 'describe ezin_articles ghometext_flags',
        'method' => 'one',
        'correct_answer' => 'ghometext_flags',
        'repair' => 'alter table ezin_articles add ghometext_flags varchar(10) after bodytext_wordcount'
    );

    // ezin_authors indexes
    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors indexes - type',
        'test' => 'show keys from ezin_authors where column_name = "type"',
        'method' => 'one',
        'correct_answer' => 'ezin_authors',
        'repair' => 'alter table ezin_authors add key ezin_authors_type (type)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors indexes - access_key',
        'test' => 'show keys from ezin_authors where column_name = "access_key"',
        'method' => 'one',
        'correct_answer' => 'ezin_authors',
        'repair' => 'alter table ezin_authors add key ezin_authors_access_key (access_key)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'ezin_authors indexes - template_key',
        'test' => 'show keys from ezin_authors where column_name = "template_key"',
        'method' => 'one',
        'correct_answer' => 'ezin_authors',
        'repair' => 'alter table ezin_authors add key ezin_authors_template_key (template_key)'
    );

    // IP address fields resize
    $tests[] = array(
        'type' => 'update',
        'description' => 'IP address fields resize - ezin_sessions',
        'test' => 'show columns from ezin_sessions where field = "ip" and type = "varchar(255)"',
        'method' => 'one',
        'correct_answer' => 'ip',
        'repair' => 'alter table ezin_sessions modify ip varchar(255)'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'IP address fields resize - ezin_counts_temp',
        'test' => 'show columns from ezin_counts_temp where field = "ip" and type = "varchar(255)"',
        'method' => 'one',
        'correct_answer' => 'ip',
        'repair' => 'alter table ezin_counts_temp modify ip varchar(255)'
    );

    // New authors fields
    $tests[] = array(
        'type' => 'update',
        'description' => 'New authors fields - location',
        'test' => 'describe ezin_authors location',
        'method' => 'one',
        'correct_answer' => 'location',
        'repair' => 'alter table ezin_authors add location varchar(150) after name'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'New authors fields - position',
        'test' => 'describe ezin_authors position',
        'method' => 'one',
        'correct_answer' => 'position',
        'repair' => 'alter table ezin_authors add position varchar(150) after name'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'New authors fields - email',
        'test' => 'show columns from ezin_authors where field = "email" and type = "varchar(150)"',
        'method' => 'one',
        'correct_answer' => 'email',
        'repair' => 'alter table ezin_authors modify email varchar(150)'
    );

    // Article relation to editorial
    $tests[] = array(
        'type' => 'update',
        'description' => 'Article relation to editorial - column',
        'test' => 'describe ezin_editorials article_id',
        'method' => 'one',
        'correct_answer' => 'article_id',
        'repair' => 'alter table ezin_editorials add article_id int(11) default NULL after section_id'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'Article relation to editorial - key',
        'test' => 'show keys from ezin_editorials where column_name = "article_id"',
        'method' => 'one',
        'correct_answer' => 'ezin_editorials',
        'repair' => 'alter table ezin_editorials add key ezin_editorials_article_id (article_id)'
    );

    // New authors field for bind
    $tests[] = array(
        'type' => 'update',
        'description' => 'New authors field for bind',
        'test' => 'describe ezin_authors bind',
        'method' => 'one',
        'correct_answer' => 'bind',
        'repair' => 'ALTER TABLE `ezin_authors` ADD `bind` INT NULL DEFAULT NULL AFTER `type`'
    );

    // Flag for Calendar
    $tests[] = array(
        'type' => 'update',
        'description' => 'Flag for Calendar',
        'test' => 'describe ezin_articles calendar_flag',
        'method' => 'one',
        'correct_answer' => 'calendar_flag',
        'repair' => 'ALTER TABLE `ezin_articles` ADD `calendar_flag` DATE NULL AFTER `bodytext`'
    );

    // Flag for Featured Articles
    $tests[] = array(
        'type' => 'update',
        'description' => 'Flag for Featured Articles',
        'test' => 'describe ezin_articles featured_articles_flag',
        'method' => 'one',
        'correct_answer' => 'featured_articles_flag',
        'repair' => 'ALTER TABLE `ezin_articles` ADD `featured_articles_flag` DATETIME NULL AFTER `calendar_flag`'
    );

    // New Article status
    $tests[] = array(
        'type' => 'update',
        'description' => 'New Article status',
        'test' => 'describe ezin_articles `display`',
        'method' => 'one',
        'correct_answer' => 'display',
        'repair' => 'ALTER TABLE `ezin_articles` ADD `display` SET("enabled","in_normal","in_global") AFTER `status`'
    );

    // transform value from old type to new
    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 1',
        'repair' => 'UPDATE `ezin_articles` SET `display` = "enabled,in_normal,in_global" WHERE `status` = "showed"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 2',
        'repair' => 'UPDATE `ezin_articles` SET `display` = "enabled,in_normal" WHERE `status` = "partly_showed"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 3',
        'repair' => 'UPDATE `ezin_articles` SET `display` = "enabled" WHERE `status` = "hidden"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 4',
        'repair' => 'UPDATE `ezin_articles` SET `display` = "" WHERE `status` = "disabled"'
    );

    // New Section type
    $tests[] = array(
        'type' => 'update',
        'description' => 'New Section type - type2',
        'test' => 'describe ezin_sections type2',
        'method' => 'one',
        'correct_answer' => 'type2',
        'repair' => 'ALTER TABLE `ezin_sections` ADD `type2` SET("global") AFTER `type`'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'New Section type - display',
        'test' => 'describe ezin_sections `display`',
        'method' => 'one',
        'correct_answer' => 'display',
        'repair' => 'ALTER TABLE `ezin_sections` ADD `display` SET("in_list","articles_enabled","articles_in_normal","articles_in_global") AFTER `type2`'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'New Section type - select',
        'test' => 'describe ezin_sections `select`',
        'method' => 'one',
        'correct_answer' => 'select',
        'repair' => 'ALTER TABLE `ezin_sections` ADD `select` SET("articles","pages","editorials") AFTER `display`'
    );

    // transform value from old type to new
    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 1',
        'repair' => 'UPDATE `ezin_sections` SET `type2` = "global", `display` = "in_list,articles_enabled,articles_in_normal,articles_in_global", `select` = "articles,pages,editorials" WHERE `type` = "global"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 2',
        'repair' => 'UPDATE `ezin_sections` SET `type2` = "", `display` = "in_list,articles_enabled,articles_in_normal,articles_in_global", `select` = "articles,pages,editorials" WHERE `type` = "normal"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 3',
        'repair' => 'UPDATE `ezin_sections` SET `type2` = "", `display` = "articles_enabled,articles_in_normal,articles_in_global", `select` = "articles,pages,editorials" WHERE `type` = "hidden"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 3',
        'repair' => 'UPDATE `ezin_sections` SET `type2` = "", `display` = "articles_enabled,articles_in_normal", `select` = "articles,pages,editorials" WHERE `type` = "hidden2"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 4',
        'repair' => 'UPDATE `ezin_sections` SET `type2` = "", `display` = "articles_enabled", `select` = "articles,pages,editorials" WHERE `type` = "full_hidden"'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'transform value from old type to new - 5',
        'repair' => 'UPDATE `ezin_sections` SET `type2` = "", `display` = "", `select` = "" WHERE `type` = "disabled"'
    );
    
    // ----[ UPDATE 0.9.1 ]----
    $tests[] = array(
        'type' => 'comment',
        'description' => 'Update 0.9.1'
    );

    // Ezin-sources table
    $tests[] = array(
        'type' => 'update',
        'description' => 'Ezin-sources table',
        'test' => 'show tables like "ezin_sources"',
        'method' => 'one',
        'correct_answer' => 'ezin_sources',
        'repair' => 'CREATE TABLE `ezin_sources` (
                    `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
                    `source_type` ENUM( "rss" ) NOT NULL ,
                    `section_id` INT NOT NULL ,
                    `url` VARCHAR( 255 ) NOT NULL ,
                    `normal_refresh_time` INT NOT NULL,
                    `fail_refresh_time` INT NOT NULL,
                    `connection_timeout` INT NOT NULL,
                    `created_id` int(10) default NULL,
                    `created_by` varchar(60) default NULL,
                    `created_dt` datetime default NULL,
                    `changed_id` int(10) default NULL,
                    `changed_by` varchar(60) default NULL,
                    `changed_dt` datetime default NULL
                    )'
    );

    // Ezin-boxes table
    $tests[] = array(
        'type' => 'update',
        'description' => 'Ezin-boxes table',
        'test' => 'show tables like "ezin_boxes"',
        'method' => 'one',
        'correct_answer' => 'ezin_boxes',
        'repair' => 'CREATE TABLE `ezin_boxes` (
                    `id` int(11) NOT NULL auto_increment,
                    `theme` varchar(255) NOT NULL,
                    `name` varchar(255) NOT NULL,
                    `template_key` varchar(64) default NULL,
                    `bodytext` text,
                    `created_id` int(10) default NULL,
                    `created_by` varchar(60) default NULL,
                    `created_dt` datetime default NULL,
                    `changed_id` int(10) default NULL,
                    `changed_by` varchar(60) default NULL,
                    `changed_dt` datetime default NULL,
                    PRIMARY KEY  (`id`),
                    UNIQUE KEY `theme` (`theme`,`name`)
                    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;'
    );
    
    // Access key redirects table
    $tests[] = array(
        'type' => 'update',
        'description' => 'Ezin-redirects table for old access_key',
        'test' => 'show tables like "ezin_redirects"',
        'method' => 'one',
        'correct_answer' => 'ezin_redirects',
        'repair' => 'CREATE TABLE `ezin_redirects` (
                    `old_key` VARCHAR( 64 ) NOT NULL ,
                    `type` ENUM( "article", "section", "author", "print" ) NOT NULL ,
                    `id` INT NOT NULL ,
                    PRIMARY KEY ( `old_key`,`type` )
                    ) ENGINE = InnoDB  DEFAULT CHARSET=utf8;'
    );

    // Added phone into newsletter
    $tests[] = array(
        'type' => 'update',
        'description' => 'Added phone into newsletter',
        'test' => 'describe ezin_nl_emails phone',
        'method' => 'one',
        'correct_answer' => 'phone',
        'repair' => 'ALTER TABLE `ezin_nl_emails` ADD `phone` VARCHAR(64) AFTER `email`'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Remove index ezin_nl_emails_email and add ezin_nl_emails_emailphone',
        'repair' => 'ALTER TABLE `ezin_nl_emails` DROP INDEX `ezin_nl_emails_email`,
                    ADD UNIQUE `ezin_nl_emails_emailphone` ( `email` , `phone` )'
    );

    // ---- CONFIG - DESCRIPTION ----
    $tests[] = array(
        'type' => 'comment',
        'description' => 'CONFIG - description'
    );

    // Author flags
    $tests[] = array(
        'type' => 'update',
        'description' => 'Author flags - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "flags_author"',
        'method' => 'one',
        'correct_answer' => 'flags_author',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("flags_author")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Author flags - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 290,
                        name = "Author flags",
                        description =
                        "This options specifies how to wrap author description texts. There are two
                        different approaches possible. They can be used both or none at the one time.
                        The first one will wrap line on every line break, the second will create new
                        paragraph when empty line occurs in text.<p>Second part deal with links substitution in
                        parsed text."
                        WHERE a_key = "flags_author"'
    );

    // Antispam protection
    $tests[] = array(
        'type' => 'update',
        'description' => 'Antispam protection - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "antispam_flags"',
        'method' => 'one',
        'correct_answer' => 'antispam_flags',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("antispam_flags")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Antispam protection - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 240,
                        name = "Antispam protection",
                        description =
                        "Where should be antispam protection applied."
                        WHERE a_key = "antispam_flags"'
    );

    // Antispam protection
    $tests[] = array(
        'type' => 'update',
        'description' => 'Antispam question - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "antispam_question"',
        'method' => 'one',
        'correct_answer' => 'antispam_question',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("antispam_question")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Antispam question - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 245,
                        name = "Antispam question",
                        description =
                        "To prevent nasty people before spamming your e-zin, you can optionally provide
                        some simple antispam question, which is answerable only by humans. Robots will
                        not be able to submit the feedback or discussion message."
                        WHERE a_key = "antispam_question"'
    );

    // Antispam answer
    $tests[] = array(
        'type' => 'update',
        'description' => 'Antispam answer - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "antispam_answer"',
        'method' => 'one',
        'correct_answer' => 'antispam_answer',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("antispam_answer");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Antispam answer - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 246,
                        name = "Antispam answer",
                        description =
                        "To prevent nasty people before spamming your e-zin, you can optionally provide
                        some answer to simple antispam question, which is answerable only by humans.
                        User input will be compared with antispam answer. If they do not match,
                        feedback or discussion message will be ignored."
                        WHERE a_key = "antispam_answer"'
    );

    // E-zin description
    $tests[] = array(
        'type' => 'update',
        'description' => 'E-zin description - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "description"',
        'method' => 'one',
        'correct_answer' => 'description',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("description");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'E-zin description - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 115,
                        name = "E-zin description",
                        description =
                        "Your e-zin description. Put here one or two sentences or slogan of your
                        company or organization."
                        WHERE a_key = "description"'
    );

    // New user e-mail
    $tests[] = array(
        'type' => 'update',
        'description' => 'New user e-mail - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "user_create_email"',
        'method' => 'one',
        'correct_answer' => 'user_create_email',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("user_create_email")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'New user e-mail - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 209,
                        name = "New user e-mail",
                        description =
                        "E-mail address where to sent information message when new user create an
                        account.  You can specify more than one e-mail address. Separate items with
                        space."
                        WHERE a_key = "user_create_email"'
    );

    // New user role
    $tests[] = array(
        'type' => 'update',
        'description' => 'New user role - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "user_create_role_id"',
        'method' => 'one',
        'correct_answer' => 'user_create_role_id',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("user_create_role_id");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'New user role - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 208,
                        name = "New user role",
                        description =
                        "Role of new user.This role should be defined in roles table.
                        Select \"no role\" to forbid creation of new user account."
                        WHERE a_key = "user_create_role_id"'
    );

    // Type of gallery
    $tests[] = array(
        'type' => 'update',
        'description' => 'Type of gallery - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "gallery_type"',
        'method' => 'one',
        'correct_answer' => 'gallery_type',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("gallery_type");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Type of gallery - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 175,
                        name = "Type of gallery",
                        description =
                        "Selected type of gallery."
                        WHERE a_key = "gallery_type"'
    );

    // Calendar
    $tests[] = array(
        'type' => 'update',
        'description' => 'Calendar - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "calendar"',
        'method' => 'one',
        'correct_answer' => 'calendar',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("calendar");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Calendar - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 177,
                        name = "Calendar",
                        description =
                        "This input option access the events calendar for Articles."
                        WHERE a_key = "calendar"'
    );

    // Featured articles
    $tests[] = array(
        'type' => 'update',
        'description' => 'Featured articles - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "featured_articles"',
        'method' => 'one',
        'correct_answer' => 'featured_articles',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("featured_articles")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Featured articles - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 178,
                        name = "Featured articles",
                        description =
                        "Separate highlight featured articles."
                        WHERE a_key = "featured_articles"'
    );

    // Featured articles limit
    $tests[] = array(
        'type' => 'update',
        'description' => 'Featured articles limit - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "featured_articles_limit"',
        'method' => 'one',
        'correct_answer' => 'featured_articles_limit',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("featured_articles_limit")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Featured articles limit - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 179,
                        name = "Featured articles limit",
                        description =
                        "Set the limit to see featured articles."
                        WHERE a_key = "featured_articles_limit"'
    );

    // Calendar popup display
    $tests[] = array(
        'type' => 'update',
        'description' => 'Calendar popup display - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "calendar_popup_display"',
        'method' => 'one',
        'correct_answer' => 'calendar_popup_display',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("calendar_popup_display")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Calendar popup display - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 176,
                        name = "Calendar popup display",
                        description =
                        "Place where appears popup window from day cell"
                        WHERE a_key = "calendar_popup_display"'
    );
    
    // Enabled SOAP server
    $tests[] = array(
        'type' => 'update',
        'description' => 'SOAP server',
        'test' => 'select a_key from ezin_config_info where a_key = "soap_server_enabled"',
        'method' => 'one',
        'correct_answer' => 'soap_server_enabled',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("soap_server_enabled")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Access SOAP server - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 190,
                        name = "SOAP server",
                        description =
                        "Access SOAP server"
                        WHERE a_key = "soap_server_enabled"'
    );

    $tests[] = array(
        'type' => 'update',
        'description' => 'Link redirect',
        'test' => 'select a_key from ezin_config_info where a_key = "link_redirect"',
        'method' => 'one',
        'correct_answer' => 'link_redirect',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("link_redirect")'
    );
    
    $tests[] = array(
        'type' => 'repair',
        'description' => 'Link redirect - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 515,
                        name = "Link redirect",
                        description =
                        "Other types of links redirect to a selected type"
                        WHERE a_key = "link_redirect"'
    );
    
    // Type of antispam
    $tests[] = array(
        'type' => 'update',
        'description' => 'Type of antispam - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "antispam_type"',
        'method' => 'one',
        'correct_answer' => 'antispam_type',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("antispam_type");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Type of antispam - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 244,
                        name = "Type of antispam",
                        description =
                        "Selected type of antispam."
                        WHERE a_key = "antispam_type"'
    );
    
    // Redirect equal URL
    $tests[] = array(
        'type' => 'update',
        'description' => 'Redirect equal URL - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "redirect_equal_url"',
        'method' => 'one',
        'correct_answer' => 'redirect_equal_url',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("redirect_equal_url");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Redirect equal URL - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 517,
                        name = "Redirect equal URL",
                        description =
                        "Redirect equal type of URL."
                        WHERE a_key = "redirect_equal_url"'
    );

    // HTTPS redirect for ADMIN
    $tests[] = array(
        'type' => 'update',
        'description' => 'HTTPS redirect for ADMIN - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "https_admin"',
        'method' => 'one',
        'correct_answer' => 'https_admin',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("https_admin");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'HTTPS redirect for ADMIN - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 730,
                        name = "HTTPS redirect for ADMIN",
                        description =
                        "HTTPS redirect for ADMIN"
                        WHERE a_key = "https_admin"'
    );

    // Feedback flood timeout
    $tests[] = array(
        'type' => 'update',
        'description' => 'Feedback flood timeout - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "feedback_flood_timeout"',
        'method' => 'one',
        'correct_answer' => 'feedback_flood_timeout',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("feedback_flood_timeout");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Feedback flood timeout - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 235,
                        name = "Feedback flood timeout",
                        description =
                        "Set the amount of time in seconds used by flood check
                        to prevent feedback post flooding. Your specified time
                        is minimum required time to wait for ability to post
                        next message from one IP address. Recommended value is
                        30. Enter the number of seconds only. Set it to 0 to not
                        have flood protection."
                        WHERE a_key = "feedback_flood_timeout"'
    );

    // Language by HTTP hosts
    $tests[] = array(
        'type' => 'update',
        'description' => 'Language by HTTP hosts - a_key',
        'test' => 'select a_key from ezin_config_info where a_key = "http_host_language"',
        'method' => 'one',
        'correct_answer' => 'http_host_language',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("http_host_language");'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'HTTP hosts by language - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 153,
                        name = "Language by HTTP hosts",
                        description =
                        "This option defines HTTP hosts, whereby will be set
                        language. For each language separate in brackets HTTP
                        host names with space character and write them in lower
                        case. Identificator of language write before each
                        brackets."
                        WHERE a_key = "http_host_language"'
    );

    // Enabled Platon Newsletter Source
    $tests[] = array(
        'type' => 'update',
        'description' => 'Enabled Platon Newsletter Source',
        'test' => 'select a_key from ezin_config_info where a_key = "platon_newsletter_enabled"',
        'method' => 'one',
        'correct_answer' => 'platon_newsletter_enabled',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("platon_newsletter_enabled")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Enabled Platon Newsletter Source - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 195,
                        name = "Platon Newsletter Source",
                        description =
                        "Access Platon Newsletter source extension"
                        WHERE a_key = "platon_newsletter_enabled"'
    );
    
    // Password for Platon Newsletter Source
    $tests[] = array(
        'type' => 'update',
        'description' => 'Password for Platon Newsletter Source',
        'test' => 'select a_key from ezin_config_info where a_key = "platon_newsletter_password"',
        'method' => 'one',
        'correct_answer' => 'platon_newsletter_password',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("platon_newsletter_password")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Password for Platon Newsletter - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 196,
                        name = "Password for Platon Newsletter",
                        description =
                        "Password for Platon Newsletter source extension"
                        WHERE a_key = "platon_newsletter_password"'
    );

    // Enabled Article Datetime Filter
    $tests[] = array(
        'type' => 'update',
        'description' => 'Article Datetime Filter',
        'test' => 'select a_key from ezin_config_info where a_key = "article_datetime_filter"',
        'method' => 'one',
        'correct_answer' => 'article_datetime_filter',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("article_datetime_filter")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Article Datetime Filter - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 420,
                        name = "Article datetime filter",
                        description =
                        "Showing only articles with datetime older as actual time."
                        WHERE a_key = "article_datetime_filter"'
    );

    // Enabled Loadmore for article items
    $tests[] = array(
        'type' => 'update',
        'description' => 'Article items Loadmore',
        'test' => 'select a_key from ezin_config_info where a_key = "article_items_loadmore"',
        'method' => 'one',
        'correct_answer' => 'article_items_loadmore',
        'repair' => 'INSERT INTO ezin_config_info (a_key) VALUES ("article_items_loadmore")'
    );

    $tests[] = array(
        'type' => 'repair',
        'description' => 'Article items Loadmore - ezin_config_info',
        'repair' => 'UPDATE ezin_config_info SET
                        ord = 430,
                        name = "Article items Loadmore",
                        description =
                        "Added Javascript code for Loadmore after article items."
                        WHERE a_key = "article_items_loadmore"'
    );

    // ---- CONFIG - DATA ----
    $tests[] = array(
        'type' => 'comment',
        'description' => 'CONFIG - data'
    );

    // Author flags
    $tests[] = array(
        'type' => 'update',
        'description' => 'Author flags - default value',
        'test' => 'select a_key from ezin_config where a_key = "flags_author"',
        'method' => 'one',
        'correct_answer' => 'flags_author',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("flags_author", "P")'
    );

    // Antispam protection
    $tests[] = array(
        'type' => 'update',
        'description' => 'Antispam protection - default value',
        'test' => 'select a_key from ezin_config where a_key = "antispam_flags"',
        'method' => 'one',
        'correct_answer' => 'antispam_flags',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("antispam_flags", "");'
    );

    // Antispam question
    $tests[] = array(
        'type' => 'update',
        'description' => 'Antispam question - default value',
        'test' => 'select a_key from ezin_config where a_key = "antispam_question"',
        'method' => 'one',
        'correct_answer' => 'antispam_question',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("antispam_question", "")'
    );

    // Antispam answer
    $tests[] = array(
        'type' => 'update',
        'description' => 'Antispam answer - default value',
        'test' => 'select a_key from ezin_config where a_key = "antispam_answer"',
        'method' => 'one',
        'correct_answer' => 'antispam_answer',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("antispam_answer", "")'
    );

    // E-zin description
    $tests[] = array(
        'type' => 'update',
        'description' => 'E-zin description - default value',
        'test' => 'select a_key from ezin_config where a_key = "description"',
        'method' => 'one',
        'correct_answer' => 'description',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("description", "flexible content management system")'
    );

    // New user e-mail
    $tests[] = array(
        'type' => 'update',
        'description' => 'New user e-mail - default value',
        'test' => 'select a_key from ezin_config where a_key = "user_create_email"',
        'method' => 'one',
        'correct_answer' => 'user_create_email',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("user_create_email", "")'
    );

    // New user role
    $tests[] = array(
        'type' => 'update',
        'description' => 'New user role - default value',
        'test' => 'select a_key from ezin_config where a_key = "user_create_role_id"',
        'method' => 'one',
        'correct_answer' => 'user_create_role_id',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("user_create_role_id", 0)'
    );

    // Type of gallery
    $tests[] = array(
        'type' => 'update',
        'description' => 'Type of gallery - default value',
        'test' => 'select a_key from ezin_config where a_key = "gallery_type"',
        'method' => 'one',
        'correct_answer' => 'gallery_type',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("gallery_type", "default")'
    );

    // Calendar
    $tests[] = array(
        'type' => 'update',
        'description' => 'Calendar  - default value',
        'test' => 'select a_key from ezin_config where a_key = "calendar"',
        'method' => 'one',
        'correct_answer' => 'calendar',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("calendar", "0")'
    );

    // Featured articles
    $tests[] = array(
        'type' => 'update',
        'description' => 'Featured articles  - default value',
        'test' => 'select a_key from ezin_config where a_key = "featured_articles"',
        'method' => 'one',
        'correct_answer' => 'featured_articles',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("featured_articles", "0")'
    );

    // Featured articles limit
    $tests[] = array(
        'type' => 'update',
        'description' => 'Featured articles limit  - default value',
        'test' => 'select a_key from ezin_config where a_key = "featured_articles_limit"',
        'method' => 'one',
        'correct_answer' => 'featured_articles_limit',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("featured_articles_limit", "4")'
    );

    // Calendar popup display
    $tests[] = array(
        'type' => 'update',
        'description' => 'Calendar popup display   - default value',
        'test' => 'select a_key from ezin_config where a_key = "calendar_popup_display"',
        'method' => 'one',
        'correct_answer' => 'calendar_popup_display',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("calendar_popup_display", "right")'
    );
    
    // SOAP server
    $tests[] = array(
        'type' => 'update',
        'description' => 'Access SOAP server - default value',
        'test' => 'select a_key from ezin_config where a_key = "soap_server_enabled"',
        'method' => 'one',
        'correct_answer' => 'soap_server_enabled',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("soap_server_enabled", "0")'
    );

    // Link redirect
    $tests[] = array(
        'type' => 'update',
        'description' => 'Link redirect - default value',
        'test' => 'select a_key from ezin_config where a_key = "link_redirect"',
        'method' => 'one',
        'correct_answer' => 'link_redirect',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("link_redirect", "0")'
    );

     // Type of antispam
    $tests[] = array(
        'type' => 'update',
        'description' => 'Type of antispam - default value',
        'test' => 'select a_key from ezin_config where a_key = "antispam_type"',
        'method' => 'one',
        'correct_answer' => 'antispam_type',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("antispam_type", "default")'
    );
    
    // Redirect equal URL
    $tests[] = array(
        'type' => 'update',
        'description' => 'Redirect equal URL - default value',
        'test' => 'select a_key from ezin_config where a_key = "redirect_equal_url"',
        'method' => 'one',
        'correct_answer' => 'redirect_equal_url',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("redirect_equal_url", "0")'
    );
    
    // HTTPS redirect for ADMIN
    $tests[] = array(
        'type' => 'update',
        'description' => 'HTTPS redirect for ADMIN - default value',
        'test' => 'select a_key from ezin_config where a_key = "https_admin"',
        'method' => 'one',
        'correct_answer' => 'https_admin',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("https_admin", "1")'
    );

    // Feedback flood timeout
    $tests[] = array(
        'type' => 'update',
        'description' => 'Feedback flood timeout - default value',
        'test' => 'select a_key from ezin_config where a_key = "feedback_flood_timeout"',
        'method' => 'one',
        'correct_answer' => 'feedback_flood_timeout',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("feedback_flood_timeout", "30")'
    );

    // Language by HTTP hosts
    $tests[] = array(
        'type' => 'update',
        'description' => 'Language by HTTP hosts - default value',
        'test' => 'select a_key from ezin_config where a_key = "http_host_language"',
        'method' => 'one',
        'correct_answer' => 'http_host_language',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("http_host_language", "")'
    );

    // Platon Newsletter Source
    $tests[] = array(
        'type' => 'update',
        'description' => 'Access Platon Newsletter Source - default value',
        'test' => 'select a_key from ezin_config where a_key = "platon_newsletter_enabled"',
        'method' => 'one',
        'correct_answer' => 'platon_newsletter_enabled',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("platon_newsletter_enabled", "0")'
    );
    
    // Password for Platon Newsletter Source
    $tests[] = array(
        'type' => 'update',
        'description' => 'Password for Platon Newsletter - default value',
        'test' => 'select a_key from ezin_config where a_key = "platon_newsletter_password"',
        'method' => 'one',
        'correct_answer' => 'platon_newsletter_password',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("platon_newsletter_password", "")'
    );

    // Article Datetime Filter
    $tests[] = array(
        'type' => 'update',
        'description' => 'Article Datetime Filter - default value',
        'test' => 'select a_key from ezin_config where a_key = "article_datetime_filter"',
        'method' => 'one',
        'correct_answer' => 'article_datetime_filter',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("article_datetime_filter", "1")'
    );

    // Enabled Loadmore for article items
    $tests[] = array(
        'type' => 'update',
        'description' => 'Article items Loadmore - default value',
        'test' => 'select a_key from ezin_config where a_key = "article_items_loadmore"',
        'method' => 'one',
        'correct_answer' => 'article_items_loadmore',
        'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("article_items_loadmore", "1")'
    );


    // ====[ Koniec definovania jednotlivych update ]===============================

    if (!isset($_POST['action'])) {

        echo '

            <style type="text/css">
            .description {
                display: inline;
            }
            .box {
                display: block;
            }
            .box2 {
                border: 1px green solid;
                padding: 5px;
                margin-bottom: 10px;
                margin-left: 10px;
                background-color: #EEFFEE;
            }
            tr.pme-row-definition {
                display: none;
            }
            .correct {
                color: green;
            }
            .incorrect {
                color: red;
            }
            </style>

        <script type="text/javascript">
            function showhide(id) {
                var obj = document.getElementById(id);
                if (obj == null) {
                    return;
                }
                if (obj.style.display == "none" || obj.style.display.length == 0) {
                    obj.style.display = "table-row";
                } else {
                    obj.style.display = "none";
                }
            }
            
            function showhide_table(id) {
                var obj = document.getElementById(id);
                if (obj == null) {
                    return;
                }
                if (obj.style.display == "none" || obj.style.display.length == 0) {
                    obj.style.display = "block";
                } else {
                    obj.style.display = "none";
                }
            }

            function stock(where_execute) {
                this.content="";
                this.execute=where_execute;

                function setContent(data) {
                    this.content=data;
                    this.execute(data);
                }
                this.setContent=setContent;
            }


            function callService(url,post,stock) {
                var XMLHttpRequestObjekt = false;

                if (window.XMLHttpRequest) {
                    XMLHttpRequestObjekt = new XMLHttpRequest();
                } else if (window.ActiveXObject) {
                    XMLHttpRequestObjekt = new ActiveXObject("Microsoft.XMLHTTP");
                }

                if(XMLHttpRequestObjekt) {
                    XMLHttpRequestObjekt.open("POST",url, true);

                    XMLHttpRequestObjekt.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                    XMLHttpRequestObjekt.onreadystatechange = function() {
                        if (XMLHttpRequestObjekt.readyState == 4 && XMLHttpRequestObjekt.status == 200) {
                            var content=XMLHttpRequestObjekt.responseText;
                            stock.setContent(content);
                        }
                    }
                    XMLHttpRequestObjekt.send(post);
                }
            }

            function button_disable(id, value) {
                document.getElementById(id).value = value;
                document.getElementById(id).disabled = true;
            }
            
            function button_enable(id, value) {
                document.getElementById(id).value = value;
                document.getElementById(id).disabled = false;
            }
            
        </script>

        ';
        
        $row_ident = 0;
        function get_row_id() {
            global $row_ident;
            $row_ident = ($row_ident == 1) ? 0 : 1;
            return $row_ident;
        }

        function comment($data) {
            end_table();
            echo '
                <h2 class="pme-comment"><a href="#" onclick="showhide_table(\'table_'.$data['id'].'\');">'.$data['description'].'</a></h2>
            ';
            begin_table($data['id'], false);
        }

        function unidentified($data) {
            echo '<b>Chyba spracovania:</b> ';
            print_r($data);
        }

        function update($data) {
            global $rest;
            global $protocol;
            $row_id = get_row_id();
            echo '
            <tr class="pme-row-'.$row_id.'">
                <td class="pme-test-'.$row_id.'" align="center">
                    <input type="button" value="Test" onclick="test_'.$data['id'].'();">
                </td>';
            if ($rest <= 0) {
                echo '
                    <td class="pme-update-'.$row_id.'" align="center">
                        <input type="button" value="Update" onclick="update_'.$data['id'].'();">
                    </td>';
            }
            echo '
                <td class="pme-definition-'.$row_id.'" align="center">
                    <input type="button" value="Definition" onclick="showhide(\'definition_'.$data['id'].'\');">
                </td>
                <td class="pme-tested-'.$row_id.'" align="center">
                    <span id="test_'.$data['id'].'">untested</span>
                </td>';
            if ($rest <= 0) {
                echo '
                    <td class="pme-updated-'.$row_id.'" align="center">
                        <span id="update_'.$data['id'].'">not updated</span>
                    </td>';
            }
            echo '
                <td class="pme-description-'.$row_id.'">
                    <div class="description">'.$data['description'].'</div>
                </td>
            </tr>
            <tr class="pme-row-definition" id="definition_'.$data['id'].'">
                <td colspan="6" class="pme-definition-'.$row_id.'">
                    <div class="box2">
                        test: '.$data['test'].'<br>
                        method: '.$data['method'].'<br>
                        correct_answer: '.$data['correct_answer'].'<br>
                        update: <b>'.$data['repair'].'</b><br>
                    </div>
                    <script type="text/javascript">

                        // objekt ktory caka na prijatie
                        var exe_test_'.$data['id'].' = new stock(execute_test_'.$data['id'].');
                        var test_end_'.$data['id'].' = false;

                        function test_'.$data['id'].'()
                        {
                            document.getElementById("test_'.$data['id'].'").innerHTML = "...";
                            var data = "action=test&id='.$data['id'].'";
                            callService("'.$protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_test_'.$data['id'].');
                        }

                        function execute_test_'.$data['id'].'(data)
                        {
                            // prijate data
                            //alert(data);
                            document.getElementById("test_'.$data['id'].'").innerHTML = data;
                            test_end_'.$data['id'].' = true;
                        }
            ';
            if ($rest <= 0) {
                echo '
                            // objekt ktory caka na prijatie
                            var exe_update_'.$data['id'].' = new stock(execute_update_'.$data['id'].');
                            var update_end_'.$data['id'].' = false;

                            function update_'.$data['id'].'()
                            {
                                document.getElementById("update_'.$data['id'].'").innerHTML = "...";
                                var data = "action=update&id='.$data['id'].'";
                                callService("'.$protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_update_'.$data['id'].');
                            }

                            function execute_update_'.$data['id'].'(data)
                            {
                                // prijate data
                                //alert(data);
                                document.getElementById("update_'.$data['id'].'").innerHTML = data;
                                update_end_'.$data['id'].' = true;
                            }
                ';
            }
            echo '
                    </script>
                </td>
            </tr>

                ';
        }

        function repair($data) {
            global $rest;
            global $protocol;
            $row_id = get_row_id();
            echo '
            <tr class="pme-row-'.$row_id.'">
                <td class="pme-test-'.$row_id.'" align="center">
                </td>';
            if ($rest <= 0) {
                echo '
                    <td class="pme-update-'.$row_id.'" align="center">
                        <input type="button" value="Update" onclick="update_'.$data['id'].'();">
                    </td>';
            }
            echo '
                <td class="pme-definition-'.$row_id.'" align="center">
                    <input type="button" value="Definition" onclick="showhide(\'definition_'.$data['id'].'\');">
                </td>
                <td class="pme-tested-'.$row_id.'" align="center">
                </td>';
            if ($rest <= 0) {
                echo '
                    <td class="pme-updated" id="update_'.$data['id'].'" align="center">
                        not updated
                    </td>';
            }
            echo '
                <td class="pme-description-'.$row_id.'">
                    '.$data['description'].'
                </td>
            </tr>
            <tr class="pme-row-definition" id="definition_'.$data['id'].'">
                <td colspan="6">
                    <div class="box2">
                        update: <b>'.$data['repair'].'</b><br>
                    </div>

                    <script type="text/javascript">

                        // objekt ktory caka na prijatie
                        var exe_update_'.$data['id'].' = new stock(execute_update_'.$data['id'].');
                        var update_end_'.$data['id'].' = false;

                        function update_'.$data['id'].'()
                        {
                            document.getElementById("update_'.$data['id'].'").innerHTML = "...";
                            var data = "action=update&id='.$data['id'].'";
                            callService("'.$protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_update_'.$data['id'].');
                        }

                        function execute_update_'.$data['id'].'(data)
                        {
                            // prijate data
                            //alert(data);
                            document.getElementById("update_'.$data['id'].'").innerHTML = data;
                            update_end_'.$data['id'].' = true;
                        }

                    </script>
                </td>
            </tr>
                ';
        }

        $exists_table = 0;
        global $last_point; $last_point = 1;
        global $test_counter; $test_counter = 0;
        

        function begin_table($table_id = null, $display = true) {
            global $exists_table;
            global $rest;
            $insert_id = (is_null($table_id)) ? '' : ' id="table_'.intval($table_id).'"';
            $insert_display = $display ? '' : ' style="display: none;"';

            echo '
            <table border="1" class="pme-main" rules="all"'.$insert_id .$insert_display.'>
            <tbody>
                <tr class="pme-header">
                    <th class="pme-header" width="8%">Test</td>';
            if ($rest <= 0) {
                echo '
                    <th class="pme-header" width="8%">Update</td>';
            }
            echo '
                    <th class="pme-header" width="8%">Definition</td>
                    <th class="pme-header" width="8%">Tested</td>';
            if ($rest <= 0) {
                echo '
                    <th class="pme-header" width="16%">Updated</td>';
            }
            echo '
                    <th class="pme-header">Description</td>
                </tr>
            ';
            $exists_table++;
        }
        
        function end_table() {
            global $exists_table;
            global $test_counter;
            global $last_point;
            global $tests;
            global $rest;
            if ($exists_table > 0) {
                $exists_table--;
                if ($test_counter >= $last_point) {
                    echo '
                    <tr class="pme-all-buttons">
                        <td align="center">
                            <input     type="button"
                                    value="All tests"
                                    id="button_test_'.$last_point.'_'.$test_counter.'"
                                    onclick="all_tests_'.$last_point.'_'.$test_counter.'();">
                            <script type="text/javascript">

                    ';
                    $last_test_id = null;
                    for ($b = $last_point; $b <= $test_counter; $b++) {
                        if ($tests[$b-1]['type'] == 'update') {
                            if (!is_null($last_test_id)) {
                                echo '
                                    function start_test_'.$tests[$b-1]['id'].'() {
                                        if (!test_end_'.$last_test_id.') {
                                            setTimeout("start_test_'.$tests[$b-1]['id'].'()", 100);
                                        } else {
                                            test_'.$tests[$b-1]['id'].'();
                                        }
                                    }
                                    ';
                            }
                            $last_test_id = $tests[$b-1]['id'];
                        }
                    }
                    echo '
                            
                                function all_tests_'.$last_point.'_'.$test_counter.'() {
                                    button_disable("button_test_'.$last_point.'_'.$test_counter.'", "Tests running...");
                    ';
                    $first_test = false;
                    for ($b = $last_point; $b <= $test_counter; $b++) {
                        if ($tests[$b-1]['type'] == 'update') {
                            if (!$first_test) {
                                echo '
                                    test_end_'.$tests[$b-1]['id'].' = false;
                                    test_'.$tests[$b-1]['id'].'();
                                ';
                                $first_test = true;
                            } else {
                                echo '
                                    test_end_'.$tests[$b-1]['id'].' = false;
                                    start_test_'.$tests[$b-1]['id'].'();
                                    ';
                            }
                        }
                    }
                    echo '
                                    check_test_'.$tests[$b-1]['id'].'();
                                }
                                function check_test_'.$tests[$b-1]['id'].'() {
                                    if (!test_end_'.$last_test_id.') {
                                        setTimeout("check_test_'.$tests[$b-1]['id'].'()", 100);
                                    } else {
                                        button_enable("button_test_'.$last_point.'_'.$test_counter.'", "All tests");
                                    }
                                }
                            </script>
                        </td>
                    ';
                    if ($rest <= 0) {
                        echo '
                            <td align="center">
                                <input    type="button"
                                        value="All updates"
                                        id="button_update_'.$last_point.'_'.$test_counter.'"
                                        onclick="all_updates_'.$last_point.'_'.$test_counter.'();">
                                <script type="text/javascript">
                                
                        ';
                        $last_update_id = null;
                        for ($b = $last_point; $b <= $test_counter; $b++) {
                            if ($tests[$b-1]['type'] == 'update'
                                || $tests[$b-1]['type'] == 'repair')
                            {
                                if (!is_null($last_update_id)) {
                                    echo '
                                        function start_update_'.$tests[$b-1]['id'].'() {
                                            if (!update_end_'.$last_update_id.') {
                                                setTimeout("start_update_'.$tests[$b-1]['id'].'()", 100);
                                            } else {
                                                update_'.$tests[$b-1]['id'].'();
                                            }
                                        }
                                        ';
                                }
                                $last_update_id = $tests[$b-1]['id'];
                            }
                        }
                        echo '
                                    function all_updates_'.$last_point.'_'.$test_counter.'() {
                                        button_disable("button_update_'.$last_point.'_'.$test_counter.'", "Updates running...");
                        ';
                        $first_update = false;
                        for ($b = $last_point; $b <= $test_counter; $b++) {
                            if ($tests[$b-1]['type'] == 'update'
                                || $tests[$b-1]['type'] == 'repair')
                            {
                                if (!$first_update) {
                                    echo '
                                        update_end_'.$tests[$b-1]['id'].' = false;
                                        update_'.$tests[$b-1]['id'].'();
                                    ';
                                    $first_update = true;
                                } else {
                                    echo '
                                        update_end_'.$tests[$b-1]['id'].' = false;
                                        start_update_'.$tests[$b-1]['id'].'();
                                        ';
                                }
                            }
                        }
                        echo '
                                        check_update_'.$tests[$b-1]['id'].'();
                                    }
                                    function check_update_'.$tests[$b-1]['id'].'() {
                                    if (!update_end_'.$last_test_id.') {
                                        setTimeout("check_update_'.$tests[$b-1]['id'].'()", 100);
                                    } else {
                                        button_enable("button_update_'.$last_point.'_'.$test_counter.'", "All updates");
                                    }
                                }
                                </script>
                            </td>
                        ';
                    }
                    echo '
                        <td colspan="4">
                        </td>
                    </tr>
                    ';
                    $last_point = $test_counter + 1;
                }
                echo '
                </tbody>
                </table>
                ';
            }
        }

        if ($tests[0]['type'] != 'comment') {
            begin_table();
        }
        
        for($a = 0; $a < count($tests); $a++) {
            $tests[$a]['id'] = $a;
            switch($tests[$a]['type']) {
                case 'comment':
                    comment($tests[$a]);
                    break;
                case 'update':
                    update($tests[$a]);
                    break;
                case 'repair':
                    repair($tests[$a]);
                    break;
                default:
                    unidentified($tests[$a]);
            }
            $test_counter++;
        }
        end_table();

    } else {
    // ak je nastanvene $_POST['action']

        global $ezin_sys;
        require_once 'DB.php';
        // pripojenie k databaze
        $dsn = 'mysql://'.$ezin_sys['db']['user'].':'.$ezin_sys['db']['pass'].'@'.$ezin_sys['db']['host'].':'.$ezin_sys['db']['port'].'/'.$ezin_sys['db']['name'];
        $options = array(
                        'debug'=>2,
                        'portability'=>DB_PORTABILITY_ALL
                    );
        $dbh = & DB::Connect($dsn, $options);
        if (PEAR::isError($dbh)) {
            die('<span class="incorrect">'.$dbh->getmessage().'</span>');
        }
        $dbh->setFetchMode(DB_FETCHMODE_ASSOC);
        $dbh->query('SET NAMES UTF8');
        $dbh->query('SET COLLATION_CONNECTION=UTF8_GENERAL_CI');

        ob_clean();
        header ("content-type: text/xml; charset=utf-8");

        $id = intval($_POST['id']);
        $test = $tests[$id];

        if (($test['type'] != 'update')
            && ($test['type'] != 'repair')) {
            echo '<span class="incorrect">Chyba: Nespravny typ update</span>';
            Exit;
        }

        switch ($_POST['action']) {
            case 'test':
                switch ($test['method']) {
                    case 'one':
                        //echo 'query: '.$test['test'];
                        $ret = $dbh->getOne($test['test']);
                        break;
                    case 'col':
                        $ret = $dbh->getCol($test['test']);
                        break;
                    case 'all':
                        $ret = $dbh->getAll($test['test']);
                        break;
                }
                if  (PEAR::isError($ret)) {
                    echo '<span class="incorrect">Chyba: pri aplikovani dopytu testu: '.$ret->getMessage().'</span>';
                    Exit();
                }
                if ($ret == $test['correct_answer']) {
                    echo '<span class="correct">OK</span>';
                } else {
                    echo '<span class="incorrect">MISSING</span>';
                }
                break;
            case 'update':
                $ret = @$dbh->query($test['repair']);
                if (PEAR::isError($ret)) {
                    echo '<span class="incorrect">Chyba: pri pokuse o update</span>';
                    Exit();
                } else {
                    echo '<span class="correct">Update bol aplikovanĂ˝</span>';
                }
                break;
            case 'repair':
                $ret = $dbh->query($test['repair']);
                if (PEAR::isError($ret)) {
                    echo '<span class="incorrect">Chyba: pri pokuse o update</span>';

                } else {
                    echo '<span class="correct">Update bol aplikovanĂ˝</span>';
                }
                break;
            default:
                echo 'Chyba: zla akcia!';
                break;
        }

        Exit();
    }


}

/*
 * Main
 */

if (strstr($ezin_user['role_config'], 'C')) {
    ezin_admin_maintenance_main(0);
} elseif (ezin_admin_check_full_list_privileges($ezin_user['role_config'])) {
    ezin_admin_maintenance_main(1);
} elseif (ezin_admin_check_restricted_list_privileges($ezin_user['role_config'])) {
    ezin_admin_maintenance_main(2);
}



?>

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok