Browse Source

[Web] Minor changes

andryyy 5 years ago
parent
commit
cbe4f4ce70
2 changed files with 20 additions and 1 deletions
  1. 14 1
      data/web/inc/init_db.inc.php
  2. 6 0
      data/web/inc/prerequisites.inc.php

+ 14 - 1
data/web/inc/init_db.inc.php

@@ -3,7 +3,7 @@ function init_db_schema() {
   try {
   try {
     global $pdo;
     global $pdo;
 
 
-    $db_version = "01122019_0755";
+    $db_version = "28012020_0755";
 
 
     $stmt = $pdo->query("SHOW TABLES LIKE 'versions'");
     $stmt = $pdo->query("SHOW TABLES LIKE 'versions'");
     $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC));
     $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC));
@@ -483,6 +483,19 @@ function init_db_schema() {
         ),
         ),
         "attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
         "attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
       ),
       ),
+      "quota2replica" => array(
+        "cols" => array(
+          "username" => "VARCHAR(255) NOT NULL",
+          "bytes" => "BIGINT(20) NOT NULL DEFAULT '0'",
+          "messages" => "BIGINT(20) NOT NULL DEFAULT '0'"
+        ),
+        "keys" => array(
+          "primary" => array(
+            "" => array("username")
+          )
+        ),
+        "attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
+      ),
       "domain_admins" => array(
       "domain_admins" => array(
         "cols" => array(
         "cols" => array(
           "id" => "INT NOT NULL AUTO_INCREMENT",
           "id" => "INT NOT NULL AUTO_INCREMENT",

+ 6 - 0
data/web/inc/prerequisites.inc.php

@@ -1,4 +1,10 @@
 <?php
 <?php
+
+// Slave does not serve UI
+if (!preg_match('/y|yes/i', getenv('MASTER'))) {
+  header('Location: /SOGo', true, 307);
+}
+
 require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/vars.inc.php';
 require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/vars.inc.php';
 $default_autodiscover_config = $autodiscover_config;
 $default_autodiscover_config = $autodiscover_config;