From 27fd0b6c4fda91b4d53236747dd64f02ff99337a Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 15:27:52 +0100 Subject: [PATCH 01/16] [TASK] Rename license file The license file is usually named "LICENSE.txt". --- COPYING => LICENSE.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename COPYING => LICENSE.txt (100%) diff --git a/COPYING b/LICENSE.txt similarity index 100% rename from COPYING rename to LICENSE.txt -- 2.34.1 From fe04c76a34666ee174a07cc4a1194f27f4b7d547 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 15:31:13 +0100 Subject: [PATCH 02/16] [FEATURE] Readme: Add link to contribution file Its a common way to include a CONTRIBUTING.md file (https://github.com/blog/1184-contributing-guidelines) to explain developers things like code format, structures and patch guidelines. Rename the newcomers file to CONTRIBUTING.md and add a link to it in the README. --- NEWCOMER.txt => CONTRIBUTING.md | 0 README.md | 10 ++++++++++ 2 files changed, 10 insertions(+) rename NEWCOMER.txt => CONTRIBUTING.md (100%) diff --git a/NEWCOMER.txt b/CONTRIBUTING.md similarity index 100% rename from NEWCOMER.txt rename to CONTRIBUTING.md diff --git a/README.md b/README.md index 945d231..0ad0123 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,16 @@ GNU Affero General Public License version 3 (AGPLv3). The GNU Affero General Public License can be found at https://www.gnu.org/licenses/agpl.html. +## Contribution + +If you want to contribute to project, then take a look at the git repository: + +- https://gitlab.com/mojo42/Jirafeau + +and the Contribution Guidelines + +- https://gitlab.com/mojo42/Jirafeau/blob/master/CONTRIBUTING.md + ## FAQ ### Can I add a new language in Jirafeau? -- 2.34.1 From 7d8055d7ad495657eab93bc7a83f066e3d40ec51 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 15:39:46 +0100 Subject: [PATCH 03/16] [FEATURE] Contribution guide: Revise chapters * Add headlines * Add note about the KISS principle of the project * Fix some typos --- CONTRIBUTING.md | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67bd4b9..5725c0e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,20 @@ +# Contributing + Hi, -This document is only made for newcomers in Jirafeau who are digging into -the code. +this document is made for newcomers in Jirafeau who are digging into the code. + +## General principle + +Jirafeau is made in the [KISS](http://en.wikipedia.org/wiki/KISS_principle) way (Keep It Simple, Stupid). + +It is meant to be a simple filehosting service, simple to use, simple to install, simple to maintain. + +This project won't evolve to a file manager and will focus to keep a very few dependencies. + +So things like a markdown parser for the ToS or E-Mail tasks would be usefull for sure, but may be [rejected](https://gitlab.com/mojo42/Jirafeau/issues/37#note_1191566) since they would a lot of dependencies and makes the project more complex. + +## Structure Here is a little explaination of Jirafeau's arboresence in a simplified view only to show the most importants files and their role. @@ -28,12 +41,20 @@ view only to show the most importants files and their role. ├── files : all files that has been successfully uploaded └── links : all links pointing to files with meta-informations -Coding style: +## Translations + +Translation may be add via [Jirafeau's Weblate](https://hosted.weblate.org/projects/jirafeau/master/). + +## Coding style - PHP function keywords are alone on a line -- Braces "{" must are put in a new line -- Files must be in UTF-8 (without BOM) -- Uses LF (\n) for end of lines +- Braces "{" must be put in a new line +- Files must be in UTF-8 without BOM and use Unix Line Endings (LF) + +The whole project is not clean about that yet, feel free to fix :) + +## Merge Requests -The whole project is not clean about that, feel free to fix :) +Please create one branch for each feature and send one merge request for each branch. +Dont squash several changes or commits into one merge request as this is hard to review. -- 2.34.1 From 519d511faad03b4e544b78387b8f2106d9040c22 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 15:57:46 +0100 Subject: [PATCH 04/16] [BUGFIX] Contribution: Fix structure markdown Structure markdown needs a code block syntax, to prevent wrong display. --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5725c0e..9876a21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,7 @@ So things like a markdown parser for the ToS or E-Mail tasks would be usefull fo Here is a little explaination of Jirafeau's arboresence in a simplified view only to show the most importants files and their role. +``` . ├── admin.php : adminitration interface, also permits to download files ├── f.php : permits to download files or show the download page @@ -40,6 +41,7 @@ view only to show the most importants files and their role. ├── async : chunks of uploaded files ├── files : all files that has been successfully uploaded └── links : all links pointing to files with meta-informations +``` ## Translations -- 2.34.1 From e2db43bbc99ff20f37bf8ccc09e11661602b39d1 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 16:32:48 +0100 Subject: [PATCH 05/16] [FEATURE] Docs: Enhance readabilty of config params Add some linebreaks and streamline comment style. --- lib/config.original.php | 88 ++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/lib/config.original.php b/lib/config.original.php index c38e640..6a5c1ba 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -18,64 +18,83 @@ * along with this program. If not, see . */ -/* - * default configuration - * if you want to change this, overwrite in a config.local.php file - */ +/** + * Default configuration + * + * To overwrite these settings copy the file, + * rename it to »config.local.php« and adapt the parameters. + **/ global $cfg; -/* Don't forget the ending '/' */ +/* URL of installation, with traling slash (eg. »https://exmaple.com/jirafeau/«) + */ $cfg['web_root'] = ''; + +/* Path to data directory, with trailing slash (eg. »/var/www/data/var_314159265358979323846264« + */ $cfg['var_root'] = ''; -/* Lang choice between 'auto', 'en' and 'fr'. - * 'auto' mode will take the user's browser informations. - * Will take english if user's langage is not available. +/* Language - choice between 'auto' or any language located in the /lib/locales/ folder. + * The mode »auto« will cause the script to detect the user's browser information + * and offer a matching language, and use »en« if it is not available. */ $cfg['lang'] = 'auto'; -/* Select your style :) See media folder */ + +/* Select a theme - see media folder for available themes + */ $cfg['style'] = 'courgette'; -/* Propose a preview link if file type is previewable. */ + +/* Propose a preview link if file type is previewable + */ $cfg['preview'] = true; -/* Encryption feature. disable it by default. - * By enabling it, file-level deduplication won't work. + +/* Enable the encryption feature + * By enabling it, file-level deduplication won't work anymore. See FAQ. */ $cfg['enable_crypt'] = false; -/* Split length of link refenrece. */ + +/* Length of link reference + */ $cfg['link_name_length'] = 8; -/* Upload password(s). Empty array disable password authentification. + +/* Upload password(s). + * An empty array will disable the password authentification. * $cfg['upload_password'] = array(); // No password * $cfg['upload_password'] = array('psw1'); // One password * $cfg['upload_password'] = array('psw1', 'psw2'); // Two passwords - * ... and so on */ $cfg['upload_password'] = array(); + /* List of IP allowed to upload a file. - * If list is empty, then there is no upload restriction based on IP + * If the list is empty, then there is no upload restriction based on IP. * Elements of the list can be a single IP (e.g. "123.45.67.89") or * an IP range (e.g. "123.45.0.0/16"). * Note that CIDR notation is available for IPv4 only for the moment. */ $cfg['upload_ip'] = array(); -/* An empty admin password will disable the classic admin password - * authentication. Note that admin password is a sha256 hash of the original - * version. + +/* Password for the admin interface. + * An empty password will disable the password authentification. + * The password is a sha256 hash of the original version. */ $cfg['admin_password'] = ''; -/* If set, let's the user to be authenticated as administrator. + +/* If set, let the user be authenticated as administrator. * The user provided here is the user authenticated by HTTP authentication. - * Note that Jirafeau does not manage the HTTP login part, it just check - * that the provided user is logged. - * If admin_password parameter is also set, admin_password is ignored. + * Note that Jirafeau does not manage the HTTP login part, it just checks + * that the provided user is logged in. + * If »admin_password« parameter is set, then the »admin_password« is ignored. */ $cfg['admin_http_auth_user'] = ''; -/* Select different options for availability of uploaded files. + +/* Allow user to select different options for file expiration time. * Possible values in array: * 'minute': file is available for one minute * 'hour': file available for one hour * 'day': file available for one day * 'week': file available for one week * 'month': file is available for one month + * 'quarter': file is available for three month * 'year': file available for one year * 'none': unlimited availability */ @@ -89,22 +108,29 @@ $cfg['availabilities'] = array ( 'year' => false, 'none' => false ); + /* Set a default value for the expiration time. - * The value has to equal one of the enabled options in »availabilities«, e.g. »month«) + * The value has to equal one of the enabled options in »availabilities«, e.g. »month«. */ $cfg['availability_default'] = 'month'; + /* Set maximal upload size expressed in MB. - * 0 mean unlimited upload size. + * »0« means unlimited upload size. */ $cfg['maximal_upload_size'] = 0; -/* If your Jirafeau is behind some reverse proxies, you can set there IPs - * so Jirafeau get visitor's IP from HTTP_X_FORWARDED_FOR instead of - * REMOTE_ADDR. - * for example: + +/* Proxy IP + * If the installation is behind some reverse proxies, it is possible to set + * the allowed proxy IP. * $cfg['proxy_ip'] = array('12.34.56.78'); + * Jirafeau will then get a visitor's IP from HTTP_X_FORWARDED_FOR + * instead of REMOTE_ADDR. */ $cfg['proxy_ip'] = array(); -/* Installation is done ? */ + +/* Required flag to test if the installation is already installed + * or needs to start the installation script + */ $cfg['installation_done'] = false; /* Try to include user's local configuration. */ -- 2.34.1 From 18b6e57c0091dfdd14427c940346da59298b29eb Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 17:23:17 +0100 Subject: [PATCH 06/16] [FEATURE] Install script: Reduce test code Add some comments to enhance the readabillity in the installation script. Reduce footer includes and send all fatal errors to one function instead. Remove includes of installation depenend variables in the footer, if the installation script is not done yet. Move settings include to the top (this may help for future configuration tests). --- install.php | 67 +++++++++++++++++++++++++++-------------- lib/template/footer.php | 12 ++++++-- 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/install.php b/install.php index ae4bd99..b96593e 100644 --- a/install.php +++ b/install.php @@ -24,9 +24,14 @@ define ('QUOTE', "'"); define ('JIRAFEAU_CFG', JIRAFEAU_ROOT.'lib/config.local.php'); define ('JIRAFEAU_VAR_RAND_LENGTH', 15); +require (JIRAFEAU_ROOT . 'lib/config.original.php'); +require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); + +/** + * Prepend used functions + **/ function jirafeau_quoted ($str) @@ -120,42 +125,62 @@ jirafeau_add_ending_slash ($path) return $path . ((substr ($path, -1) == '/') ? '' : '/'); } -if ($cfg['installation_done'] === true) +function +jirafeau_fatal_error($errorText) { - header('Location: index.php'); + echo '

Error

' . $errorText . '

'; + require (JIRAFEAU_ROOT . 'lib/template/footer.php'); exit; } +/** + * Check installation + **/ + +// Is the installation process done already? +// Then there is nothing to do here → redirect to the main page. +if ($cfg['installation_done'] === true) +{ + header('Location: index.php'); + exit; +} + +/** + * Prepare installation process + **/ + +require (JIRAFEAU_ROOT . 'lib/template/header.php'); + +// does the local configuration file exist? if (!file_exists (JIRAFEAU_CFG)) { - /* We try to create an empty one. */ + // show an error if it is not possible to create the file if (!@touch (JIRAFEAU_CFG)) { - require (JIRAFEAU_ROOT . 'lib/template/header.php'); - echo '

' . - t('The local configuration file could not be created. Create a ' . + jirafeau_fatal_error( + t('The local configuration file could not be created. Create a ' . 'lib/config.local.php file and give the write ' . 'permission to the web server (preferred solution), or give the ' . 'write permission to the web server on the lib ' . - 'directory.') . - '

'; - require (JIRAFEAU_ROOT . 'lib/template/footer.php'); - exit; + 'directory.') + ); } } +// is the local configuration writable? if (!is_writable (JIRAFEAU_CFG) && !@chmod (JIRAFEAU_CFG, '0666')) { - require (JIRAFEAU_ROOT . 'lib/template/header.php'); - echo '

' . - t('The local configuration is not writable by the web server. ' . - 'Give the write permission to the web server on the ' . - 'lib/config.local.php file.') . - '

'; - require (JIRAFEAU_ROOT . 'lib/template/footer.php'); - exit; + jirafeau_fatal_error( + t('The local configuration is not writable by the web server. ' . + 'Give the write permission to the web server on the ' . + 'lib/config.local.php file.') + ); } +/** + * Run trough each installation step + **/ + if (isset ($_POST['step']) && isset ($_POST['next'])) { switch ($_POST['step']) @@ -185,9 +210,6 @@ if (isset ($_POST['step']) && isset ($_POST['next'])) } -require (JIRAFEAU_ROOT . 'lib/settings.php'); -require (JIRAFEAU_ROOT . 'lib/template/header.php'); - $current = 1; if (isset ($_POST['next'])) $current = $_POST['step'] + 1; @@ -367,4 +389,3 @@ break; } require (JIRAFEAU_ROOT . 'lib/template/footer.php'); -?> diff --git a/lib/template/footer.php b/lib/template/footer.php index a8c080d..3abc290 100644 --- a/lib/template/footer.php +++ b/lib/template/footer.php @@ -2,9 +2,17 @@ -- 2.34.1 From af7e43a4a3bbcb62912eabd75537480bf696b265 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 17:54:01 +0100 Subject: [PATCH 07/16] [FEATURE] Move config include into settings file Move the include of the original and the local configuration file into the settings file to reduce one includes in each file, have all settings in one place and remove unneccessary code from the config file (which makes it easier to copy and change it). --- admin.php | 1 - f.php | 3 +-- index.php | 1 - install.php | 2 -- lib/config.original.php | 10 +--------- lib/functions.js.php | 2 +- lib/settings.php | 12 ++++++++++++ script.php | 2 -- tos.php | 6 ++++-- 9 files changed, 19 insertions(+), 20 deletions(-) diff --git a/admin.php b/admin.php index cb60580..d602dcd 100644 --- a/admin.php +++ b/admin.php @@ -19,7 +19,6 @@ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); diff --git a/f.php b/f.php index 0218602..a97718f 100644 --- a/f.php +++ b/f.php @@ -19,10 +19,9 @@ */ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -require (JIRAFEAU_ROOT . 'lib/lang.php'); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); +require (JIRAFEAU_ROOT . 'lib/lang.php'); if (!isset ($_GET['h']) || empty ($_GET['h'])) { diff --git a/index.php b/index.php index 4371e9e..2002ad7 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,6 @@ */ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); diff --git a/install.php b/install.php index b96593e..51cf7b8 100644 --- a/install.php +++ b/install.php @@ -20,11 +20,9 @@ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); define ('NL', "\n"); define ('QUOTE', "'"); - define ('JIRAFEAU_CFG', JIRAFEAU_ROOT.'lib/config.local.php'); define ('JIRAFEAU_VAR_RAND_LENGTH', 15); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); diff --git a/lib/config.original.php b/lib/config.original.php index 6a5c1ba..30ec134 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -24,7 +24,6 @@ * To overwrite these settings copy the file, * rename it to »config.local.php« and adapt the parameters. **/ -global $cfg; /* URL of installation, with traling slash (eg. »https://exmaple.com/jirafeau/«) */ @@ -133,11 +132,4 @@ $cfg['proxy_ip'] = array(); */ $cfg['installation_done'] = false; -/* Try to include user's local configuration. */ -if ((basename (__FILE__) != 'config.local.php') - && file_exists (JIRAFEAU_ROOT.'lib/config.local.php')) -{ - require (JIRAFEAU_ROOT.'lib/config.local.php'); -} - -?> +?> \ No newline at end of file diff --git a/lib/functions.js.php b/lib/functions.js.php index 7a1c5af..31cefe3 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -21,7 +21,7 @@ header('Content-Type: text/javascript'); define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/../'); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); + require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); diff --git a/lib/settings.php b/lib/settings.php index 3a9f450..3795122 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -17,6 +17,16 @@ * along with this program. If not, see . */ +global $cfg; + +// Read config files +require (JIRAFEAU_ROOT . 'lib/config.original.php'); + +if (file_exists(JIRAFEAU_ROOT . 'lib/config.local.php')) +{ + require (JIRAFEAU_ROOT . 'lib/config.local.php'); +} + /* Jirafeau constants */ define ('JIRAFEAU_PACKAGE', 'Jirafeau'); define ('JIRAFEAU_VERSION', '1.2.0'); @@ -40,4 +50,6 @@ define ('JIRAFEAU_MONTH', 2419200); // JIRAFEAU_WEEK * 4 define ('JIRAFEAU_QUARTER', 7257600); // JIRAFEAU_MONTH * 3 define ('JIRAFEAU_YEAR', 29030400); // JIRAFEAU_MONTH * 12 + + ?> diff --git a/script.php b/script.php index 5e02456..c3b722f 100644 --- a/script.php +++ b/script.php @@ -22,10 +22,8 @@ * If you don't want this feature, you can simply delete this file from your * web directory. */ - define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); diff --git a/tos.php b/tos.php index 111916d..c5e4307 100644 --- a/tos.php +++ b/tos.php @@ -17,10 +17,10 @@ */ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); + require (JIRAFEAU_ROOT . 'lib/template/header.php'); $url = $cfg['web_root'] . 'tos.php'; @@ -39,5 +39,7 @@ echo $tos; echo ''; echo '

This license text is under Creative Commons - Attribution 3.0 Unported.

It has been based on this work: http://opensource.org/ToS

'; echo ''; + require (JIRAFEAU_ROOT . 'lib/template/footer.php'); -?> + +?> \ No newline at end of file -- 2.34.1 From e1c30044b1fa083d89b4bf8f0265fb2785583411 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 18:12:50 +0100 Subject: [PATCH 08/16] [FEATURE] Install script: Simplify config generation Simplify the generation of the local configuration file by replacing various loops with shorter PHP standard methods. This will cause the local configuration to have a slightly different style, but it is still an array therefore is readable and changeable by PHP developers. --- install.php | 35 ++++++++++------------------------- lib/settings.php | 5 ++++- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/install.php b/install.php index 51cf7b8..df4f106 100644 --- a/install.php +++ b/install.php @@ -20,7 +20,7 @@ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); define ('NL', "\n"); define ('QUOTE', "'"); -define ('JIRAFEAU_CFG', JIRAFEAU_ROOT.'lib/config.local.php'); +define ('JIRAFEAU_CFG', JIRAFEAU_ROOT . 'lib/config.local.php'); define ('JIRAFEAU_VAR_RAND_LENGTH', 15); require (JIRAFEAU_ROOT . 'lib/settings.php'); @@ -40,32 +40,17 @@ jirafeau_quoted ($str) function jirafeau_export_cfg ($cfg) { - $handle = fopen (JIRAFEAU_CFG, 'w'); - fwrite ($handle, ' $item) - { - fwrite ($handle, '$cfg[' . jirafeau_quoted ($key) . '] = '); - if (is_bool ($item)) - fwrite ($handle, ($item ? 'true' : 'false')); - else if (is_string ($item)) - fwrite ($handle, jirafeau_quoted ($item)); - else if (is_int ($item)) - fwrite ($handle, $item); - else if (is_array ($item)) - fwrite ($handle, str_replace(array("\n", "\r"), "", - var_export ($item, true))); - else - fwrite ($handle, 'null'); - fwrite ($handle, ';'.NL); + 'configuration items.') . ' */' . NL; + $content .= '$cfg = ' . var_export($cfg, true) . ';'; + + $fileWrite = file_put_contents(JIRAFEAU_CFG, $content); + + if (false === $fileWrite) { + jirafeau_fatal_error(t('Can not write local configuration file')); } - /* No newline at the end of the file to be able to send headers. */ - fwrite ($handle, '?>'); - fclose ($handle); } function diff --git a/lib/settings.php b/lib/settings.php index 3795122..3167414 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -21,10 +21,13 @@ global $cfg; // Read config files require (JIRAFEAU_ROOT . 'lib/config.original.php'); - if (file_exists(JIRAFEAU_ROOT . 'lib/config.local.php')) { + // read local copy and merge with original values + $cfgOriginal = $cfg; require (JIRAFEAU_ROOT . 'lib/config.local.php'); + $cfg = array_merge($cfgOriginal, $cfg); + unset($cfgOriginal); } /* Jirafeau constants */ -- 2.34.1 From 381f2d6ec29c08264a6fcf5066ff97cc32698595 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Tue, 17 Jan 2017 12:37:34 +0100 Subject: [PATCH 09/16] [FEATURE] Replace markers in templates Add a function to allow a simple marker replacement, eg. for the Terms of Service page. Markers have the scheme "###MARKERNAME###". --- lib/functions.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/functions.php b/lib/functions.php index 47fbc40..a89d8b8 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1359,3 +1359,31 @@ jirafeau_alias_delete ($alias, $password) return 'Ok'; } +/** + * Replace markers in templates. + * + * Available markers have the scheme "###MARKERNAME###". + * + * @param $content string Template text with markers + * @param $htmllinebreaks boolean Convert linebreaks to BR-Tags + * @return Template with replaced markers + */ +function +jirafeau_replace_markers ($content, $htmllinebreaks = false) +{ + $patterns = array( + '/###ORGANISATION###/', + '/###CONTACTPERSON###/' + ); + $replacements = array( + '[ORGANISATION PROVIDING THIS WEBSITE]', + 'contact@[THIS WEBSITE]' + ); + $content = preg_replace($patterns, $replacements, $content); + + if (true === $htmllinebreaks) { + $content = nl2br($content); + } + + return $content; +} \ No newline at end of file -- 2.34.1 From 4a53554259c43793bb7035489da0e6bd79993b6e Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Tue, 17 Jan 2017 12:42:04 +0100 Subject: [PATCH 10/16] [!!][FEATURE] Let admin overwrite the ToS page MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Let the admin overwrite the content of the "Terms of Service" page by copying the original ToS template and creating a local file (same procedure as for the configuration). This file is not versionized. Note: This is a breaking change, since the existing tos textfile is moved. This should be mentioned in the update comments. * ToS text file changed → move file from "/tos_text.php" to "/lib/tos.local.txt" and remove all HTML und PHP Tags, leaving a regular text file. Refs #95 --- .gitignore | 1 + lib/tos.original.txt | 61 ++++++++++++++++++++++++++++++++ tos.php | 83 +++++++++++++++++++++----------------------- tos_text.php | 63 --------------------------------- 4 files changed, 101 insertions(+), 107 deletions(-) create mode 100644 lib/tos.original.txt delete mode 100644 tos_text.php diff --git a/.gitignore b/.gitignore index bfa50cd..00bbc72 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ lib/config.local.php +lib/tos.local.txt var-* diff --git a/lib/tos.original.txt b/lib/tos.original.txt new file mode 100644 index 0000000..1e3e01e --- /dev/null +++ b/lib/tos.original.txt @@ -0,0 +1,61 @@ +TERMS OF SERVICE + +1. ACCEPTANCE OF TERMS +###ORGANISATION### provides the information on this Web site as provided in these Terms of Service ("TOS"). ###ORGANISATION### may update the TOS at any time and without prior notice by posting a new version at ###WEBROOT###. The information on this site and your use of it is subject to the most recent version of the TOS posted. + +2. DESCRIPTION OF SERVICE +###ORGANISATION### provides you an upload service and a variety of other services. ("###ORGANISATION### Service"). Unless explicitly stated otherwise, any new features that augment or enhance the current ###ORGANISATION### Service shall be subject to the TOS. + +3. CONDUCT +You understand that all information, data, text, software, graphics or other materials ("Content"), whether publicly posted or privately transmitted, are the sole responsibility of the person from whom such Content originated. This means that you, and not ###ORGANISATION###, are entirely responsible for all Content that you upload, post, email, transmit or otherwise make available via the ###ORGANISATION### Service. ###ORGANISATION### does not control the Content posted via the ###ORGANISATION### Service and, as such, does not guarantee the accuracy, integrity or quality of such Content. Under no circumstances will ###ORGANISATION### be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the ###ORGANISATION### Service. You agree to not use the ###ORGANISATION### Service to: + 1) upload, post, email, transmit or otherwise make available any Content that is unlawful, harmful, threatening, abusive, harassing, tortuous, defamatory, vulgar, obscene, libelous, invasive of another's privacy, hateful, or racially, ethnically or otherwise objectionable or harm minors; + 2) impersonate any person or entity or falsely state or otherwise misrepresent your affiliation with a person or entity; + 3) forge headers or otherwise manipulate identifiers in order to disguise the origin of any Content transmitted through the ###ORGANISATION### Service; + 4) upload, post, email, transmit or otherwise make available any Content that you do not have a right to make available under any law or under contractual or other relationships; + 5) upload, post, email, transmit or otherwise make available any Content that infringes any patent, trademark, trade secret, copyright or other proprietary rights of any party; + 6) upload, post, email, transmit or otherwise make available any unsolicited or unauthorized advertising, promotional materials, "junk mail," "spam," or any other form of solicitation; + 7) upload, post, email, transmit or otherwise make available any material that contains software viruses or any other computer code, files or programs designed to interrupt, destroy or limit the functionality of any computer software or hardware or telecommunications equipment; + 8) disrupt the normal flow of dialogue, or otherwise act in a manner that negatively affects other users' ability to engage in discussions or exchanges; + 9) interfere with or disrupt the ###ORGANISATION### Service or servers or networks connected to the ###ORGANISATION### Service, or disobey any requirements, procedures, policies or regulations of networks connected to the ###ORGANISATION### Service; + 10) intentionally or unintentionally violate any applicable local, state, national or international law, + 11) "stalk" or otherwise harass another; and/or + 12) collect or store personal data about other users in connection with the prohibited conduct and activities set forth in paragraphs above. You acknowledge that ###ORGANISATION### may or may not pre-screen Content, but that ###ORGANISATION### and its designees shall have the right (but not the obligation) in their sole discretion to pre-screen, refuse, move, or remove any Content that is available via the ###ORGANISATION### Service and which violates the TOS. You agree that you must evaluate, and bear all risks associated with, the use of any Content, including any reliance on the accuracy, completeness, or usefulness of such Content. You acknowledge, consent and agree that ###ORGANISATION### may access, preserve and disclose your account information and Content if required to do so by law or in a good faith belief that such access preservation or disclosure is reasonably necessary to: + (a) comply with legal process; + (b) enforce the TOS; + (c) respond to claims that any Content violates the rights of third parties; + (d) respond to your requests for customer service; or (e) protect the rights, property or personal safety of ###ORGANISATION### its users and the public. + +4. CONTENT MADE AVAILABLE FOR INCLUSION ON THE ###ORGANISATION### SERVICE +###ORGANISATION### does not claim ownership of Content you submit or make available for inclusion via the ###ORGANISATION### Service. However, with respect to Content you submit or make available for inclusion on the publicly available ###ORGANISATION### Service, you irrevocably grant ###ORGANISATION### the perpetual, worldwide, royalty-free and non-exclusive license, with the right to sublicense through multiple tiers of sublicensees, to use, distribute, reproduce, modify, adapt, publicly perform and publicly display such Content, in whole or in part, on the ###ORGANISATION### Service or other publications by ###ORGANISATION### in any media whether now existing or which come into the existence into the future and to provide that information under the license set forth on the initial page of the $url Web site. And for Content you submit for private discussions, you grant ###ORGANISATION### the worldwide, royalty-free and non-exclusive license to use, distribute, reproduce, modify, adapt, publicly perform and publicly display such Content on the associated private discussion group. + +5. INDEMNITY +You agree to indemnify and hold ###ORGANISATION### and its subsidiaries, affiliates, officers, agents, employees, partners and licensors harmless from any claim or demand, including but not limited to reasonable attorneys' fees, made by any third party due to or arising out of Content you submit, post, transmit or otherwise make available through the Service, your use of the ###ORGANISATION### Service, your connection to the Service, your violation of the TOS, or your violation of any rights of another. + +6. MODIFICATIONS TO ###ORGANISATION### SERVICE You acknowledge that ###ORGANISATION### may establish general practices and limits concerning use of the ###ORGANISATION### Service, including without limitation the maximum number of days that email messages, message board postings or other uploaded Content will be retained by the ###ORGANISATION### Service.. You further acknowledge that ###ORGANISATION### reserves the right to modify these general practices and limits from time to time. ###ORGANISATION### reserves the right at any time and from time to time to modify or discontinue, temporarily or permanently, the ###ORGANISATION### Service (or any part thereof) with or without notice. You agree that ###ORGANISATION### shall not be liable to you or to any third party for any modification, suspension or discontinuance of the ###ORGANISATION### Service. + +7. TERMINATION +You agree that ###ORGANISATION### may terminate your access to the ###ORGANISATION### Service for violations of the TOS and/or requests by authorized law enforcement or other government agencies. + +8. LINKS +The ###ORGANISATION### Service may provide, or third parties may provide, links to other World Wide Web sites or resources. Because ###ORGANISATION### has no control over such sites and resources, you acknowledge and agree that ###ORGANISATION### is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any Content, advertising, products or other materials on or available from such sites or resources. You further acknowledge and agree that ###ORGANISATION### shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such Content, goods or services available on or through any such site or resource. + +9. DISCLAIMER OF WARRANTIES +You expressly understand and agree that: Your use of the ###ORGANISATION### service is at your sole risk. ###ORGANISATION### service is provided on an "as is" and "as available" basis. ###ORGANISATION### and its subsidiaries, affiliates, officers, employees and licensors expressly disclaim all warranties of any kind, whether express or implied, including, but not limited to the implied warranties of merchantability, fitness for a particular purpose and non-infringement. ###ORGANISATION### and its subsidiaries, affiliates, officers, employees and licensors make no warranty that +(i) The ###ORGANISATION### service will meet your requirements; +(ii) The ###ORGANISATION### service will be uninterrupted, timely, secure or error-free and +(iii) The results that may be obtained from the use of the ###ORGANISATION### service will be accurate or reliable. No advice or information, whether oral or written, obtained by you from ###ORGANISATION### or through or from the service shall create any warranty not expressly stated in the TOS. + +10. LIMITATION OF LIABILITY +You expressly understand and agree that ###ORGANISATION### and its subsidiaries, affiliates, officers, employees, agents, partners and licensors shall not be liable to you for any direct, indirect, incidental, special, consequential or exemplary damages, including, but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses (even if ###ORGANISATION### has been advised of the possibility of such damages), resulting from the use or the inability to use the ###ORGANISATION### service. + +11. NOTICE AND PROCEDURE FOR MAKING CLAIMS OF COPYRIGHT INFRINGEMENT +###ORGANISATION### respects the copyright of others, and we ask our users to do the same. ###ORGANISATION### may, in appropriate circumstances and at its discretion, disable and/or terminate the access of users who may be repeat infringers. If you believe that your work has been copied in a way that constitutes copyright infringement, please provide ###ORGANISATION###'s Copyright Agent the following information: an electronic or physical signature of the person authorized to act on behalf of the owner of the copyright; a description of the copyrighted work that you claim has been infringed; a description of where the material that you claim is infringing is located on the site; your address, telephone number, and email address; a statement by you that you have a good faith belief that the disputed use is not authorized by the copyright owner, its agent, or the law; a statement by you, made under penalty of perjury, that the above information in your Notice is accurate and that you are the copyright owner or authorized to act on the copyright owner's behalf. + +###ORGANISATION###'s Agent for Notice of claims of copyright infringement can be reached as follows: + +###CONTACTPERSON### + + + +This license text is under »Creative Commons - Attribution 3.0 Unported« (https://creativecommons.org/licenses/by/3.0). +It is based on the »Open Source Initiative Terms of Service« (https://opensource.org/ToS). diff --git a/tos.php b/tos.php index c5e4307..44fc86c 100644 --- a/tos.php +++ b/tos.php @@ -1,45 +1,40 @@ -. - */ - -define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -require (JIRAFEAU_ROOT . 'lib/settings.php'); -require (JIRAFEAU_ROOT . 'lib/functions.php'); -require (JIRAFEAU_ROOT . 'lib/lang.php'); - -require (JIRAFEAU_ROOT . 'lib/template/header.php'); - -$url = $cfg['web_root'] . 'tos.php'; -$org = "[THIS WEBSITE]"; -$contact = " -By email: - contact@[THIS WEBSITE] -"; - -include (JIRAFEAU_ROOT . 'tos_text.php'); - -echo '

Terms of Service

'; -echo '
'; -echo ''; -echo '

This license text is under Creative Commons - Attribution 3.0 Unported.

It has been based on this work: http://opensource.org/ToS

'; -echo '
'; - -require (JIRAFEAU_ROOT . 'lib/template/footer.php'); - +. + */ + +define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); + +require (JIRAFEAU_ROOT . 'lib/settings.php'); +require (JIRAFEAU_ROOT . 'lib/functions.php'); +require (JIRAFEAU_ROOT . 'lib/lang.php'); + +// Read ToS template +if (is_readable(JIRAFEAU_ROOT . 'lib/tos.local.txt')) { + $content = file_get_contents(JIRAFEAU_ROOT . 'lib/tos.local.txt'); +} else { + $content = file_get_contents(JIRAFEAU_ROOT . 'lib/tos.original.txt'); +} + +// Replace markers and print ToS +require (JIRAFEAU_ROOT . 'lib/template/header.php'); + +echo '

Terms of Service

'; +echo '
' . jirafeau_replace_markers($content, true) . '
'; + +require (JIRAFEAU_ROOT . 'lib/template/footer.php'); + ?> \ No newline at end of file diff --git a/tos_text.php b/tos_text.php deleted file mode 100644 index c19c243..0000000 --- a/tos_text.php +++ /dev/null @@ -1,63 +0,0 @@ -http://opensource.org/ToS - */ -$tos=" -TERMS OF SERVICE - -1. ACCEPTANCE OF TERMS -$org provides the information on this Web site as provided in these Terms of Service (\"TOS\"). $org may update the TOS at any time and without prior notice by posting a new version at $url. The information on this site and your use of it is subject to the most recent version of the TOS posted. - -2. DESCRIPTION OF SERVICE -$org provides you an upload service and a variety of other services. (\"$org Service\"). Unless explicitly stated otherwise, any new features that augment or enhance the current $org Service shall be subject to the TOS. - -3. CONDUCT -You understand that all information, data, text, software, graphics or other materials (\"Content\"), whether publicly posted or privately transmitted, are the sole responsibility of the person from whom such Content originated. This means that you, and not $org, are entirely responsible for all Content that you upload, post, email, transmit or otherwise make available via the $org Service. $org does not control the Content posted via the $org Service and, as such, does not guarantee the accuracy, integrity or quality of such Content. Under no circumstances will $org be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the $org Service. You agree to not use the $org Service to: - 1) upload, post, email, transmit or otherwise make available any Content that is unlawful, harmful, threatening, abusive, harassing, tortuous, defamatory, vulgar, obscene, libelous, invasive of another's privacy, hateful, or racially, ethnically or otherwise objectionable or harm minors; - 2) impersonate any person or entity or falsely state or otherwise misrepresent your affiliation with a person or entity; - 3) forge headers or otherwise manipulate identifiers in order to disguise the origin of any Content transmitted through the $org Service; - 4) upload, post, email, transmit or otherwise make available any Content that you do not have a right to make available under any law or under contractual or other relationships; - 5) upload, post, email, transmit or otherwise make available any Content that infringes any patent, trademark, trade secret, copyright or other proprietary rights of any party; - 6) upload, post, email, transmit or otherwise make available any unsolicited or unauthorized advertising, promotional materials, \"junk mail,\" \"spam,\" or any other form of solicitation; - 7) upload, post, email, transmit or otherwise make available any material that contains software viruses or any other computer code, files or programs designed to interrupt, destroy or limit the functionality of any computer software or hardware or telecommunications equipment; - 8) disrupt the normal flow of dialogue, or otherwise act in a manner that negatively affects other users' ability to engage in discussions or exchanges; - 9) interfere with or disrupt the $org Service or servers or networks connected to the $org Service, or disobey any requirements, procedures, policies or regulations of networks connected to the $org Service; - 10) intentionally or unintentionally violate any applicable local, state, national or international law, - 11) \"stalk\" or otherwise harass another; and/or - 12) collect or store personal data about other users in connection with the prohibited conduct and activities set forth in paragraphs above. You acknowledge that $org may or may not pre-screen Content, but that $org and its designees shall have the right (but not the obligation) in their sole discretion to pre-screen, refuse, move, or remove any Content that is available via the $org Service and which violates the TOS. You agree that you must evaluate, and bear all risks associated with, the use of any Content, including any reliance on the accuracy, completeness, or usefulness of such Content. You acknowledge, consent and agree that $org may access, preserve and disclose your account information and Content if required to do so by law or in a good faith belief that such access preservation or disclosure is reasonably necessary to: - (a) comply with legal process; - (b) enforce the TOS; - (c) respond to claims that any Content violates the rights of third parties; - (d) respond to your requests for customer service; or (e) protect the rights, property or personal safety of $org its users and the public. - -4. CONTENT MADE AVAILABLE FOR INCLUSION ON THE $org SERVICE -$org does not claim ownership of Content you submit or make available for inclusion via the $org Service. However, with respect to Content you submit or make available for inclusion on the publicly available $org Service, you irrevocably grant $org the perpetual, worldwide, royalty-free and non-exclusive license, with the right to sublicense through multiple tiers of sublicensees, to use, distribute, reproduce, modify, adapt, publicly perform and publicly display such Content, in whole or in part, on the $org Service or other publications by $org in any media whether now existing or which come into the existence into the future and to provide that information under the license set forth on the initial page of the $url Web site. And for Content you submit for private discussions, you grant $org the worldwide, royalty-free and non-exclusive license to use, distribute, reproduce, modify, adapt, publicly perform and publicly display such Content on the associated private discussion group. - -5. INDEMNITY -You agree to indemnify and hold $org and its subsidiaries, affiliates, officers, agents, employees, partners and licensors harmless from any claim or demand, including but not limited to reasonable attorneys' fees, made by any third party due to or arising out of Content you submit, post, transmit or otherwise make available through the Service, your use of the $org Service, your connection to the Service, your violation of the TOS, or your violation of any rights of another. - -6. MODIFICATIONS TO $org SERVICE You acknowledge that $org may establish general practices and limits concerning use of the $org Service, including without limitation the maximum number of days that email messages, message board postings or other uploaded Content will be retained by the $org Service.. You further acknowledge that $org reserves the right to modify these general practices and limits from time to time. $org reserves the right at any time and from time to time to modify or discontinue, temporarily or permanently, the $org Service (or any part thereof) with or without notice. You agree that $org shall not be liable to you or to any third party for any modification, suspension or discontinuance of the $org Service. - -7. TERMINATION -You agree that $org may terminate your access to the $org Service for violations of the TOS and/or requests by authorized law enforcement or other government agencies. - -8. LINKS -The $org Service may provide, or third parties may provide, links to other World Wide Web sites or resources. Because $org has no control over such sites and resources, you acknowledge and agree that $org is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any Content, advertising, products or other materials on or available from such sites or resources. You further acknowledge and agree that $org shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such Content, goods or services available on or through any such site or resource. - -9. DISCLAIMER OF WARRANTIES -You expressly understand and agree that: Your use of the $org service is at your sole risk. $org service is provided on an \"as is\" and \"as available\" basis. $org and its subsidiaries, affiliates, officers, employees and licensors expressly disclaim all warranties of any kind, whether express or implied, including, but not limited to the implied warranties of merchantability, fitness for a particular purpose and non-infringement. $org and its subsidiaries, affiliates, officers, employees and licensors make no warranty that -(i) The $org service will meet your requirements; -(ii) The $org service will be uninterrupted, timely, secure or error-free and -(iii) The results that may be obtained from the use of the $org service will be accurate or reliable. No advice or information, whether oral or written, obtained by you from $org or through or from the service shall create any warranty not expressly stated in the TOS. - -10. LIMITATION OF LIABILITY -You expressly understand and agree that $org and its subsidiaries, affiliates, officers, employees, agents, partners and licensors shall not be liable to you for any direct, indirect, incidental, special, consequential or exemplary damages, including, but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses (even if $org has been advised of the possibility of such damages), resulting from the use or the inability to use the $org service. - -11. NOTICE AND PROCEDURE FOR MAKING CLAIMS OF COPYRIGHT INFRINGEMENT -$org respects the copyright of others, and we ask our users to do the same. $org may, in appropriate circumstances and at its discretion, disable and/or terminate the access of users who may be repeat infringers. If you believe that your work has been copied in a way that constitutes copyright infringement, please provide $org's Copyright Agent the following information: an electronic or physical signature of the person authorized to act on behalf of the owner of the copyright; a description of the copyrighted work that you claim has been infringed; a description of where the material that you claim is infringing is located on the site; your address, telephone number, and email address; a statement by you that you have a good faith belief that the disputed use is not authorized by the copyright owner, its agent, or the law; a statement by you, made under penalty of perjury, that the above information in your Notice is accurate and that you are the copyright owner or authorized to act on the copyright owner's behalf. - -$org's Agent for Notice of claims of copyright infringement can be reached as follows: - -$contact -"; -?> -- 2.34.1 From 2b10abd17f88ba23817bf28840a0f44da74bf362 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Tue, 17 Jan 2017 13:52:27 +0100 Subject: [PATCH 11/16] [FEATURE] Template Markers: Replace configuration values Replace markers with configured values. --- lib/config.original.php | 8 ++++++++ lib/functions.php | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/config.original.php b/lib/config.original.php index 30ec134..cd39bb3 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -43,6 +43,14 @@ $cfg['lang'] = 'auto'; */ $cfg['style'] = 'courgette'; +/* Name the organisation running this installation, eg. 'ACME' + */ +$cfg['organisation'] = 'ACME'; + +/* Provide a contact person for this installation, eg. 'John Doe ' + */ +$cfg['contactperson'] = ''; + /* Propose a preview link if file type is previewable */ $cfg['preview'] = true; diff --git a/lib/functions.php b/lib/functions.php index a89d8b8..6c9c832 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1373,11 +1373,13 @@ jirafeau_replace_markers ($content, $htmllinebreaks = false) { $patterns = array( '/###ORGANISATION###/', - '/###CONTACTPERSON###/' + '/###CONTACTPERSON###/', + '/###WEBROOT###/' ); $replacements = array( - '[ORGANISATION PROVIDING THIS WEBSITE]', - 'contact@[THIS WEBSITE]' + $GLOBALS['cfg']['organisation'], + $GLOBALS['cfg']['contactperson'], + $GLOBALS['cfg']['web_root'] ); $content = preg_replace($patterns, $replacements, $content); -- 2.34.1 From 1ed002b703c25eb4c68fab84f3bd70b649d65803 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Tue, 17 Jan 2017 15:13:13 +0100 Subject: [PATCH 12/16] [FEATURE] Enable a custom website title Enable the administrator to set a custom title for his installation of Jirafeau, eg. "John Doe Filecenter". --- lib/config.original.php | 4 ++++ lib/template/header.php | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/config.original.php b/lib/config.original.php index cd39bb3..2cc93e7 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -51,6 +51,10 @@ $cfg['organisation'] = 'ACME'; */ $cfg['contactperson'] = ''; +/* Give the installation a title, eg. 'Datahub' or 'John Doe Filehost' + */ +$cfg['title'] = ''; + /* Propose a preview link if file type is previewable */ $cfg['preview'] = true; diff --git a/lib/template/header.php b/lib/template/header.php index 5a365b9..59d145d 100644 --- a/lib/template/header.php +++ b/lib/template/header.php @@ -46,11 +46,16 @@ else } ?> - <?php echo t('Jirafeau, your web file repository'); ?> + <?php echo (true === empty($cfg['title']))? t('Jirafeau, your web file repository') : $cfg['title']; ?> +
-

+

+ + + +

-- 2.34.1 From 7adb69c9ae18d7f72798692d6c22925e53932a72 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Tue, 17 Jan 2017 16:12:07 +0100 Subject: [PATCH 13/16] [FEATURE] Footer: Nicer project title --- lib/locales/template.json | 1 + lib/template/footer.php | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/locales/template.json b/lib/locales/template.json index 0c780f7..6b682c0 100644 --- a/lib/locales/template.json +++ b/lib/locales/template.json @@ -8,6 +8,7 @@ "Time limit": "", "Maximum file size": "Taille maximale", "powered by Open-Source project Jirafeau": "", + "Made with": "", "Jirafeau Project": "", "One minute": "", "One hour": "", diff --git a/lib/template/footer.php b/lib/template/footer.php index 3abc290..85bda50 100644 --- a/lib/template/footer.php +++ b/lib/template/footer.php @@ -1,16 +1,18 @@