]> wagnertech.de Git - timetracker.git/blobdiff - dbinstall.php
Added an environment check for enabled libxml to address issue #67.
[timetracker.git] / dbinstall.php
index 74d566cc7185171f9069cbe2df911e428b23387c..a3cdd9cc58cdd210cd26f6f875e5919f5009935f 100644 (file)
@@ -131,6 +131,11 @@ if ($request->isGet()) {
     }
   }
 
+  // Check is libxml is enabled (which is a PHP default).
+  if (!function_exists('libxml_clear_errors')) {
+    echo('<font color="red">Error: libxml is not enabled. It is required for import group operation (to parse XML).</font><br>');
+  }
+
   // Check database access.
   require_once('MDB2.php');
   $conn = MDB2::connect(DSN);
@@ -1044,6 +1049,8 @@ if ($_POST) {
     ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.34', modified = now() where param_name = 'version_db' and param_value = '1.18.26'");
     ttExecute("update `tt_users` u inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.34') set u.quota_percent = 100.00 where u.quota_percent is null");
     ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.36', modified = now() where param_name = 'version_db' and param_value = '1.18.34'");
+    ttExecute("update `tt_users` u inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.36') set u.quota_percent = 100.00 where u.quota_percent is null");
+    ttExecute("ALTER TABLE `tt_users` modify `quota_percent` float(6,2) NOT NULL default '100.00'");
   }
 
   if ($_POST["cleanup"]) {