Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 17, 2026

Diff for Metafox/admin/inc-db/maintenance.inc.php between version 1.1 and 1.2

version 1.1, 2011/05/24 18:00:31 version 1.2, 2011/06/09 16:37:52
Line 46  function ezin_admin_maintenance_main($re
Line 46  function ezin_admin_maintenance_main($re
   
         global $tests;          global $tests;
         $tests = array();          $tests = array();
           global $protocol;
           $protocol = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
   
         // ====[ Definovanie jednotlivych update ]======================================          // ====[ Definovanie jednotlivych update ]======================================
   
Line 923  function ezin_admin_maintenance_main($re
Line 925  function ezin_admin_maintenance_main($re
                                                 name = "New user role",                                                  name = "New user role",
                                                 description =                                                  description =
                                                 "Role of new user.This role should be defined in roles table.                                                  "Role of new user.This role should be defined in roles table.
                                                 Select "no role" to forbid creation of new user account."                                                  Select \"no role\" to forbid creation of new user account."
                                                 WHERE a_key = "user_create_role_id"'                                                  WHERE a_key = "user_create_role_id"'
         );          );
   
Line 1031  function ezin_admin_maintenance_main($re
Line 1033  function ezin_admin_maintenance_main($re
                                                 "Place where appears popup window from day cell"                                                  "Place where appears popup window from day cell"
                                                 WHERE a_key = "calendar_popup_display"'                                                  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"'
           );
   
         // ---- CONFIG - DATA ----          // ---- CONFIG - DATA ----
         $tests[] = array(          $tests[] = array(
Line 1040  function ezin_admin_maintenance_main($re
Line 1063  function ezin_admin_maintenance_main($re
   
         // Author flags          // Author flags
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Author flags - default value',                  '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")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("flags_author", "P")'
         );          );
   
         // Antispam protection          // Antispam protection
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Antispam protection - default value',                  '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", "");'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("antispam_flags", "");'
         );          );
   
         // Antispam question          // Antispam question
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Antispam question - default value',                  '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", "")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("antispam_question", "")'
         );          );
   
         // Antispam answer          // Antispam answer
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Antispam answer - default value',                  '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", "")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("antispam_answer", "")'
         );          );
   
         // E-zin description          // E-zin description
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'E-zin description - default value',                  '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", "enterprise content management system")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("description", "enterprise content management system")'
         );          );
   
         // New user e-mail          // New user e-mail
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'New user e-mail - default value',                  '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", "")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("user_create_email", "")'
         );          );
   
         // New user role          // New user role
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'New user role - default value',                  '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)'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("user_create_role_id", 0)'
         );          );
   
         // Type of gallery          // Type of gallery
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Type of gallery - default value',                  '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")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("gallery_type", "default")'
         );          );
   
         // Calendar          // Calendar
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Calendar  - default value',                  '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")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("calendar", "0")'
         );          );
   
         // Featured articles          // Featured articles
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Featured articles  - default value',                  '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")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("featured_articles", "0")'
         );          );
   
         // Featured articles limit          // Featured articles limit
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Featured articles limit  - default value',                  '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")'                  'repair' => 'INSERT INTO ezin_config (a_key, value) VALUES ("featured_articles_limit", "4")'
         );          );
   
         // Calendar popup display          // Calendar popup display
         $tests[] = array(          $tests[] = array(
                 'type' => 'repair',                  'type' => 'update',
                 'description' => 'Calendar popup display   - default value',                  '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")'                  '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")'
           );
   
   
         // ====[ Koniec definovania jednotlivych update ]===============================          // ====[ Koniec definovania jednotlivych update ]===============================
Line 1166  function ezin_admin_maintenance_main($re
Line 1235  function ezin_admin_maintenance_main($re
                                         obj.style.display = "none";                                          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) {                          function stock(where_execute) {
                                 this.content="";                                  this.content="";
Line 1216  function ezin_admin_maintenance_main($re
Line 1297  function ezin_admin_maintenance_main($re
                 function comment($data) {                  function comment($data) {
                         end_table();                          end_table();
                         echo '                          echo '
                                 <h2 class="pme-comment">'.$data['description'].'</h2>                                  <h2 class="pme-comment"><a href="#" onclick="showhide_table(\'table_'.$data['id'].'\');">'.$data['description'].'</a></h2>
                         ';                          ';
                         begin_table();                          begin_table($data['id'], false);
                 }                  }
   
                 function unidentified($data) {                  function unidentified($data) {
Line 1228  function ezin_admin_maintenance_main($re
Line 1309  function ezin_admin_maintenance_main($re
   
                 function update($data) {                  function update($data) {
                         global $rest;                          global $rest;
                           global $protocol;
                         $row_id = get_row_id();                          $row_id = get_row_id();
                         echo '                          echo '
                         <tr class="pme-row-'.$row_id.'">                          <tr class="pme-row-'.$row_id.'">
Line 1270  function ezin_admin_maintenance_main($re
Line 1352  function ezin_admin_maintenance_main($re
   
                                                 // objekt ktory caka na prijatie                                                  // objekt ktory caka na prijatie
                                                 var exe_test_'.$data['id'].' = new stock(execute_test_'.$data['id'].');                                                  var exe_test_'.$data['id'].' = new stock(execute_test_'.$data['id'].');
                                                   var test_end_'.$data['id'].' = false;
   
                                                 function test_'.$data['id'].'()                                                  function test_'.$data['id'].'()
                                                 {                                                  {
                                                         document.getElementById("test_'.$data['id'].'").innerHTML = "...";                                                          document.getElementById("test_'.$data['id'].'").innerHTML = "...";
                                                         var data = "action=test&id='.$data['id'].'";                                                          var data = "action=test&id='.$data['id'].'";
                                                         callService("http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_test_'.$data['id'].');                                                          callService("'.$protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_test_'.$data['id'].');
                                                 }                                                  }
   
                                                 function execute_test_'.$data['id'].'(data)                                                  function execute_test_'.$data['id'].'(data)
Line 1283  function ezin_admin_maintenance_main($re
Line 1366  function ezin_admin_maintenance_main($re
                                                         // prijate data                                                          // prijate data
                                                         //alert(data);                                                          //alert(data);
                                                         document.getElementById("test_'.$data['id'].'").innerHTML = data;                                                          document.getElementById("test_'.$data['id'].'").innerHTML = data;
                                                           test_end_'.$data['id'].' = true;
                                                 }                                                  }
                         ';                          ';
                         if ($rest <= 0) {                          if ($rest <= 0) {
                                 echo '                                  echo '
                                                         // objekt ktory caka na prijatie                                                          // objekt ktory caka na prijatie
                                                         var exe_update_'.$data['id'].' = new stock(execute_update_'.$data['id'].');                                                          var exe_update_'.$data['id'].' = new stock(execute_update_'.$data['id'].');
                                                           var update_end_'.$data['id'].' = false;
   
                                                         function update_'.$data['id'].'()                                                          function update_'.$data['id'].'()
                                                         {                                                          {
                                                                 document.getElementById("update_'.$data['id'].'").innerHTML = "...";                                                                  document.getElementById("update_'.$data['id'].'").innerHTML = "...";
                                                                 var data = "action=update&id='.$data['id'].'";                                                                  var data = "action=update&id='.$data['id'].'";
                                                                 callService("http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_update_'.$data['id'].');                                                                  callService("'.$protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_update_'.$data['id'].');
                                                         }                                                          }
   
                                                         function execute_update_'.$data['id'].'(data)                                                          function execute_update_'.$data['id'].'(data)
Line 1302  function ezin_admin_maintenance_main($re
Line 1387  function ezin_admin_maintenance_main($re
                                                                 // prijate data                                                                  // prijate data
                                                                 //alert(data);                                                                  //alert(data);
                                                                 document.getElementById("update_'.$data['id'].'").innerHTML = data;                                                                  document.getElementById("update_'.$data['id'].'").innerHTML = data;
                                                                   update_end_'.$data['id'].' = true;
                                                         }                                                          }
                                 ';                                  ';
                         }                          }
Line 1315  function ezin_admin_maintenance_main($re
Line 1401  function ezin_admin_maintenance_main($re
   
                 function repair($data) {                  function repair($data) {
                         global $rest;                          global $rest;
                           global $protocol;
                         $row_id = get_row_id();                          $row_id = get_row_id();
                         echo '                          echo '
                         <tr class="pme-row-'.$row_id.'">                          <tr class="pme-row-'.$row_id.'">
Line 1353  function ezin_admin_maintenance_main($re
Line 1440  function ezin_admin_maintenance_main($re
   
                                                 // objekt ktory caka na prijatie                                                  // objekt ktory caka na prijatie
                                                 var exe_update_'.$data['id'].' = new stock(execute_update_'.$data['id'].');                                                  var exe_update_'.$data['id'].' = new stock(execute_update_'.$data['id'].');
                                                   var update_end_'.$data['id'].' = false;
   
                                                 function update_'.$data['id'].'()                                                  function update_'.$data['id'].'()
                                                 {                                                  {
                                                         document.getElementById("update_'.$data['id'].'").innerHTML = "...";                                                          document.getElementById("update_'.$data['id'].'").innerHTML = "...";
                                                         var data = "action=update&id='.$data['id'].'";                                                          var data = "action=update&id='.$data['id'].'";
                                                         callService("http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_update_'.$data['id'].');                                                          callService("'.$protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'",data,exe_update_'.$data['id'].');
                                                 }                                                  }
   
                                                 function execute_update_'.$data['id'].'(data)                                                  function execute_update_'.$data['id'].'(data)
Line 1366  function ezin_admin_maintenance_main($re
Line 1454  function ezin_admin_maintenance_main($re
                                                         // prijate data                                                          // prijate data
                                                         //alert(data);                                                          //alert(data);
                                                         document.getElementById("update_'.$data['id'].'").innerHTML = data;                                                          document.getElementById("update_'.$data['id'].'").innerHTML = data;
                                                           update_end_'.$data['id'].' = true;
                                                 }                                                  }
   
                                         </script>                                          </script>
Line 1379  function ezin_admin_maintenance_main($re
Line 1468  function ezin_admin_maintenance_main($re
                 global $test_counter; $test_counter = 0;                  global $test_counter; $test_counter = 0;
   
   
                 function begin_table() {                  function begin_table($table_id = null, $display = true) {
                         global $exists_table;                          global $exists_table;
                         global $rest;                          global $rest;
                           $insert_id = (is_null($table_id)) ? '' : ' id="table_'.intval($table_id).'"';
                           $insert_display = $display ? '' : ' style="display: none;"';
   
                         echo '                          echo '
                         <table border="1" class="pme-main" rules="all">                          <table border="1" class="pme-main" rules="all"'.$insert_id .$insert_display.'>
                         <tbody>                          <tbody>
                                 <tr class="pme-header">                                  <tr class="pme-header">
                                         <th class="pme-header" width="8%">Test</td>';                                          <th class="pme-header" width="8%">Test</td>';
Line 1419  function ezin_admin_maintenance_main($re
Line 1511  function ezin_admin_maintenance_main($re
                                                 <td align="center">                                                  <td align="center">
                                                         <input type="button" value="All tests" onclick="all_tests_'.$last_point.'_'.$test_counter.'();">                                                          <input type="button" value="All tests" onclick="all_tests_'.$last_point.'_'.$test_counter.'();">
                                                         <script type="text/javascript">                                                          <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.'() {                                                                  function all_tests_'.$last_point.'_'.$test_counter.'() {
                                         ';                                          ';
                                           $first_test = false;
                                         for ($b = $last_point; $b <= $test_counter; $b++) {                                          for ($b = $last_point; $b <= $test_counter; $b++) {
                                                 if ($tests[$b-1]['type'] == 'update') {                                                  if ($tests[$b-1]['type'] == 'update') {
                                                         echo '                                                          if (!$first_test) {
                                                                 test_'.$tests[$b-1]['id'].'();';                                                                  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 '                                          echo '
Line 1437  function ezin_admin_maintenance_main($re
Line 1561  function ezin_admin_maintenance_main($re
                                                         <td align="center">                                                          <td align="center">
                                                                 <input type="button" value="All updates" onclick="all_updates_'.$last_point.'_'.$test_counter.'();">                                                                  <input type="button" value="All updates" onclick="all_updates_'.$last_point.'_'.$test_counter.'();">
                                                                 <script type="text/javascript">                                                                  <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.'() {                                                                          function all_updates_'.$last_point.'_'.$test_counter.'() {
                                                 ';                                                  ';
                                                   $first_update = false;
                                                 for ($b = $last_point; $b <= $test_counter; $b++) {                                                  for ($b = $last_point; $b <= $test_counter; $b++) {
                                                         if ($tests[$b-1]['type'] == 'update'                                                          if ($tests[$b-1]['type'] == 'update'
                                                                 || $tests[$b-1]['type'] == 'repair')                                                                  || $tests[$b-1]['type'] == 'repair')
                                                         {                                                          {
                                                                 echo '                                                                  if (!$first_update) {
                                                                         update_'.$tests[$b-1]['id'].'();';                                                                          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 '                                                  echo '
Line 1542  function ezin_admin_maintenance_main($re
Line 1699  function ezin_admin_maintenance_main($re
                                 if ($ret == $test['correct_answer']) {                                  if ($ret == $test['correct_answer']) {
                                         echo '<span class="correct">OK</span>';                                          echo '<span class="correct">OK</span>';
                                 } else {                                  } else {
                                         echo '<span class="incorrect">BAD</span>';                                          echo '<span class="incorrect">MISSING</span>';
                                 }                                  }
                                 break;                                  break;
                         case 'update':                          case 'update':
Line 1586  if (strstr($ezin_user['role_config'], 'C
Line 1743  if (strstr($ezin_user['role_config'], 'C
         ezin_admin_maintenance_main(2);          ezin_admin_maintenance_main(2);
 }  }
   
   
   
 ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top