X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/c793d074896f3b22e18d7c3ad45a517f5cebaa1c..2145c6a9abe4bbd432ccdd9ff1bf598e4c461747:/lib/functions.php

diff --git a/lib/functions.php b/lib/functions.php
index 1dd03e5..5c5fea7 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -2,7 +2,7 @@
 /*
  *  Jirafeau, your web file repository
  *  Copyright (C) 2008  Julien "axolotl" BERNARD <axolotl@magieeternelle.org>
- *  Copyright (C) 2015  Jerome Jutteau <j.jutteau@gmail.com>
+ *  Copyright (C) 2015  Jerome Jutteau <jerome@jutteau.fr>
  *  Copyright (C) 2015  Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
  *
  *  This program is free software: you can redistribute it and/or modify
@@ -569,6 +569,14 @@ function check_errors($cfg)
     if (!is_writable(VAR_ASYNC)) {
         add_error(t('ASYNC_DIR_W'), VAR_ASYNC);
     }
+
+    if ($cfg['enable_crypt'] && $cfg['litespeed_workaround']) {
+        add_error(t('INCOMPATIBLE_OPTIONS_W'), 'enable_crypt=true<br>litespeed_workaround=true');
+    }
+
+    if ($cfg['one_time_download'] && $cfg['litespeed_workaround']) {
+        add_error(t('INCOMPATIBLE_OPTIONS_W'), 'one_time_download=true<br>litespeed_workaround=true');
+    }
 }
 
 /**
@@ -1336,3 +1344,12 @@ function jirafeau_admin_csrf_field()
 {
     return "<input type='hidden' name='admin_csrf' value='". $_SESSION['admin_csrf'] . "'/>";
 }
+
+function jirafeau_dir_size($dir)
+{
+    $size = 0;
+    foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $entry) {
+        $size += is_file($entry) ? filesize($entry) : jirafeau_dir_size($entry);
+    }
+    return $size;
+}