### I found a bug, what should I do?
Feel free to open a bug in the [GitLab's issues](https://gitlab.com/mojo42/Jirafeau/issues).
+If you can, please copy-paste informations related to bug opening provided in admin interface.
+Admin interface can be reached by accessing `/admin.php`.
### How to set maximum file size?
</td>
</tr>
</form>
+ <form method="post">
+ <tr>
+ <input type = "hidden" name = "action" value = "bug_report_info"/>
+ <?php echo jirafeau_admin_csrf_field() ?>
+ <td class = "info">
+ <?php echo t('REPORTING_AN_ISSUE'); ?>
+ </td>
+ <td></td>
+ <td>
+ <input type = "submit" value = "<?php echo t('INFO'); ?>" />
+ </td>
+ </tr>
+ </form>
</table>
<form method="post">
<input type = "hidden" name = "action" value = "logout" />
fclose($r);
}
exit;
+ } elseif (strcmp($_POST['action'], 'bug_report_info') == 0) {
+ echo jirafeau_admin_bug_report($cfg);
}
}
}
return $count;
}
+
+/**
+ * Better strval function for debug purposes
+ */
+function jirafeau_strval($value)
+{
+ if (gettype($value) == "boolean") {
+ return $value ? 'true' : 'false';
+ }
+ return strval($value);
+}
+
+/**
+ * Show file/folder permissions
+ */
+function jirafeau_fileperms($path)
+{
+ $out = substr(sprintf("%o", @fileperms($path)), -4) . ", ";
+ $out .= "read " . (is_readable($path) ? "OK" : "KO") . ", ";
+ $out .= "write " . (is_writable($path) ? "OK" : "KO");
+ return $out;
+}
+
+/**
+ * Show some useful informations for bug reporting.
+ */
+function jirafeau_admin_bug_report($cfg)
+{
+ $out = "<fieldset><legend>" . t('REPORTING_AN_ISSUE') . "</legend>";
+ $out .= "If you have a problem related to Jirafeau, please <a href='https://gitlab.com/mojo42/Jirafeau/-/issues'>open an issue</a>, explain your problem in english and copy-paste the following content:<br/><br/><code>";
+
+ $out .= "# Jirafeau<br/>";
+ $out .= "- version: " . JIRAFEAU_VERSION . "<br/>";
+ $jirafeau_options = [
+ 'debug',
+ 'file_hash',
+ 'litespeed_workaround',
+ 'store_uploader_ip',
+ 'installation_done',
+ 'enable_crypt',
+ 'preview',
+ 'maximal_upload_size',
+ 'store_uploader_ip'
+ ];
+ foreach ($jirafeau_options as &$o) {
+ $v = $cfg[$o];
+ $out .= "- $o: " . jirafeau_strval($v) . " (" . gettype($v) . ")<br/>";
+ }
+ $out .= "<br/>";
+
+ $out .= "# PHP options<br/>";
+ $out .= "- php version: " . phpversion() . "<br/>";
+ $out .= "- mcrypt version: " . phpversion('mcrypt') . "<br/>";
+ $php_options = [
+ 'post_max_size',
+ 'upload_max_filesize'
+ ];
+ foreach ($php_options as &$o) {
+ $v = ini_get($o);
+ $out .= "- $o: " . jirafeau_strval($v) . " (" . gettype($v). ")<br/>";
+ }
+ $out .= "<br/>";
+
+ $out .= "# File permissions<br/>";
+ $out .= "- 'var' folder permissions: " . jirafeau_fileperms($cfg['var_root']) . "<br/>";
+ $out .= "- 'file' folder permissions: " . jirafeau_fileperms(VAR_FILES) . "<br/>";
+ $out .= "- 'links' folder permissions: " . jirafeau_fileperms(VAR_LINKS) . "<br/>";
+ $out .= "- 'async' folder permissions: " . jirafeau_fileperms(VAR_ASYNC) . "<br/>";
+ $out .= "<br/>";
+
+ $out .= "# Server details<br/>";
+ $out .= "- server software: " . $_SERVER["SERVER_SOFTWARE"] . "<br/>";
+ $out .= "<br/>";
+
+ $out .= "# OS details<br/>";
+ $out .= "- OS: " . php_uname() . "<br/>";
+ $out .= "<br/>";
+
+ $out .= "# Browser details<br/>";
+ $out .= "<script type='text/javascript' lang='Javascript'>
+ // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
+ document.write('- HTML5 support: ' + (check_html5_file_api() ? 'yes' : 'no') + '<br/>');
+ document.write('- User agent: ' + navigator.userAgent + '<br/>');
+ // @license-end
+ </script>";
+ $out .= "</code></fieldset>";
+ return $out;
+}
+
/**
* Read async transfert informations
* @return array containing informations.
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "حجم البيانات",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "قد لا يدعم متصفحك HTML5، لذا فإن الحد الأقصى لحجم الملف هو ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Ваш браўзер не падтрымлівае HTML5, таму максімальны памер файла ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "আপনার ব্রাউজার HTML5 সমর্থন নাও করতে পারে, তাই সর্বোচ্চ ফাইলের আকার ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "El teu navegador no és compatible amb HTML5, per tant, la mida màxima del fitxers és ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Váš prohlížeč nepodporuje HTML5, proto je maximílní velikost souboru ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Datengröße",
"INCOMPATIBLE_OPTIONS_W": "Die folgenden Konfigurationsoptionen sind nicht kompatibel:",
"NO_BROWSER_SUPPORT": "Dein Browser unterstützt möglicherweise kein HTML5, demnach beträgt die maximale Dateigröße ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "Reporting an issue",
"SIZE_DATA": "Data size",
"INCOMPATIBLE_OPTIONS_W": "The following configuration options are incompatible:",
"NO_BROWSER_SUPPORT": "Your browser may not support HTML5, so the maximum file size is ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Tu navegador puede no soportar HTML5, debido a esto el tamaño máximo de archivo es ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "Rapporter un bogue",
"SIZE_DATA": "Volume de données",
"INCOMPATIBLE_OPTIONS_W": "Les options de configuration suivantes sont incompatibles :",
"NO_BROWSER_SUPPORT": "Votre navigateur ne supporte apparemment pas HTML5, la taille maximale de fichier téléchargable est de ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "גודל הנתונים",
"INCOMPATIBLE_OPTIONS_W": "אפשרויות ההגדרה הבאות אינן תואמות:",
"NO_BROWSER_SUPPORT": "יתכן שהדפדפן שלך אינו תומך ב־HTML5, לכן גודל הקובץ המרבי הוא ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Veličina podataka",
"INCOMPATIBLE_OPTIONS_W": "Sljedeće opcije konfiguracije su nekompatibilne:",
"NO_BROWSER_SUPPORT": "Preglednik možda ne podržava HTML5, stoga je maksimalna veličina datoteke ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Dimensione dei dati",
"INCOMPATIBLE_OPTIONS_W": "Le seguenti opzioni di configurazione sono incompatibili:",
"NO_BROWSER_SUPPORT": "Il tuo browser potrebbe non supportare HTML5, quindi la dimensione massima del file è ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Datastørrelse",
"INCOMPATIBLE_OPTIONS_W": "Følgende oppsettsvalg er ikke kompatible:",
"NO_BROWSER_SUPPORT": "Det kan hende at nettleseren din ikke støtter HTML5, så største tillatte filstørrelse er ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Rozmiar danych",
"INCOMPATIBLE_OPTIONS_W": "Następujące opcje konfiguracji są niezgodne:",
"NO_BROWSER_SUPPORT": "Twoja przeglądarka może nie obsługiwać HTML5, więc maksymalny rozmiar pliku to ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Tamanho dos dados",
"NO_BROWSER_SUPPORT": "O seu navegador pode não suportar HTML5, então o tamanho máximo do ficheiro é ",
"INCOMPATIBLE_OPTIONS_W": "As seguintes opções de configuração são incompatíveis:",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Seu navegador pode não suportar HTML5, portanto, o tamanho máximo do arquivo é ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Mărime date",
"INCOMPATIBLE_OPTIONS_W": "Următoarele opţiuni de configurare sunt incompatibile:",
"NO_BROWSER_SUPPORT": "Este posibil ca browserul dvs. să nu accepte HTML5, astfel încât dimensiunea maximă a fișierului este ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Zdá sa, že Váš prehliadač nepodporuje HTML5. Maximálna veľkosť súboru je preto obmedzená na ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Data storlek",
"INCOMPATIBLE_OPTIONS_W": "Följande inställningar är inkompatibla:",
"NO_BROWSER_SUPPORT": "Din webbläsare verkar inte stödja HTML5, så max filstorlek är ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Veri boyutu",
"INCOMPATIBLE_OPTIONS_W": "Aşağıdaki yapılandırma seçenekleri uyumsuz:",
"NO_BROWSER_SUPPORT": "Tarayıcınız HTML5'i desteklemeyebilir, bu nedenle en fazla dosya boyutu ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Розмір даних",
"NO_BROWSER_SUPPORT": "Ваш веб-переглядач може не підтримує HTML5, тому найбільший розмір файлу - це ",
"PLURAL_ENDING": "(-ів)",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "您的浏览器可能不支持 HTML5,因此文件最大为 ",
{
+ "REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "您的瀏覽器可能不支持 HTML5,因此文件最大為 ",