diff --git a/README.md b/README.md
index c81af09..46c8c1c 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,4 @@
-# bozon_ynh
\ No newline at end of file
+# BoZoN package for YunoHost
+
+* [BoZoN website](http://bozon.pw)
+* [YunoHost website](https://yunohost.org/)
diff --git a/conf/nginx.conf b/conf/nginx.conf
new file mode 100644
index 0000000..074f145
--- /dev/null
+++ b/conf/nginx.conf
@@ -0,0 +1,23 @@
+location YNH_EXAMPLE_PATH {
+ # Path to source
+ alias YNH_EXAMPLE_ALIAS ;
+ if ($scheme = http) {
+ rewrite ^ https://$server_name$request_uri? permanent;
+ }
+ client_max_body_size 10G;
+ # Example PHP configuration
+ index index.php;
+ try_files $uri $uri/ index.php;
+ location ~ [^/]\.php(/|$) {
+ fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
+ fastcgi_index index.php;
+ include fastcgi_params;
+ fastcgi_param REMOTE_USER $remote_user;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ }
+
+ # Include SSOWAT user panel.
+ include conf.d/yunohost_panel.conf.inc;
+}
diff --git a/manifest.json b/manifest.json
new file mode 100644
index 0000000..f4e928c
--- /dev/null
+++ b/manifest.json
@@ -0,0 +1,80 @@
+{
+ "name": "BoZoN",
+ "id": "bozon",
+ "description": {
+ "en": "Minimalist Drag & drop file sharing app",
+ "fr": "Application minimaliste de partage de fichiers"
+ },
+ "url": "http://bozon.pw",
+ "license": "free",
+ "developer": {
+ "name": "ewilly",
+ "email": "ewilly@neuf.fr"
+ },
+ "multi_instance": "false",
+ "services": [
+ "nginx",
+ "php5-fpm"
+ ],
+ "arguments": {
+ "install" : [
+ {
+ "name": "domain",
+ "type": "domain",
+ "ask": {
+ "en": "Choose a domain for BoZoN",
+ "fr": "Choisissez un domaine pour BoZoN"
+ },
+ "example": "domain.org"
+ },
+ {
+ "name": "path",
+ "type": "path",
+ "ask": {
+ "en": "Choose a path for BoZoN",
+ "fr": "Choisissez un chemin pour BoZoN"
+ },
+ "example": "/bozon",
+ "default": "/bozon"
+ },
+ {
+ "name": "admin",
+ "type": "user",
+ "ask": {
+ "en": "Choose an admin user for BoZoN",
+ "fr": "Choisissez un administrateur pour BoZoN"
+ },
+ "example": "homer"
+ },
+ {
+ "name": "password",
+ "type": "password",
+ "ask": {
+ "en": "Choose an admin password for BoZoN",
+ "fr": "Choisissez un mot de passe administrateur pour BoZoN"
+ },
+ "example": "super_secret_password"
+ },
+ {
+ "name": "public_site",
+ "ask": {
+ "en": "Should this application be public ?",
+ "fr": "Est-ce que cette application doit être visible publiquement ?"
+ },
+ "choices": ["Yes", "No"],
+ "default": "Yes"
+ },
+ {
+ "name": "default_lang",
+ "ask": {
+ "en": "Default language",
+ "fr": "Langue par défaut"
+ },
+ "choices": ["de","en","es","fr","it","nl","pl","pt","po","ro","ru"],
+ "default": "en"
+ }
+
+
+ ]
+ }
+}
diff --git a/scripts/backup b/scripts/backup
new file mode 100644
index 0000000..74de43b
--- /dev/null
+++ b/scripts/backup
@@ -0,0 +1,19 @@
+#! /bin/bash
+
+# causes the shell to exit if any subcommand or pipeline returns a non-zero status
+set -e
+
+app=bozon
+app_path=/var/www/$app
+data_path=/home/yunohost.app/$app
+save_path=$1
+
+# Backup sources & data
+ sudo mkdir -p $save_path/data
+ sudo cp -R $app_path $save_path
+ sudo cp -R $data_path $save_path/data
+
+# Copy Nginx and YunoHost parameters to make the script "standalone"
+ sudo cp -a /etc/yunohost/apps/$app/. save_path/yunohost
+ domain=$(sudo yunohost app setting $app domain)
+ sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf save_path/nginx.conf
diff --git a/scripts/install b/scripts/install
new file mode 100644
index 0000000..6dd9895
--- /dev/null
+++ b/scripts/install
@@ -0,0 +1,109 @@
+#! /bin/bash
+
+app=bozon
+
+#retrieve arguments
+domain=$1
+path=$2
+admin=$3
+password=$4
+is_public=$5
+default_lang=$6
+
+# Remove trailing slash
+[ "$path" != "/" ] && path=${path%/}
+
+# Check domain/path availability
+sudo yunohost app checkurl $domain$path -a $app
+if [[ ! $? -eq 0 ]]; then
+ exit 1
+fi
+
+# Check user
+sudo yunohost user list --json | grep -q "\"username\": \"$admin\""
+if [[ ! $? -eq 0 ]]; then
+ echo "Wrong user"
+ exit 1
+fi
+
+# Save app settings
+sudo yunohost app setting $app admin -v "$admin"
+sudo yunohost app setting $app is_public -v "$is_public"
+sudo yunohost app setting $app domain -v "$domain"
+sudo yunohost app setting $app path -v "$path"
+
+#create path for copying
+final_path=/var/www/$app
+sudo mkdir -p $final_path
+data_path=/home/yunohost.app/$app
+sudo mkdir -p $data_path
+
+#copy files to final folder and set permissions
+sudo cp -R ../sources/* $final_path/
+sudo find $final_path -type f -name ".htaccess" | xargs sudo rm
+
+#setup permissions
+sudo chown -R root: $final_path
+sudo find $final_path -type f | xargs sudo chmod 644
+sudo find $final_path -type d | xargs sudo chmod 755
+sudo chown -R www-data: $data_path
+sudo find $data_path -type f | xargs sudo chmod 644
+sudo find $data_path -type d | xargs sudo chmod 755
+
+#configure nginx settings
+folder_path=${path%/}
+sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
+# If path is only / (without subfolder), add trailing slash to alias
+alias_path=$final_path
+[ "$path" == '/' ] && alias_path=$alias_path'/'
+sudo sed -i "s@YNH_EXAMPLE_ALIAS@$alias_path@g" ../conf/nginx.conf
+sudo sed -i "s@YNH_EXAMPLE_FOLDER@$folder_path@g" ../conf/nginx.conf
+sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
+
+#temporary set public accessible
+sudo yunohost app setting $app unprotected_uris -v "/"
+
+# Restart services
+sudo service nginx reload
+sudo yunohost app ssowatconf
+
+#temporary add domain name to /etc/hosts
+sudo sed -i "1 i\127.0.0.1 $domain #bozon_hosts" /etc/hosts
+
+#make request to install app
+#get the html page
+curl_path=$([ "$path" == "/" ] || echo $path)
+#curl -kL -o install_page.html https://$domain$curl_path/index.php?p=admin >/dev/null 2>&1
+
+
+#get the token for form validation
+#token=$(cat install_page.html | grep "input" | grep "token" | tail -1 | cut -d' ' -f3 | cut -d'"' -f2)
+#send http POST values
+#curl -k -X POST \
+ --data-urlencode "default_lang=$default_lang" \
+ --data-urlencode "install=Installer" \
+ --data-urlencode "name=$admin" \
+ --data-urlencode "login=$admin" \
+ --data-urlencode "pwd=$password" \
+ --data-urlencode "pwd2=$password" \
+ --data-urlencode "token=$token" \
+ https://$domain$curl_path/index.php?p=admin > /dev/null 2>&1
+
+#remove domain name from /etc/hosts
+sudo sed -i "/#bozon_hosts/d" /etc/hosts
+
+# If app is private, remove url to SSOWat conf from skipped_uris
+if [ "$is_public" = "No" ];
+then
+ sudo yunohost app setting $app unprotected_uris -d
+fi
+
+#adding admin to the allowed users
+sudo yunohost app addaccess $app -u $admin
+
+#allow only allowed users to access admin panel
+#sudo yunohost app setting bozon protected_uris -v "/core/admin/"
+
+# Restart services
+sudo service nginx reload
+sudo yunohost app ssowatconf
diff --git a/scripts/remove b/scripts/remove
new file mode 100644
index 0000000..496b789
--- /dev/null
+++ b/scripts/remove
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+app=bozon
+domain=$(sudo yunohost app setting $app domain)
+
+sudo rm -rf /var/www/$app
+sudo rm -rf /home/yunohost.app/$app
+sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
diff --git a/scripts/restore b/scripts/restore
new file mode 100644
index 0000000..7ed81fa
--- /dev/null
+++ b/scripts/restore
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+app=bozon
+app_path=/var/www/$app
+data_path=/home/yunohost.app/$app
+save_path=$1
+
+sudo mv $save_path $app_path
+sudo mv $app_path/data $data_path
+sudo rm -rf $app_path/data
+sudo chown -R www-data: $data_path
diff --git a/scripts/upgrade b/scripts/upgrade
new file mode 100644
index 0000000..8b759ed
--- /dev/null
+++ b/scripts/upgrade
@@ -0,0 +1,41 @@
+#! /bin/bash
+
+app=bozon
+
+#retrieve arguments
+domain=$(sudo yunohost app setting $app domain)
+path=$(sudo yunohost app setting $app path)
+admin=$(sudo yunohost app setting $app admin)
+is_public=$(sudo yunohost app setting $app is_public)
+
+
+# Remove trailing "/" for next commands
+path=${path%/}
+
+# Copy source files
+final_path=/var/www/$app
+sudo mkdir -p $final_path
+sudo cp -a ../sources/* $final_path
+sudo find $final_path -type f -name ".htaccess" | xargs sudo rm
+sudo rm $final_path/install.php
+
+sudo chown -R root: $final_path
+sudo chown -R www-data: $final_path/data
+sudo find $final_path -type f | xargs sudo chmod 644
+sudo find $final_path -type d | xargs sudo chmod 755
+
+
+#configure nginx settings
+sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
+sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path@g" ../conf/nginx.conf
+sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
+
+# If app is public, add url to SSOWat conf as skipped_uris
+if [ "$is_public" = "Yes" ];
+then
+ sudo yunohost app setting $app unprotected_uris -v "/"
+fi
+
+# Restart services
+sudo service nginx reload
+sudo yunohost app ssowatconf
diff --git a/sources/LICENCE.md b/sources/LICENCE.md
new file mode 100644
index 0000000..6b80c84
--- /dev/null
+++ b/sources/LICENCE.md
@@ -0,0 +1,201 @@
+
+ Copyright (C) 2016 bronco@warriordudimanche.net
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+
+
+
+#GNU AFFERO GENERAL PUBLIC LICENSE
+
+##Version 3, 19 November 2007
+
+###Copyright © 2007 Free Software Foundation, Inc.
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+##Preamble
+
+The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
+
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
+
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
+
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+##TERMS AND CONDITIONS
+
+0. Definitions.
+"This License" refers to version 3 of the GNU Affero General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based on the Program.
+
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Remote Network Interaction; Use with the GNU General Public License.
+Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
+
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
+
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/sources/changelog.md b/sources/changelog.md
new file mode 100644
index 0000000..0bdb464
--- /dev/null
+++ b/sources/changelog.md
@@ -0,0 +1,131 @@
+
+# Version history
+## New in 2.4
+- optimisation : reduce slow down when folder tree contains a huge amount of files (tested with more than 30,000 files ^^ thx to Cyrille)
+- optimisation : reduce regen base use to reduce useless files scans (even for zip to folder option)
+- Added : volume option for playlist
+- Enhancement : unzipping file on server creates a new folder
+- Added : zip and download selection of files and folders
+- Added : in public access to a folder can now fold/unfold the folders.
+- Added : a regen base button for the admins who use FTP access instead of the bozon's upload (adds the new IDs, removes the old one and rebuilds the tree)
+- Added : a temp cleaning procedure
+- Added : a $default_temp_folder variable in config.php
+- Added : a load more button in admin list files (for those who save thousands of files in the same directory ^^ wink to Cyrille (again))
+- Added : a config variable to choose between two click on file options.
+- Enhancement : change some js functions to use my own vanillajs lib
+- Enhancement : share button will no longer appear when there's only one user
+- Enhancement : Some little changes in the design
+- Bugfix : the locked folder now works again correctly
+- Added : language choice is now saved in the user profile
+- Added : three status for users (admin/user/guest). The first user created is now superadmin.
+- Enhancement : the drag and drop fallback now accepts multiselection
+- Added : a markdown editor to quickly create a new document and share it or edit a text file (still a beta feature but it works)
+- Enhancement : users page is now available only if there's more than one user
+- Enhancement : users page design
+- Enhancement : change png icons to webfont (thx fontello ^^) 56k -> 9k \o/
+- Enhancement : change users management page (tabs instead of dialog boxes)
+- Added : Superadmin can now change the user's password
+- Added : brand new profiles rights managing; now, you can create new profiles and allow acces to specific parts of the app to those profiles.
+- Added : . and .. in file list
+- Added : download a zip from a shared folder on visitor's access
+- Added : config variable to allow or not rss/json/download from user shared access
+- Added : warnings if required libs are not installed; however, bozon can work without those libs (some functions will be disabled) and if you want to disable those warnings, go to config.php and set $disable_non_installed_libs_warning to true
+- Bugfix : encoding accents problems
+- Bugfix : refresh needed when adding or deleting a user
+- Added : config variable to use lightbox or new tab to open images/txt etc
+- Enhancement : lightbox
+- Bugfix : shared links works again
+- Enhancement/Bugfix : when you renew a shared folder id, the id will change in the shared file or will be removed from it (see $remove_item_from_users_share_when_renew_id in config.php)
+
+
+## New in 2.3b
+- Added : folder size limit for users (if there's no limit, the free space icon will not display)
+- Added : display free space in user's folder (this information will not display if admin or if allowed free space is set to 0)
+- Added : display folder size
+- Added : lazy load for gallery http://dinbror.dk/blazy/
+- Added : a minimalist lightbox
+- Bugfixes : links lost when moving a file/folder, video name in gallery mode...
+- Enhancement : brand new html/css structure by Eauland.
+- Enhancement : new table based file list
+- Added : some information on homepage
+- Added : qrcode on share page
+- Added : playlist audio. If a folder only contains mp3/ogg, it'll be shared as a playlist
+- Added : a shortcut to share link in links mode
+- Added : an icon to go directly to a gallery or a playlist in file mode
+- Changed : the dropzone is now hidden by default: click on upload button or drag a file on it to reveal the dropzone
+- Added : an option to easily change the colors: just change the values in template/default/css/styles.php !
+- Changed : color
+- Removed : old time forgotten javascript in stats.php
+- Added : scrolltotop from Cyril MAGUIRE
+- Added : download from url allows to specify a local filename
+- Added : a required state for important fields in dialog boxes
+- Bugfix : remove exif error on thumb generation
+- Added : sorting filelist by name or size
+- Enhancement : A burn mode id stays in burn mode when accessed by the connected owner (id will be burned only if not connected or not owner)
+- Bugfix : security bug
+- Added : multiselection to delete files/folders
+
+## New in 2.2beta
+- Added : double check for the password on profile creation
+- Added : password change for user connected
+- Added : markdown display for md files
+- Added : qrcode to easily get a share on smartphone
+- Added : secured rss feed for log file
+- Added : share folders between users \o/
+- Added : changes on files/folders only allowed to the owner
+- Bugfixes: htaccess problems, catching distant file path problem, some css problems
+
+## New in 2.1
+### /!\ Read carefully to avoid data loss !
+- added a top bar menu
+- added a minimalist auto gallery function: when a folder contains only images, it will be displayed as a gallery for the user.
+- bug fix on rss feed and share links
+- Added multiuser capacity ! Now, the admin (the first user) can create new users. Each user has his own separated upload folder.
+- Added a import script: beacause of multiuser change, the ID file, the upload folder, the users data has a new format...
+If you're upgrading from 2.0 or less, keep only private and upload folders, install bozon.
+When you first start, it will ask you if you want to import previous data.
+
+## New in 2.0 beta
+- major changes in bozon's structure: all is called from index page
+- real home page
+- major design improvements: lighter, no more menu etc.
+- bugfixes
+- all pages'files are now in the template folder (easier to modify)
+- html files replace the variable template (easier for designers ;-)
+- language files are now seperated in a locale folder
+- language can now also be changed in user mode (not only admin)
+- default language: set at browser default if not specified in config
+
+## New in 1.7.5b
+- added a function to erase no longuer used ids
+- bugfix with file with accent on first char: a basename function bug ! oO
+
+## New in 1.7.5
+- change in the templates: templates are now html files, easier to modify
+- added the mode in the file list's title.
+
+
+## New in 1.7.4
+bug fixes (thx to chatainsim on Github)
+- #56: problem deleting a folder
+- #53: error deleting files you just uploaded
+- #55: password protection problem when a password is used for several files (caution, this fix is not compatible with old password protection)
+- disapearing files and folders until page is refreshed.
+- my blog's URL removed (too «hasbeen»: wink to eauland ;-)
+
+
+## New in 1.7.3
+- some bugs fixed (rename bug, home icon bug)
+- little changes on resolutions below 600 (switch from icon to list view)
+- added handheld rule for media queries
+
+
+## New in 1.7.2
+- new list layout (change layout in config or in menu)
+- change theme with get variable theme=xxx
+-
+
+## New in 1.7
+* serious security enhancement by Oros ( https://www.ecirtam.net / https://github.com/Oros42 ) (Thanks a lot for this huge job !)
+* add: a link to clear stats
+* BEWARE! Because of the new data & files structure, all previous generated IDs will no longer be valid.
diff --git a/sources/config.php b/sources/config.php
new file mode 100644
index 0000000..6d2eaba
--- /dev/null
+++ b/sources/config.php
@@ -0,0 +1,55 @@
+
\ No newline at end of file
diff --git a/sources/contributors.md b/sources/contributors.md
new file mode 100644
index 0000000..548f8e1
--- /dev/null
+++ b/sources/contributors.md
@@ -0,0 +1,9 @@
+## Contributors
+
+- [aledeg](https://github.com/aledeg)
+- [ankerfest](https://github.com/ankerfest)
+- [eauland](https://github.com/eauland)
+- [Oros42](https://github.com/Oros42)
+
+## Special thanks
+- [Cyrille Borne](https://github.com/cborne) (http://www.cyrille-borne.com): without your comments, issues reporting and enhancement ideas this app would never have been so complete ;-)
diff --git a/sources/core/.htaccess b/sources/core/.htaccess
new file mode 100644
index 0000000..ebe8b76
--- /dev/null
+++ b/sources/core/.htaccess
@@ -0,0 +1,4 @@
+Order Allow,Deny
+
+Allow from all
+
diff --git a/sources/core/Array2feed.php b/sources/core/Array2feed.php
new file mode 100644
index 0000000..44aa550
--- /dev/null
+++ b/sources/core/Array2feed.php
@@ -0,0 +1,76 @@
+ array
+ # for rss type feed, each item must have the 'title', 'description', 'pubDate' and 'link' keys
+ # for atom type feed, info must have the 'title', 'id', 'updated, 'link' & 'content' keys
+function makeRSSdate($date=NULL){// format DD-MM-YY HH:MM => rfc2822 (rss compatible)
+ if ($date){
+ date_default_timezone_set('Europe/Paris');
+ $time = strtotime($date);
+ return date("r", $time);
+ }
+}
+function no_nl($string){$tab = array( CHR(13) => " ", CHR(10) => " " ); return strtr($string,$tab); }
+function array2feed($array=null){
+
+
+ if (!$array){return false;}
+ if (empty($array['infos']['type'])){$array['infos']['type']='rss';}else{$array['infos']['type']=strtolower($array['infos']['type']);}
+ if (empty($array['infos']['description'])){$array['infos']['description']='';}
+ $r="\n";$t="\t";
+ $tpl=array('rss'=>array(),'atom'=>array());
+ $tpl['rss']['header']=''.$r.''
+ .$r.$t.''.$r;
+ $tpl['atom']['header']=''.$r;
+ $tpl['rss']['footer']=$t.' '.$r;
+ $tpl['atom']['footer']=''.$r;
+ $tpl['rss']['content-type']='Content-Type: application/rss+xml; charset=utf-8';
+ $tpl['atom']['content-type']='Content-Type: application/atom+xml; charset=utf-8';
+
+ header($tpl[$array['infos']['type']]['content-type']);
+ $feed=$tpl[$array['infos']['type']]['header'];
+ //create the feed's info content
+ foreach($array['infos'] as $key=>$value){
+ if ($array['infos']['type']=='atom'){ // ATOM
+ if ($key=='link'){$feed.=$t.$t.' '.$r;}
+ elseif ($key=='author'){$feed.=$t.$t.''.$value.' '.$r;}
+ elseif ($key=='licence'){$feed.=$t.$t.'<'.$key.' href="'.$value.'" rel="license"/>'.$r;} // in atom feed, licence is the link to the licence type
+ elseif ($key!='version'&&$key!='type'){$feed.=$t.$t.'<'.$key.'>'.$value.''.$key.'>'.$r;}
+ }else{ // RSS
+ if ($key!='version'&&$key!='type'){$feed.=$t.$t.'<'.$key.'>'.$value.''.$key.'>'.$r;}
+ }
+ }
+
+ //then the items content
+ foreach ($array['items'] as $item){
+ if ($array['infos']['type']=='atom'){ $feed.=$t.$t.$t.''.$r;}else{$feed.=$t.$t.$t.'- '.$r;}
+ foreach($item as $key=>$value){
+ if ($array['infos']['type']=='atom'){ // ATOM
+ if ($key=='link'){$feed.=$t.$t.$t.$t.'
'.$r;}
+ elseif ($key=='content'){$feed.=$t.$t.$t.$t.''.htmlspecialchars($value).' '.$r;}
+ elseif (!empty($value)){$feed.=$t.$t.$t.$t.'<'.$key.'>'.no_nl($value).''.$key.'>'.$r;}
+ }else{ // RSS
+ if ($key=='pubDate'||$key=='title'||$key=='link'){$feed.=$t.$t.$t.$t.'<'.$key.'>'.htmlspecialchars($value).''.$key.'>'.$r;}
+ elseif ($key=='date'){}
+ elseif($key=='guid'){ $feed.=$t.$t.$t.$t.' '.$r;}
+ elseif(!empty($value)){$feed.=$t.$t.$t.$t.'<'.$key.'>'.$key.'>'.$r;}
+ }
+ }
+ if ($array['infos']['type']=='atom'){ $feed.=$t.$t.$t.' '.$r;}else{$feed.=$t.$t.$t.''.$r;}
+ }
+
+
+ $feed.=$tpl[$array['infos']['type']]['footer'];
+ echo $feed;
+}
+?>
\ No newline at end of file
diff --git a/sources/core/GET_POST_admin_data.php b/sources/core/GET_POST_admin_data.php
new file mode 100644
index 0000000..c053fce
--- /dev/null
+++ b/sources/core/GET_POST_admin_data.php
@@ -0,0 +1,367 @@
+'.$file.' '.e('is not writable',false).'';}
+ }
+ }
+
+ # regen tree
+ if (isset($_GET['regen'])){
+ $ids=updateIDs($ids,$_GET['regen']);
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # unzip: convert zip file to folder
+ if (!empty($_GET['unzip']) && trim($_GET['unzip'])!==false && $_SESSION['zip']){
+ $id=$_GET['unzip'];
+ $zipfile=id2file($id);
+ $folder=str_ireplace('.zip','',_basename($zipfile));
+ $id=new_folder($folder);
+ $destination=id2file($id);
+ unzip($zipfile,$destination);
+ $sdi=array_flip($ids);
+ $unzipped_content=recursive_glob($destination);
+ foreach ($unzipped_content as $item){
+ if (empty($sdi[$item])){$ids[uniqid(true)]=$item;}
+ }
+ store($ids);
+ //$ids=updateIDs($ids,$id);
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # renew file id
+ if (!empty($_GET['renew']) && trim($_GET['renew'])!==false&&is_owner($_GET['renew'])){
+ $old_id=$_GET['renew'];
+ $path=id2file($old_id);
+ unset($ids[$old_id]);
+ $new_id=addID($path,$ids);
+ # change in share folder
+
+ if (is_dir($path)){
+ $shares=load_folder_share();
+ $save=false;
+ foreach ($shares as $user=>$data){
+ if (!empty($data[$old_id])){
+ if (!$remove_item_from_users_share_when_renew_id){
+ $shares[$user][$new_id]=$data[$old_id];
+ }
+ unset($shares[$user][$old_id]);$save=true;
+ }
+ }
+ if ($save){save_folder_share($shares);}
+ }
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # create burn after acces state
+ if (!empty($_GET['burn']) && trim($_GET['burn'])!==false&&is_owner($_GET['burn'])){
+ $id_to_burn=$_GET['burn'];
+ $path=id2file($id_to_burn);
+ unset($ids[$id_to_burn]);
+ if ($id_to_burn[0]!='*'){
+ $ids['*'.$id_to_burn]=$path;
+ }else{
+ $ids[str_replace('*','',$id_to_burn)]=$path;
+ }
+ store($ids);
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # subfolder path
+ if (!empty($_GET['path']) && trim($_GET['path'])!==false){
+ $path=$_GET['path'];
+ if($path=='/'){
+ $path='';
+ }
+ if(check_path($path)){
+ $_SESSION['current_path']=$path;
+ }
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # search/filter
+ if (!empty($_GET['filter'])){
+ $_SESSION['filter']=$_GET['filter'];
+ }else{
+ $_SESSION['filter']='';
+ }
+
+ # file mode
+ if (!empty($_GET['mode'])){
+ $_SESSION['mode']=$_GET['mode'];
+ }elseif (empty($_SESSION['mode'])){
+ $_SESSION['mode']='view';
+ }
+
+ # create a new subfolder
+ if (!empty($_GET['newfolder'])){
+ $folder=$_GET['newfolder'];
+ if(check_path($folder)){
+ $tree=add_branch($folder,new_folder($folder)); # $path,$id
+ header('location:index.php?p=admin&msg='.$folder.' '.e('created',false).'&token='.TOKEN);
+ exit;
+ }
+
+ }
+
+ # get file from url
+ if (!empty($_GET['url'])&&$_GET['url']!='' && $_SESSION['curl']){
+ if ($content=file_curl_contents($_GET['url'])){
+ if (empty($_GET['filename'])){
+ $basename=_basename($_GET['url']);
+ }else{
+ $basename=no_special_char($_GET['filename']);
+ }
+
+ $folder_path=$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$_SESSION['current_path'].'/';
+ $filename=$folder_path.$basename;
+ if(is_file($filename)){
+ $filename=$folder_path.rename_item($filename,$folder_path);
+ }
+ file_put_contents($filename,$content);
+
+ $tree=add_branch($filename,addID($filename));
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }else{$message.='
'.e('Problem accessing remote file.',false).'
';}
+ }
+
+ # delete SINGLE file/folder
+ if (!empty($_GET['del'])&&$_GET['del']!=''&&is_owner($_GET['del'])){
+ $tree=delete_file_or_folder($_GET['del'],$ids,$tree);
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # rename file/folder
+ if (!empty($_GET['id'])&&!empty($_GET['newname'])&&is_owner($_GET['id'])){
+ $oldfile=id2file($_GET['id']);
+ $path=dirname($oldfile).'/';
+ $newfile=$path.no_special_char($_GET['newname']);
+ if ($newfile!=$oldfile && check_path($newfile)){
+ # if newname exists, change newname
+ if(is_file($newfile) || is_dir($newfile)){aff($newfile.' '.$oldfile);
+ $newfile=$path.rename_item(_basename($newfile),$path);
+ }
+ if (is_dir($oldfile)){
+ # for folders, must change the path in all sub items
+ $old=$oldfile;
+ $old.='/';
+ foreach($ids as $id=>$path){
+ if (strpos($path,$old)!==false){$ids[$id]=str_replace($old, $newfile.'/', $path);}
+ }
+
+ };
+ $ids[$_GET['id']]=$newfile;
+ store($ids);
+ rename($oldfile,$newfile);
+ if (is_file(get_thumbs_name($oldfile))){rename(get_thumbs_name($oldfile),get_thumbs_name($newfile));}
+ $tree=rename_branch($newfile,$oldfile,$_GET['id'],$_SESSION['login'],$tree);
+ }
+
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # zip and download a folder
+ if (!empty($_GET['zipfolder']) && $_SESSION['zip']){
+ $folder=id2file($_GET['zipfolder']);
+ if (!is_dir($_SESSION['temp_folder'])){mkdir($_SESSION['temp_folder']);}
+ $zipfile=$_SESSION['temp_folder'].return_owner($_GET['zipfolder']).'-'._basename($folder).'.zip';
+ zip($folder,$zipfile);
+ header('location: '.$zipfile);
+ exit;
+ }
+
+ ######################################################################
+ # $_POST DATA
+ ######################################################################
+ # Move file folder
+ if (!empty($_POST['file'])&&!empty($_POST['destination'])){
+ # init
+ $destination=$to=$_POST['destination'];
+ $file=$_POST['file'];$me=_basename($file);
+ if($destination=='/'){ $destination=''; }
+ if($file=='/'){ $file=''; }
+ $file_with_path=$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$file;
+ $destination=$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$destination;
+
+ if (check_path($file) && check_path($destination)){
+ if (is_file($file_with_path)){$file=$file_with_path;}
+ $file=$file_with_path;
+ $file=stripslashes($file);
+ $destination_temp = addslash_if_needed($destination)._basename($file);
+ # if file/folder exists in destination folder, change name
+ if(is_file($destination_temp) || is_dir($destination_temp)){
+ $destination_temp=addslash_if_needed($destination).rename_item(_basename($file),$destination);
+ }
+ $destination=$destination_temp;
+
+ if (!is_dir(dirname('thumbs/'.$destination))){
+ mkdir(dirname('thumbs/'.$destination),0744, true);
+ }
+ @rename(get_thumbs_name($file_with_path),get_thumbs_name($destination));
+
+ if (is_file($file_with_path)){
+ # change path in id
+ $id=file2id($file_with_path);
+ $ids=unstore();
+ $ids[$id]=$destination;
+ store($ids);
+ rename($file_with_path,$destination);
+ $tree=rename_branch($destination,$file_with_path,$id,$_SESSION['login'],$tree);
+ }elseif(is_dir($file_with_path)){
+ # change path in id and all files/folders in the moved folder
+ $id=file2id($file_with_path);
+ $ids=unstore();
+ $ids[$id]=$destination;
+ $destination=$destination.'/';
+ $file=$file.'/';
+ foreach($ids as $id=>$path){
+ if (strpos($path, $file)!==false){$ids[$id]=str_replace($file,$destination, $path);}
+ }
+ store($ids);
+ rename($file_with_path,$destination);
+ $tree=rename_branch($destination,$file_with_path,$id,$_SESSION['login'],$tree);
+ }
+
+ }
+
+ header('location:index.php?p=admin&msg='.$me.' '.e('moved to',false).' '.$to.'&token='.TOKEN);
+ exit;
+ }
+
+ # Delete multiselection
+ if (!empty($_POST['item']) && !empty($_POST['multiselect_command']) && $_POST['multiselect_command']=='delete'){
+ foreach ($_POST['item'] as $key => $item) {
+ if (is_owner($item)){
+ $tree=delete_file_or_folder($item,$ids);
+ }
+ }
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # zip multiselection
+ if (!empty($_POST['item']) && !empty($_POST['multiselect_command']) && $_POST['multiselect_command']=='zip' && $_SESSION['zip']){
+ $zipfile=$_SESSION['temp_folder'].'Bozon_pack'.date('d-m-Y h-i-s').'.zip';
+ $file_list=array();
+ foreach ($_POST['item'] as $key => $item) {
+ $file_list[]=id2file($item);
+ }
+ if (!is_dir($_SESSION['temp_folder'])){mkdir($_SESSION['temp_folder']);}
+ zip($file_list,$zipfile);
+ header('location: '.$zipfile);
+ exit;
+ }
+
+ # Lock folder with password
+ if (!empty($_POST['password'])&&!empty($_POST['id'])&&is_owner($_POST['id'])){
+ $id=$_POST['id'];
+ $file=id2file($id);
+ $password=blur_password($_POST['password']);
+ # turn normal share id into password hashed id
+ $ids=unstore();
+ unset($ids[$id]);
+ $ids[$password.$id]=$file;
+ store($ids);
+
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # Handle folder share with users
+ if (!empty($_GET['users'])&&!empty($_GET['share'])&&is_owner($_GET['share'])){
+ $folder_id=$_GET['share'];
+ $users=$auto_restrict['users'];
+ unset($users[$_SESSION['login']]);
+ $shared_with=load_folder_share();
+ $sent=array_flip($_GET['users']);
+ foreach ($users as $login=>$data){
+ if (isset($sent[$login])){
+ # User checked: add share
+ $shared_with[$login][$folder_id]=array('folder'=>id2file($folder_id),'from'=>$_SESSION['login']);
+ }else{
+ # User not checked: remove share if exists
+ if (isset($shared_with[$login][$folder_id])){unset($shared_with[$login][$folder_id]);}
+ }
+ }
+ save_folder_share($shared_with);
+ header('location:index.php?p=admin&token='.TOKEN);
+ exit;
+ }
+
+ # Handle users rights
+ if (isset($_POST['user_right'])&&is_allowed('change status rights')){
+ foreach($_POST['user_right'] as $key=>$user_nb){
+ $users_rights[$_POST['user_name'][$key]]=$user_nb;
+ }
+ save_users_rights($users_rights);
+ header('location:index.php?p=users&token='.TOKEN.'&msg='.e('Changes saved',false));
+ exit;
+ }
+
+ # Handle superadmin request for users pass change
+ if (isset($_POST['user_pass'])&&is_allowed('change passes')){
+ foreach($_POST['user_pass'] as $key=>$pass){
+ if (!empty($_POST['user_pass'][$key])&&!empty($_POST['user_name'][$key])){
+ $auto_restrict['users'][$_POST['user_name'][$key]]['pass'] = hash('sha512', $auto_restrict['users'][$_POST['user_name'][$key]]['salt'].$pass);
+ }
+ }
+ save_users();
+ header('location:index.php?p=edit_profiles&token='.TOKEN.'&msg='.e('Changes saved',false));
+ exit;
+ }
+
+ # Handle profile's rights change
+ if (isset($_POST['profile_name'])&&is_allowed('change user status')){
+ $rights=array();
+ foreach($_POST['profile_name'] as $num=>$profile){
+ if (!empty($_POST[$num])){
+ foreach($_POST[$num] as $allowed){$rights[$profile][$allowed]=1;}
+ }else{$rights[$profile]=array();}
+ }
+ save($_SESSION['profiles_rights_file'],$rights);
+ header('location:index.php?p=edit_profiles&token='.TOKEN.'&msg='.e('Changes saved',false));
+ exit;
+ }
+
+ # Editor
+ if (isset($_POST['editor_content'])&&!empty($_POST['editor_filename'])&&is_allowed('markdown editor')){
+ $extension=pathinfo($_POST['editor_filename'],PATHINFO_EXTENSION);
+ if (empty($extension)){$_POST['editor_filename'].='.md';}
+ $file=no_special_char($_POST['editor_filename']);
+ $path=addslash_if_needed($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$_SESSION['current_path']);
+ if (is_file($path.$file)&&!isset($_POST['overwrite'])){$file=rename_item($file,$path);}
+ file_put_contents($path.$file, $_POST['editor_content']);
+ if (!isset($_POST['overwrite'])){
+ $id=addID($path.$file);
+ $tree=add_branch($path.$file,$id,$_SESSION['login'],$tree);
+ }
+ header('location:index.php?p=admin&token='.TOKEN.'&msg='.$_POST['editor_filename'].' '.e('Changes saved',false));
+ exit;
+ }
+
+ if ($_FILES&&is_allowed('upload')){include('core/auto_dropzone.php');exit();}
+?>
\ No newline at end of file
diff --git a/sources/core/auto_dropzone.php b/sources/core/auto_dropzone.php
new file mode 100644
index 0000000..cdfa26f
--- /dev/null
+++ b/sources/core/auto_dropzone.php
@@ -0,0 +1,469 @@
+'path/to/',
+ 'dropzone_text'=>'D&D here !',
+ 'dropzone_id'=>'drop_images',
+ 'dropzone_class'=>'drop_images',
+ 'forbidden_filetypes'=>'exe,php',
+ 'use_style'=>true, // false if you're using an css file
+ );
+
+ 'destination_filepath' key:'destination_filepath'=>"$_SESSION['upload_root_path']/" (with ending slash)
+ if not specified, the destination folder will be destination/ (created on the first start)
+ you also can set specific paths for each mime type like that
+ 'destination_filepath'=>array('gif'=>'path/to/gif/','png'=>'path/to/png/' ... )
+
+ 'forbidden_filetypes' key: restrict allowed filetypes (separated with ,)
+ ----------------------------------------------
+
+* this is the default config
+*/
+
+// Configuration
+$phpini=ini_get_all();
+$default_config=array(
+ 'forbidden_filetypes'=>'php',
+ 'allow_unknown_filetypes'=>$allow_unknown_filetypes,
+ 'use_style'=>false, // false if you're using a external css file
+ 'auto_refresh_after_upload'=>true, // auto refresh page after uploading files (except on errors)
+ 'max_length'=>2048, // Mo (see php.ini if changes doesn't work [post_max_size / upload_max_filesize])
+ 'dropzone_text'=>e('Drop your files here or click to select a local file',false),
+ 'dropzone_id'=>'dropArea',
+ 'dropzone_class'=>'dropArea',
+ 'destination_filepath'=>$_SESSION['current_path'].'/', // this can be an array like 'jpg'=>'upload/jpeg/' or a string 'destination/'
+ 'my_filepath'=>'index.php'//$_SERVER['SCRIPT_NAME'],
+);
+
+foreach($default_config as $key=>$val){
+ // create or complete config var
+ if(!isset($auto_dropzone[$key])){ $auto_dropzone[$key]=$auto_dropzone[$key]=$val;}
+
+ // has config changed ?
+ if (!isset($_SESSION[$key]) || $auto_dropzone[$key]!=$_SESSION[$key]){ $_SESSION[$key]=$auto_dropzone[$key];}
+}
+
+if (!is_array($auto_dropzone['destination_filepath'])&&!is_dir($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath'])){
+ mkdir($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath'],0744);file_put_contents($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath'].'index.html','');
+}
+
+// Handle the unit (M/G) in max post/upload size
+$ini_max_upload=$phpini['upload_max_filesize']['global_value'];
+if (strpos($ini_max_upload,'G')!=false){$ini_max_upload=intval($ini_max_upload*1024);}
+else{$ini_max_upload=intval($ini_max_upload);}
+$ini_max_post=$phpini['post_max_size']['global_value'];
+if (strpos($ini_max_post,'G')!=false){$ini_max_post=intval($ini_max_post*1024);}
+else{$ini_max_post=intval($ini_max_post);}
+
+$max=min($auto_dropzone['max_length'],$ini_max_upload,$ini_max_post);
+$_SESSION['max_size']=$max;
+$file_length_error=e('Error, max filelength:',false).' '.$max.' Mo';
+$file_format_error=e(': Error, forbidden file format !',false);
+
+$auto_dropzone_error=false;
+
+// uploading files
+if (!empty($_FILES)){
+
+ // HANDLE UPLOAD
+ function bytesToSize1024($bytes, $precision = 2) {
+ if (!empty($bytes)){
+ $unit = array('B','KB','MB');
+ return @round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision).' '.$unit[$i];
+ }else{return false;}
+ }
+ function error2msg($e){
+ if ($e>0&&$e<7){
+ $errors=array(
+ 1=>e('The file to big for the server\'s config',false),
+ 2=>e('The file to big for this page',false),
+ 3=>e('There was a problem during upload (file was truncated)',false),
+ 4=>e('No file upload',false),
+ 5=>e('No temp folder',false),
+ 6=>e('Write error on server',false),
+ );
+ return $errors[$e];
+ }else if ($e>7){return true;}
+ else{return false;}
+ }
+ function secure($file){
+ return preg_replace('#(.+)\.php#i','$1.SPHP',$file);
+ }
+
+ if (isset($_FILES['myfile']) && strtolower($_FILES['myfile']['name'])!="index.html") {
+ $sFileName = secure($_FILES['myfile']['name']);
+ $sFileType = $_FILES['myfile']['type'];
+ $sFileSize = intval(bytesToSize1024($_FILES['myfile']['size'], 1));
+ $sFileError = error2msg($_FILES['myfile']['error']);
+ $sFileExt = pathinfo($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName,PATHINFO_EXTENSION);
+
+ #########################################################################
+ # ADDED FOR BOZON
+ #########################################################################
+ if (!function_exists('folder_fit')){include($path_core.'core.php');}
+ if (!folder_fit(null,$_FILES['myfile']['size'],$_SESSION['login'])){
+ # uploaded file doesn't fit in user's folder
+ if (!isset($_SESSION['ERRORS'])){$_SESSION['ERRORS']='';}
+ $error='
+ '.$sFileName.'
+ ['.$sFileType.' ,
+ '.$sFileSize.' ] '.e('The file doesn\'t fit',false).'
+ ';
+ $_SESSION['ERRORS'].=$error;
+ exit($error);
+ }
+ #########################################################################
+
+ $ok='
+ '.$sFileName.'
+ ['.$sFileType.' ,
+ '.$sFileSize.' ] [OK]
+ ';
+ $notok='
+ '.$sFileName.'
+ ['.$sFileType.' ,
+ '.$sFileSize.' ] '.e('Upload error',false).'
+ ';
+ if (
+ is_array($auto_dropzone['destination_filepath'])
+ &&!empty($auto_dropzone['destination_filepath'][$sFileExt])
+ &&is_dir($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath'][$sFileExt])
+ ){
+ $sFileName = $auto_dropzone['destination_filepath'][$sFileExt].$sFileName;
+ echo $ok;
+ rename($_FILES['myfile']['tmp_name'], $_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName );
+ chmod($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName,0644);
+ }elseif(
+ is_array($auto_dropzone['destination_filepath'])
+ &&!empty($auto_dropzone['destination_filepath'][$sFileExt])
+ &&!is_dir($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath'][$sFileExt])
+ ||
+ is_string($auto_dropzone['destination_filepath'])
+ &&!is_dir($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath'])
+ ){
+ //local upload dir error
+ echo 'Upload path problem with '.$sFileName.' ';
+
+ }elseif($sFileError){
+ // file upload error
+ echo ''.$sFileName.': '.$sFileError.' ';
+
+ } elseif(is_dir($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath'])){
+ $file=$sFileName;
+ $sFileName = $auto_dropzone['destination_filepath'].$sFileName;
+ if (is_file($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName)){
+ $newfilename=rename_item($file,$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$auto_dropzone['destination_filepath']);
+ echo ''.$file.' => '.$newfilename.' ';
+ $sFileName=$auto_dropzone['destination_filepath'].$newfilename;
+ }
+ echo $ok;
+ rename($_FILES['myfile']['tmp_name'], $_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName );
+ chmod($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName,0644);
+ $id=addID($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName);
+ $tree=add_branch($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$sFileName,$id,$_SESSION['login'],$tree);
+ }
+ } else {
+ echo $notok;
+ }
+ exit();
+}else{
+ // GENERATE DROPZONE
+ if ($auto_dropzone['use_style']){
+ echo '
+
+ ';
+ }
+?>
+
+
+
+
+
diff --git a/sources/core/auto_restrict.php b/sources/core/auto_restrict.php
new file mode 100644
index 0000000..b17c681
--- /dev/null
+++ b/sources/core/auto_restrict.php
@@ -0,0 +1,723 @@
+ to the form or to repeat a previously generated token, in case of various forms in a same page)
+ * - easyly secure sensitive actions adding admin password in your form (just add , auto_restrict will exit if password is not correct)
+ * - secure post and get data
+ * - add function to ask password for sensitive/superadmin actions...
+ *
+ *
+ *
+ * Verrouille l'accès à une page
+ * Il suffit d'inclure ce fichier pour bloquer l'accès...
+ * gestion de l'expiration de session,
+ * gestion de la connexion et de la déconnexion.
+ * gestion des différences entre le domaine referer et le domaine sur lequel le script est hébergé (si différent -> pas ok)
+ * gestion du bannissement des adresses ip en cas de bruteforcing ou de referer anormal
+ * gestion des tokens de sécurisation à ajouter aux forms en une commande ; le script se charge seul de vérifier le token
+ * génération aléatoire de la clé de cryptage
+ * sécurisation par mot de passe sur les actions sensibles (il suffit d'ajouter à un formulaire pour qu'auto_restrict bloque en cas de mauvais mot de passe)
+ *
+ * Améliorations eventuelles:
+ * ajouter un fichier log de connexion
+ *
+ *
+ * ajout 4.2 :
+ * ajout du statut (superadmin/admin/user) et de la langue (pour bozon)
+ * ajout 4.1 :
+ * ajout du double check de passe et du changement de mdp
+ * ajout 4.0 :
+ * ajout du support multi utilisateur
+ */
+ @session_start();
+ # ------------------------------------------------------------------
+ # default config: initialisation
+ # ------------------------------------------------------------------
+ # you can modify this config before the include('auto_restrict.php');
+ if (!isset($auto_restrict['error_msg'])){ $auto_restrict['error_msg']='Erreur - impossible de se connecter.';}# utilisé si on ne veut pas rediriger
+ if (!isset($auto_restrict['cookie_name'])){ $auto_restrict['cookie_name']='BoZoN';}# nom du cookie
+ if (!isset($auto_restrict['session_expiration_delay'])){ $auto_restrict['session_expiration_delay']=90;}#minutes
+ if (!isset($auto_restrict['cookie_expiration_delay'])){ $auto_restrict['cookie_expiration_delay']=365;}#days
+ if (!isset($auto_restrict['IP_banned_expiration_delay'])){ $auto_restrict['IP_banned_expiration_delay']=90;}#seconds
+ if (!isset($auto_restrict['max_security_issues_before_ban'])){ $auto_restrict['max_security_issues_before_ban']=5;}
+ if (!isset($auto_restrict['just_die_on_errors'])){ $auto_restrict['just_die_on_errors']=true;}# end script immediately instead of include loginform in case of user not logged;
+ if (!isset($auto_restrict['just_die_if_not_logged'])){ $auto_restrict['just_die_if_not_logged']=false;}# end script immediately instead of include loginform in case of banished ip or referer problem;
+ if (!isset($auto_restrict['tokens_expiration_delay'])){ $auto_restrict['tokens_expiration_delay']=7200;}#seconds
+ if (!isset($auto_restrict['kill_tokens_after_use'])){ $auto_restrict['kill_tokens_after_use']=false;}#false to allow the token to survive after it was used (for a form with multiple submits, like a preview button)
+ if (!isset($auto_restrict['use_GET_tokens_too'])){ $auto_restrict['use_GET_tokens_too']=true;}
+ if (!isset($auto_restrict['use_ban_IP_on_token_errors'])){ $auto_restrict['use_ban_IP_on_token_errors']=false;}
+ if (!isset($auto_restrict['redirect_error'])){ $auto_restrict['redirect_error']='index.php';}# si précisé, pas de message d'erreur
+ if (!isset($auto_restrict['redirect_success'])){ $auto_restrict['redirect_success']='index.php?p=admin&token='.returnToken();}
+ if (!isset($auto_restrict['domain'])){ $auto_restrict['domain']=$_SERVER['SERVER_NAME'];}
+ if (!isset($auto_restrict['POST_striptags'])){ $auto_restrict['POST_striptags']=false;}# if true, all $_POST data will be strip_taged
+ if (!isset($auto_restrict['GET_striptags'])){ $auto_restrict['GET_striptags']=false;}# if true, all $_GET data will be strip_taged
+ if (!isset($auto_restrict['root'])){ $auto_restrict['root']='.';}
+ if (!isset($auto_restrict['path_from_root'])){ $auto_restrict['path_from_root']='';}
+ if (!isset($auto_restrict['add_remove_user_admin_only'])){ $auto_restrict['add_remove_user_admin_only']=true;}# only admin can add or remove a user (admin is the first user)
+ if (!empty($_SERVER['HTTP_REFERER'])){ $auto_restrict['referer']=returndomain($_SERVER['HTTP_REFERER']);}else{$auto_restrict['referer']='';}
+ $auto_restrict['path_to_my_folder']=$auto_restrict['root'].$auto_restrict['path_from_root'].'/';
+ $auto_restrict['path_to_files']=$auto_restrict['path_to_my_folder'].$default_private;
+ # ------------------------------------------------------------------
+ # secure $_POST & $_GET data
+ # ------------------------------------------------------------------
+ if ($auto_restrict['POST_striptags']){$_POST=array_map('strip_tags',$_POST);}
+ if ($auto_restrict['GET_striptags']){$_GET=array_map('strip_tags',$_GET);}
+
+ # ------------------------------------------------------------------
+ # create cookie token folder
+ # ------------------------------------------------------------------
+
+ if (!is_dir($auto_restrict['path_to_files'])){mkdir($auto_restrict['path_to_files'],0700);chmod($auto_restrict['path_to_files'],0700);}
+ if (!is_dir($auto_restrict['path_to_files'])){echo 'auto_restrict error: cannot create the '.$auto_restrict['path_to_files'].' folder
';}
+ elseif (!is_writable($auto_restrict['path_to_files'])){echo 'auto_restrict error: token folder is not writeable
';}
+ elseif (!is_file($auto_restrict['path_to_files'].'/.htaccess')){file_put_contents($auto_restrict['path_to_files'].'/.htaccess', 'deny from all');}
+
+ # ------------------------------------------------------------------
+ # checks auto_restrict's data file : include or create
+ # ------------------------------------------------------------------
+ if(file_exists($auto_restrict['path_to_files'].'/auto_restrict_data.php')){
+ include($auto_restrict['path_to_files'].'/auto_restrict_data.php');
+ }else{
+ $auto_restrict['system_salt']=generate_salt(512);
+ $ret="\n";
+ file_put_contents($auto_restrict['path_to_files'].'/auto_restrict_data.php', '');
+ }
+
+ # ------------------------------------------------------------------
+ # checks auto_restrict's users file : include or redirect to login page if no $_POST
+ # ------------------------------------------------------------------
+ if(file_exists($auto_restrict['path_to_files'].'/auto_restrict_users.php')){
+ # if file exists, include it
+ include($auto_restrict['path_to_files'].'/auto_restrict_users.php');
+ complete_if_needed();
+
+
+ }else if(!isset($_POST['pass'])){
+ # problem with files during a session
+ if (isset($_SESSION['login'])){
+ session_destroy();
+ }
+ # or redirect to login form
+ safe_redirect('index.php?p=login');
+ exit;
+ }
+
+
+ # ------------------------------------------------------------------
+ # Sets a global token to use it later
+ # ------------------------------------------------------------------
+ define('TOKEN',returnToken());
+
+ # ------------------------------------------------------------------
+ # New user request: add it, save and return to login page
+ # ------------------------------------------------------------------
+ if(!empty($_POST['pass'])&&!empty($_POST['confirm'])&&isset($_POST['creation'])&&!empty($_POST['login'])&&empty($_POST['admin_password'])){
+ if (!isset($auto_restrict['users'])){$auto_restrict['users']=array();}
+ $index=count($auto_restrict['users']);
+ $login=strip_tags($_POST['login']);
+ if (login_exists($login)){safe_redirect('index.php?p=login&newuser&error=1&token='.returnToken());}
+ if ($_POST['pass']!=$_POST['confirm']){safe_redirect('index.php?p=login&newuser&error=3&token='.returnToken());}
+ $auto_restrict['users'][$index]['login'] = $login;
+ $auto_restrict['users'][$index]['encryption_key'] = md5(uniqid('', true));
+ $auto_restrict['users'][$index]['salt'] = generate_salt(512);
+ $auto_restrict['users'][$index]['lang'] = $_SESSION['language'];
+ $auto_restrict['users'][$index]['status'] = '';
+ $auto_restrict['users'][$index]['pass'] = hash('sha512', $auto_restrict['users'][$index]['salt'].$_POST['pass']);
+
+ if (!save_users()){exit('auto_restrict: problem saving users
');}
+ safe_redirect('index.php?p=admin&msg='.e('Account created:',false).$login.'&token='.returnToken());
+ exit;
+ }
+
+
+ # ------------------------------------------------------------------
+ # Change password request
+ # ------------------------------------------------------------------
+ if(!empty($_POST['pass'])&&!empty($_POST['confirm'])&&!empty($_POST['admin_password'])){
+
+ if ($auto_restrict['users'][$_SESSION['login']]['pass']!==hash('sha512', $auto_restrict['users'][$_SESSION['login']]['salt'].$_POST['admin_password'])){
+ safe_redirect('index.php?p=login&change_password&error=4&token='.returnToken());
+ exit;
+ }
+ if ($_POST['pass']!=$_POST['confirm']){
+ safe_redirect('index.php?p=login&newuser&error=3&token='.returnToken());
+ exit;
+ }
+ $auto_restrict['users'][$_SESSION['login']]['pass']=hash('sha512', $auto_restrict['users'][$_SESSION['login']]['salt'].$_POST['pass']);
+ if (save_users()){safe_redirect('index.php?p=admin&msg='.e('New password saved for ',false).$_SESSION['login'].'&token='.returnToken());}
+ else{safe_redirect('index.php?p=admin&msg='.e('Error saving new password for ',false).$_SESSION['login'].'&token='.returnToken());}
+ }
+ # ------------------------------------------------------------------
+ # load banned ip
+ # ------------------------------------------------------------------
+ if (is_file($auto_restrict['path_to_files'].'/'.$auto_restrict["banned_ip_filename"])){include($auto_restrict['path_to_files'].'/'.$auto_restrict["banned_ip_filename"]);}
+ # ------------------------------------------------------------------
+
+ # ------------------------------------------------------------------
+ # user tries to login
+ # ------------------------------------------------------------------
+ if (isset($_POST['login'])&&isset($_POST['pass'])&&empty($_POST['confirm'])&&empty($_POST['creation'])){
+ $ok=log_user($_POST['login'],$_POST['pass']);
+ if (!$ok){safe_redirect('index.php?p=login&error=2');}
+ elseif (isset($_POST['cookie'])){
+ set_cookie();
+ }
+ # ------------------------------------------------------------------
+ # redirect if needed
+ # ------------------------------------------------------------------
+ if (!empty($auto_restrict['redirect_success'])){
+ if (strpos($auto_restrict['redirect_success'], '&token=')!==false){
+ safe_redirect($auto_restrict['redirect_success'].'&token='.returnToken());
+ }else{
+ safe_redirect($auto_restrict['redirect_success']);
+ }
+ }
+ }
+
+ # ------------------------------------------------------------------
+ # user wants to logout (?logout $_GET var)
+ # ------------------------------------------------------------------
+ if (isset($_GET['deconnexion'])||isset($_GET['logout'])){@session_destroy();delete_cookie();exit_redirect();}
+ # ------------------------------------------------------------------
+
+
+ # ------------------------------------------------------------------
+ # No admin connected -> login
+ # ------------------------------------------------------------------
+ if (empty($_SESSION['id_user'])||empty($_SESSION['login'])||empty($_SESSION['expire'])){
+ if (!empty($_GET['p'])&&$_GET['p']!='login'){safe_redirect('index.php?p=login');}
+ }
+
+ # ------------------------------------------------------------------
+ # if here, there's no login/logout process.
+ # Check referrer, ip
+ # session duration...
+ # on problem, out !
+ # ------------------------------------------------------------------
+ if (!is_ok()){
+ @session_destroy();
+ if (!$auto_restrict['just_die_if_not_logged']){
+ safe_redirect('index.php?p=login');
+ } else {
+ echo $auto_restrict['error_msg'];
+ }
+ exit();
+ }
+ # ------------------------------------------------------------------
+
+
+
+ # ------------------------------------------------------------------
+ # if here, there was no security problem.
+ # Now, if there is an admin password post data,
+ # it means that the submitted form is a secured one:
+ # check if password is correct (if not => ban ip and stop here)
+ # ------------------------------------------------------------------
+
+ if (isset($_POST['admin_password'])){
+ $pass=hash('sha512', $auto_restrict["salt"].$_POST['admin_password']);
+ if ($auto_restrict['pass']!=$pass){
+ add_banned_ip();
+ death('The admin password is wrong... too bad !');
+ }
+
+ }
+
+ # ------------------------------------------------------------------
+ # users list form requests
+ # ------------------------------------------------------------------
+ # Erase a user account
+ if (isset($_POST['user_key'])&&is_user_admin()){
+ foreach($_POST['user_key'] as $user_nb){
+ if (isset($auto_restrict['users'][$user_nb])){
+ unset($auto_restrict['users'][$user_nb]);
+ # ADDED FOR BOZON
+ rrmdir($_SESSION['upload_root_path'].$user_nb);
+ }
+ }
+ if (!empty($auto_restrict['users'])){
+ save_users();
+ # ADDED FOR BOZON
+ safe_redirect('index.php?p=users&token='.TOKEN.'&msg='.e('Changes saved',false));
+ exit;
+ }
+ else{
+ unlink($auto_restrict['path_to_files'].'/auto_restrict_users.php');
+ exit_redirect();
+ }
+ }
+
+
+ # ------------------------------------------------------------------
+ # change user status
+ # ------------------------------------------------------------------
+ if (isset($_POST['users_status'])&&is_user_admin()){
+ unset($_POST['users_status']);
+ unset($_POST['token']);
+ foreach($_POST as $user=>$status){
+ if (!empty($user)){$auto_restrict['users'][$user]['status']=$status;}
+ }
+ save_users();
+ # ADDED FOR BOZON
+ safe_redirect('index.php?p=users&token='.TOKEN.'&msg='.e('Changes saved',false));
+ }
+
+ # ------------------------------------------------------------------
+ # save user language if change BOZON CHANGE
+ # ------------------------------------------------------------------
+ if (empty($auto_restrict['users'][$_SESSION['login']]['lang'])||$_SESSION['language']!=$auto_restrict['users'][$_SESSION['login']]['lang']){
+ $auto_restrict['users'][$_SESSION['login']]['lang']=$_SESSION['language'];
+ save_users();
+ }
+
+
+ # ------------------------------------------------------------------
+ # crypt functions
+ # form http:#www.info-3000.com/phpmysql/cryptagedecryptage.php
+ # ------------------------------------------------------------------
+ function GenerationCle($Texte,$CleDEncryptage)
+ {
+ $CleDEncryptage = md5($CleDEncryptage);
+ $Compteur=0;
+ $VariableTemp = "";
+ for ($Ctr=0;$Ctr$user){
+ $data.= $ret.'# user : '.$user['login'].$ret
+ .'$auto_restrict["users"]["'.$user['login'].'"]["login"]='.var_export($user['login'],true).';'.$ret
+ .'$auto_restrict["users"]["'.$user['login'].'"]["encryption_key"]='.var_export($user['encryption_key'],true).';'.$ret
+ .'$auto_restrict["users"]["'.$user['login'].'"]["salt"] = '.var_export($user['salt'],true).';'.$ret
+ .'$auto_restrict["users"]["'.$user['login'].'"]["pass"] = '.var_export($user['pass'],true).';'.$ret
+ .'$auto_restrict["users"]["'.$user['login'].'"]["status"]='.var_export($user['status'],true).';'.$ret
+ .'$auto_restrict["users"]["'.$user['login'].'"]["lang"]='.var_export($user['lang'],true).';'.$ret;
+ }
+
+ $data.=$ret.'?>';
+ $r=file_put_contents($auto_restrict['path_to_files'].'/auto_restrict_users.php', $data);
+ sleep(0.5);
+ return $r;
+ }
+
+ function complete_if_needed(){
+ global $auto_restrict,$default_language;$save=false;
+ if (!$auto_restrict){return false;}
+ $indexes_to_check=array( # 'var' => 'default value',
+ 'lang'=>$default_language,
+ );
+ $first=first($auto_restrict['users']);
+ foreach ($auto_restrict['users'] as $user=>$data){
+ foreach ($indexes_to_check as $index=>$default_value){
+ if (empty($data[$index])){
+ $auto_restrict['users'][$user][$index]=$default_value;$save=true;
+ }
+ if (empty($data['status'])){
+ $auto_restrict['users'][$user]['status']=create_status($user,$first);$save=true;
+ }elseif($data['status']!='superadmin'&&$data['login']==$first['login']){
+ $auto_restrict['users'][$user]['status']='superadmin';$save=true;# force first status to superadmin
+ }
+ }
+ }
+
+ if ($save){save_users();return true;}
+ return false;
+ }
+ function create_status($user=null,$first=''){
+ global $auto_restrict;
+ if (!$user){return false;}
+ if (count($auto_restrict['users'])==1){ return 'superadmin';}
+ elseif ($user==$first['login']){ return 'superadmin';}
+ else{return 'user';}
+ }
+
+ function login_exists($login=null){
+ global $auto_restrict;
+ if (empty($login)){return false;}
+ foreach ($auto_restrict['users'] as $key=>$user){
+ if ($user['login']==$login){return true;}
+ }
+ return false;
+ }
+
+ function id_user(){
+ $id=$_SERVER['REMOTE_ADDR'];
+ $id.='-'.$_SERVER['HTTP_USER_AGENT'];
+ $id.='-'.session_id();
+ return $id;
+ }
+
+
+
+ function is_ok(){
+ # check tokens, session vars, ip, referrer, cookie etc
+ # in case of problem, destroy session and redirect
+ global $auto_restrict;
+ $expired=false;
+ if (!isset($_SESSION['id_user'])){return false;}
+ # fatal problem
+ if (!checkReferer()){return death('You are definitely NOT from here !
');}
+ if (!checkIP()){return death('Hey... you were banished, fuck off !
');}
+ if (!checkToken()){return death('Invalid token
');}
+
+ #
+ if (checkCookie()){return true;}
+
+ if ($_SESSION['expire']'.$msg.'');}else{return false;}}
+ function is_user_admin(){
+ global $auto_restrict;
+ if ($auto_restrict['add_remove_user_admin_only']==false){return true;}
+ if (!empty($_SESSION['status'])){
+ if ($_SESSION['status']=='admin'||$_SESSION['status']=='superadmin'){return true;}
+ }else{
+ $first=first($auto_restrict['users']);
+ if (!empty($_SESSION['login'])&&$_SESSION['login']==$first['login']){return true;}
+ if (!empty($_SESSION['login'])&&isset($auto_restrict['users'][$_SESSION['login']]['status'])&&$auto_restrict['users'][$_SESSION['login']]['status']=='admin'){return true;}
+ }
+ return false;
+ }
+ function log_user($login_donne,$pass_donne){
+ # create session vars
+ $save=false;
+ global $auto_restrict,$default_language;
+ if (empty($default_language)){$default_language='en';}
+ session_destroy();session_start();
+ foreach ($auto_restrict['users'] as $key=>$user){
+ if ($user['login']===$login_donne && $user['pass']===hash('sha512', $user["salt"].$pass_donne)){
+ $_SESSION['id_user']=chiffre(id_user(),$user['encryption_key']);
+ $_SESSION['login']=$user['login'];
+ $_SESSION['expire']=time()+(60*$auto_restrict['session_expiration_delay']);
+ $admin=first($auto_restrict['users']);
+ $_SESSION['status']=$user['status'];
+ $_SESSION['language']=$user['lang'];
+ if ($save){save_users();}
+ return true;
+ }
+ }
+ if ($login_donne!='dis'&&$pass_donne!='connect'){
+ add_banned_ip();
+ }else{exit_redirect();}
+ return false;
+ }
+
+ function exit_redirect(){
+ global $auto_restrict;
+ @session_unset();
+ @session_destroy();
+ delete_cookie();
+ if ($auto_restrict['redirect_error']&&$auto_restrict['redirect_error']!=''){
+ safe_redirect($auto_restrict['redirect_error']);
+ }else{exit($auto_restrict['error_msg']);}
+ }
+ function generate_salt($length=256){
+ $salt='';
+ for($i=1;$i<=$length;$i++){
+ $salt.=chr(mt_rand(35,126));
+ }
+ return $salt;
+ }
+
+ function set_cookie(){
+ # create cookie and token file
+ global $auto_restrict;
+ $token_cookie=hash('sha512',$auto_restrict['system_salt'].md5(preg_replace('#[^a-zA-Z]#','',uniqid(true))));
+ $time=time()+$auto_restrict['cookie_expiration_delay']*1440;
+ setcookie($auto_restrict['cookie_name'],$token_cookie,$time);
+ file_put_contents($auto_restrict['path_to_files'].'/'.$token_cookie,$time,0666);
+ chmod($auto_restrict['path_to_files'].'/'.$token_cookie,0666);
+ }
+ function delete_cookie(){
+ # delete cookie and token cookie file
+ global $auto_restrict;
+ @$token_cookie_file=$_COOKIE[$auto_restrict['cookie_name']];
+ setcookie($auto_restrict['cookie_name'],'',time()+1);
+ @unlink($auto_restrict['path_to_files'].'/'.$token_cookie_file);
+ }
+ function checkCookie(){
+ # test cookie token file security access
+ global $auto_restrict;
+
+ if (!isset($_COOKIE[$auto_restrict['cookie_name']])){return false;} # no cookie ?
+ $cookie_token_file=$auto_restrict['path_to_files'].'/'.$_COOKIE[$auto_restrict['cookie_name']];
+ if (!is_file($cookie_token_file)){return false;} # no cookie token file ?
+ if (file_get_contents($cookie_token_file) ';}
+ else {echo $token;}
+ }
+ # create a token, and return it
+ function returnToken(){
+ global $auto_restrict;
+ $token=hash('sha512',uniqid('',true));
+ $_SESSION[$token]=@date('U')+$auto_restrict['tokens_expiration_delay'];
+ return $token;
+ }
+
+
+ # ------------------------------------------------------------------
+ # ADMIN ONLY PROTECTION
+ # ------------------------------------------------------------------
+ # echo a password input form to secure sensitive sections
+ # you can specify a label text and/or a placeholder text
+ function adminPassword($label='',$placeholder=''){
+ if (!empty($label)){$label=''.$label.' ';}
+ if (!empty($placeholder)){$placeholder=' placeholder="'.$placeholder.'" ';}
+ echo $label.' ';
+ }
+
+
+ # ------------------------------------------------------------------
+ # IP
+ # ------------------------------------------------------------------
+ # increment the IP counter in the banned IP file
+ function add_banned_ip($ip=null){
+ if(empty($ip)){$ip=$_SERVER['REMOTE_ADDR'];}
+ global $auto_restrict;
+
+ if (isset($auto_restrict["banned_ip"][$ip])){
+ $auto_restrict["banned_ip"][$ip]['nb']++;
+ }else{
+ $auto_restrict["banned_ip"][$ip]['nb']=1;
+ }
+
+ $auto_restrict["banned_ip"][$ip]['date']=@date('U')+$auto_restrict['IP_banned_expiration_delay'];
+ file_put_contents($auto_restrict['path_to_files'].'/'.$auto_restrict["banned_ip_filename"],'');
+ }
+
+ function remove_banned_ip($ip=null){
+ if(empty($ip)){$ip=$_SERVER['REMOTE_ADDR'];}
+ global $auto_restrict;
+ if (isset($auto_restrict["banned_ip"][$ip])){
+ unset($auto_restrict["banned_ip"][$ip]);
+ }
+ file_put_contents($auto_restrict['path_to_files'].'/'.$auto_restrict["banned_ip_filename"],'');
+ }
+
+ # check if user IP is banned or not
+ function checkIP($ip=null){
+ if(empty($ip)){$ip=$_SERVER['REMOTE_ADDR'];}
+ global $auto_restrict;
+
+ if (isset($auto_restrict["banned_ip"][$ip])){
+ if ($auto_restrict["banned_ip"][$ip]['nb']<$auto_restrict['max_security_issues_before_ban']){return true;} # below max login fails
+ else if ($auto_restrict["banned_ip"][$ip]['date']>=@date('U')){return false;} # active banishment
+ else if ($auto_restrict["banned_ip"][$ip]['date']<@date('U')){remove_banned_ip($ip);return true;} # old banishment
+ return false;
+ }else{return true;}# ip is ok
+ }
+
+ # ------------------------------------------------------------------
+ # Misc
+ # ------------------------------------------------------------------
+ # creates a form with the users list to erase
+ function generate_users_formlist($text='Check users to delete account and files'){
+ global $auto_restrict;
+ echo ''.$text.' ';
+ }
+ # creates a form with the users list to change status
+ function generate_users_status_formlist($text='Select new status for the users',$user_text='user',$admin_text='admin'){
+ global $auto_restrict,$PROFILES;
+ echo ''.$text.' ';
+ }
+
+ function safe_redirect($url=none){
+ if (!$url){return false;}
+ if (!headers_sent()){header('location: '.$url);}
+ else{echo '';}
+ exit;
+ }
+
+ # creates the secured link to the users list form
+ function generate_users_list_link($text='See users list'){
+ global $auto_restrict;
+ echo ' ';
+ }
+ # creates the secured link to new user form
+ function generate_new_users_link($text='Add a user'){
+ echo ' ';
+ }
+ # creates the secured link to new password form
+ function generate_new_password_link($text='Change password'){
+ echo ' ';
+ }
+ function first($array){
+ if (empty($array)){return false;}
+ $akeys=array_keys($array);
+ $key=array_shift($akeys);
+ return $array[$key];
+ }
+?>
diff --git a/sources/core/auto_thumb.php b/sources/core/auto_thumb.php
new file mode 100644
index 0000000..5359d5e
--- /dev/null
+++ b/sources/core/auto_thumb.php
@@ -0,0 +1,97 @@
+$src_height){
+ // paysage
+ $ratio=$src_width/$src_height;
+ $height=$width/$ratio;
+ }
+ }else{
+ // avec recadrage: on produit une image aux dimensions définies mais coupée
+ if ($src_width<$src_height){
+ // portrait
+ $recadrageY=round(($src_height-$src_width)/2);
+ $src_height=$src_width;
+ }else if ($src_width>$src_height){
+ // paysage
+ $recadrageX=round(($src_width-$src_height)/2);
+ $src_width=$src_height;
+ }
+ }
+
+
+
+ // en fonction de l'extension
+ $fichier = pathinfo($img);
+ $extension=str_ireplace('jpg','jpeg',$fichier['extension']);
+
+
+ $fonction='imagecreatefrom'.$extension;
+ if (!$src = $fonction($img)){return false;}
+
+ // création image
+ $thumb = imagecreatetruecolor($width,$height);
+
+ // gestion de la transparence
+ // (voir fonction de Seebz: http://code.seebz.net/p/imagethumb/)
+ if( $extension=='png' ){imagealphablending($thumb,false);imagesavealpha($thumb,true);}
+ if( $extension=='gif' && @imagecolortransparent($img)>=0 ){
+ $transparent_index = @imagecolortransparent($img);
+ $transparent_color = @imagecolorsforindex($img, $transparent_index);
+ $transparent_index = imagecolorallocate($thumb, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
+ imagefill($thumb, 0, 0, $transparent_index);
+ imagecolortransparent($thumb, $transparent_index);
+ }
+
+ imagecopyresampled($thumb,$src,0,0,$recadrageX,$recadrageY,$width,$height,$src_width,$src_height);
+
+ // gestion de la rotation
+ @$exif = exif_read_data($img);
+ if ($exif && array_key_exists('Orientation', $exif)) {
+ $orientation = $exif['Orientation'];
+ $angle = get_rotation_angle($orientation);
+ $thumb = imagerotate($thumb, $angle, 0);
+ }
+ imagepng($thumb, $thumb_name);
+ imagedestroy($thumb);
+
+ return $thumb_name;
+}
+
+
+?>
\ No newline at end of file
diff --git a/sources/core/commands_GET_vars.php b/sources/core/commands_GET_vars.php
new file mode 100644
index 0000000..72b0d56
--- /dev/null
+++ b/sources/core/commands_GET_vars.php
@@ -0,0 +1,132 @@
+
+ * like thumbnails request, users list, login/logout request, public share file/folder request...
+ * @author: Bronco (bronco@warriordudimanche.net)
+ **/
+
+
+ # thumbnail request
+ if(isset($_GET['thumbs'])&&!empty($_GET['f'])&&$_SESSION['GD']){
+ $f=get_thumbs_name(id2file($_GET['f']));
+ $type=_mime_content_type($f);
+ header('Content-type: '.$type.'; charset=utf-8');
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Length: '.filesize($f));
+ readfile($f);
+ exit;
+ }
+ if(isset($_GET['gthumbs'])&&!empty($_GET['f'])&&$_SESSION['GD']){
+ $f=get_thumbs_name_gallery(id2file($_GET['f']));
+ $type=_mime_content_type($f);
+ header('Content-type: '.$type.'; charset=utf-8');
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Length: '.filesize($f));
+ readfile($f);
+ exit;
+ }
+
+ # public share request
+ if (!empty($_GET['f'])){
+ require('core/share.php');
+ exit;
+ }
+
+ # Try to login or logout ? => auto_restrict
+ if (!empty($_POST['pass'])&&!empty($_POST['login'])||isset($_GET['logout'])||isset($_GET['deconnexion'])){
+ require_once('core/auto_restrict.php');
+ exit;
+ }
+
+ # ask for rss stats
+ if (isset($_GET['statrss'])&&!empty($_GET['key'])&&hash_user($_GET['key'])){
+ $rss=array('infos'=>'','items'=>'');
+ $rss['infos']=array(
+ 'title'=>'BoZoN - stats',
+ 'description'=>e('Rss feed of stats',false),
+ //'guid'=>$_SESSION['home'].'?f='.$id,
+ 'link'=>htmlentities($_SESSION['home']),
+ );
+
+ include('core/Array2feed.php');
+ $stats=load($_SESSION['stats_file']);
+ for ($index=0;$index<$_SESSION['stats_max_lines'];$index++){
+ if (!empty($stats[$index])){
+ $rss['items'][]=
+ array(
+ 'title'=>$stats[$index]['file'],
+ 'description'=>'[ip:'.$stats[$index]['ip'].'] '.'[referrer:'.$stats[$index]['referrer'].'] '.'[host:'.$stats[$index]['host'].'] ',
+ 'pubDate'=>makeRSSdate($stats[$index]['date']),
+ 'link'=>$_SESSION['home'].'?f='.$stats[$index]['id'],
+ 'guid'=>$_SESSION['home'].'?f='.$stats[$index]['id'],
+ );
+ }
+ }
+ array2feed($rss);
+ exit;
+ }
+
+
+ # ask for json format stats
+ if (isset($_GET['statjson'])&&!empty($_GET['key'])&&hash_user($_GET['key'])){
+ $stats=load($_SESSION['stats_file']);
+ exit(json_encode($stats));
+ }
+
+ # zip and download a folder from visitor's share page
+ if (!empty($_GET['zipfolder'])&&$_SESSION['zip']){
+ $folder=id2file($_GET['zipfolder']);
+ if (!is_dir($_SESSION['temp_folder'])){mkdir($_SESSION['temp_folder']);}
+ $zipfile=$_SESSION['temp_folder'].return_owner($_GET['zipfolder']).'-'._basename($folder).'.zip';
+ zip($folder,$zipfile);
+ header('location: '.$zipfile);
+ exit;
+ }
+
+ if (is_user_connected()){
+ # users list request
+ if (isset($_GET['users_list'])&&is_allowed('user page')){
+ $_GET['p']='users';unset($_GET['users_list']); # To avoid useless changes in auto_restrict
+ }
+ # if user is connected, use auto_restrict
+ require_once('core/auto_restrict.php');
+ $token=returnToken();
+
+ # complete list files ajax request button «load more»
+ if(isset($_GET['async'])){
+ include('core/listfiles.php');
+ exit;
+ }
+ if (empty($_GET['p'])&&!empty($_GET)||count($_GET)>2||!empty($_POST)){include('core/GET_POST_admin_data.php');}
+ if (!empty($_FILES)){
+ include('core/auto_dropzone.php');
+ exit();
+ }
+
+ # users share list request
+ if (isset($_GET['users_share_list'])){
+ $shared_id=$_GET['users_share_list'];
+ require_once('core/auto_restrict.php');
+ $shared_with=load_folder_share();
+ $users=$auto_restrict['users'];
+ unset($users[$_SESSION['login']]);
+ foreach($users as $login=>$data){
+ # creates a checkbox list of users (if the folder is already shared by logged user, checked)
+ if (isset($shared_with[$login][$shared_id]) && $shared_with[$login][$shared_id]['from']==$_SESSION['login']){
+ $check=' checked ';$class=' class="shared" ';
+ }else{$check='';$class='';}
+ echo ''.$login.' ';
+ }
+ exit;
+ }
+
+
+
+ }else{$token='';}
+ if (!empty($_GET['p'])){$page=$_GET['p'];}else{$page='';}
+ if (!empty($_GET['msg'])){$message=$_GET['msg'];}
+ if (!empty($_GET['lang'])){$_SESSION['language']=$_GET['lang'];header('location:index.php?p='.$page.'&token='.$token);}
+ if (!empty($_GET['aspect'])){$_SESSION['aspect']=$_GET['aspect'];header('location:index.php?p='.$page.'&token='.$token);}
+
+?>
\ No newline at end of file
diff --git a/sources/core/core.php b/sources/core/core.php
new file mode 100644
index 0000000..970a2f7
--- /dev/null
+++ b/sources/core/core.php
@@ -0,0 +1,1205 @@
+$_SESSION['temp_cleaned']+1800){
+ # clean temp once in a session
+ $zips=_glob($_SESSION['temp_folder'],'.zip');
+ foreach($zips as $zipfile){
+ if (time()>filectime($zipfile)+1800){unlink($zipfile);}
+ }
+ $_SESSION['temp_cleaned']=time();
+ }
+
+ # Check R/W rights for system folders
+ if (!is_writable($_SESSION['private_folder'])){echo ''.e('Private folder is not writable',false).'
';}
+ if (!is_readable($_SESSION['private_folder'])){echo ''.e('Private folder is not readable',false).'
';}
+ if (!is_writable($_SESSION['temp_folder'])){echo ''.e('Temp folder is not writable',false).'
';}
+ if (!is_readable($_SESSION['temp_folder'])){echo ''.e('Temp folder is not readable',false).'
';}
+ if (!is_readable($_SESSION['private_folder'].'trees')){$message.=''.e('Problem accessing tree folder: not readable',false).'
';}
+ if (!is_writable($_SESSION['private_folder'].'trees')){$message.=''.e('Problem accessing tree/folder file: not writable',false).'
';}
+ if (!empty($_SESSION['upload_user_path'])&&!is_readable($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$_SESSION['current_path'])){$message.=''.e('Problem accessing ',false).$_SESSION['current_path'].e(': folder not readable',false).'
';}
+ if (!empty($_SESSION['upload_user_path'])&&!is_writable($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$_SESSION['current_path'])){$message.=''.e('Problem accessing ',false).$_SESSION['current_path'].e(': folder not writable',false).'
';}
+
+ # Check necessary libs
+ if(!$disable_non_installed_libs_warning){
+ if (!$_SESSION['zip']){$message.='';}
+ if (!$_SESSION['GD']){$message.='';}
+ if (!$_SESSION['curl']){$message.='';}
+ }
+ # Check files
+ if (!is_file('thumbs/'.$_SESSION['upload_root_path'].'.htaccess')){file_put_contents('thumbs/'.$_SESSION['upload_root_path'].'.htaccess', 'deny from all');}
+ if (!is_file('thumbs/'.$_SESSION['upload_root_path'].'index.html')){file_put_contents('thumbs/'.$_SESSION['upload_root_path'].'index.html',' ');}
+ if (!is_file($_SESSION['temp_folder'].'.htaccess')){file_put_contents($_SESSION['temp_folder'].'htaccess', 'deny from all');}
+ if (!is_file($_SESSION['upload_root_path'].'index.html')){ file_put_contents($_SESSION['upload_root_path'].'index.html',' '); }
+ if (!is_file('thumbs/.htaccess')){file_put_contents('thumbs/.htaccess', 'deny from all');}
+ if (!is_file('thumbs/index.html')){file_put_contents('thumbs/index.html',' ');}
+ if (!empty($_SESSION['upload_user_path'])&&!is_file('thumbs/'.$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].'.htaccess')){file_put_contents('thumbs/'.$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].'.htaccess', 'deny from all');}
+ if (!empty($_SESSION['upload_user_path'])&&!is_file('thumbs/'.$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].'index.html')){file_put_contents('thumbs/'.$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].'index.html',' ');}
+
+ if (!is_file($_SESSION['private_folder'].'.htaccess')){file_put_contents($_SESSION['private_folder'].'/.htaccess', 'deny from all');}
+ if (!is_file($_SESSION['folder_share_file'])){save_folder_share(array());}
+ if (!is_file($_SESSION['private_folder'].'/salt.php')){ file_put_contents($_SESSION['private_folder'].'/salt.php',''); }
+ else{include($_SESSION['private_folder'].'/salt.php');}
+ if (!is_file($_SESSION['id_file'])){$ids=array();store($ids);}
+ if (!is_file($_SESSION['stats_file'])){save($_SESSION['stats_file'], array());}
+ if (!is_file($_SESSION['upload_root_path'].'.htaccess')){file_put_contents($_SESSION['upload_root_path'].'.htaccess', 'deny from all');}
+ if (!is_file($_SESSION['users_rights_file'])){save_users_rights(array());}
+ else{$users_rights=load_users_rights();}
+ if (!is_file($_SESSION['profiles_rights_file'])){
+ save($_SESSION['profiles_rights_file'],array());
+ }
+
+ if (is_file($_SESSION['id_file'])&&!is_readable($_SESSION['id_file'])){$message.=''.e('Problem accessing ID file: not readable',false).'
';}
+ if (is_file($_SESSION['id_file'])&&!is_writable($_SESSION['id_file'])){$message.=''.e('Problem accessing ID file: not writable',false).'
';}
+ if (is_file($_SESSION['stats_file'])&&!is_readable($_SESSION['stats_file'])){$message.=''.e('Problem accessing stats file: not readable',false).'
';}
+ if (is_file($_SESSION['stats_file'])&&!is_writable($_SESSION['stats_file'])){$message.=''.e('Problem accessing stats file: not writable',false).'
';}
+
+ # Libs configuration
+ # Files to echo in browser (secured)
+ $behaviour['FILES_TO_ECHO']=array('nfo','m3u','txt','js','html','php','SPHP','htm','shtml','shtm','css');
+ # Files to send to browser directly
+ $behaviour['FILES_TO_RETURN']=array('md','jpg','jpeg','gif','png','mp3','mp4','svg');
+ $auto_dropzone['destination_filepath']=$_SESSION['current_path'].'/';
+ $auto_thumb['default_width']='64';
+ $auto_thumb['default_height']='64';
+ $auto_thumb['dont_try_to_resize_thumbs_files']=true;
+
+ # CONSTANTS & GLOBALS
+ define('THEME_PATH','templates/'.$_SESSION['theme'].'/');
+ $ACTIONS=array('users page','add user','delete user','change user status','change folder size','change status rights','change passes','markdown editor','regen ID base','acces logfile','upload');
+ $RIGHTS=load($_SESSION['profiles_rights_file']);
+
+ if (empty($RIGHTS)){ #default profiles if not configured
+ $PROFILES=array('admin','user');
+ $RIGHTS['admin']=array('add user'=>1,'delete user'=>1,'change folder size'=>1,'markdown editor'=>1,'regen ID base'=>1,'access logfile'=>1,'upload'=>1);
+ $RIGHTS['user']=array('markdown editor'=>1,'upload'=>1);
+ save($_SESSION['profiles_rights_file'],$RIGHTS);
+ }else{$PROFILES=array_filter(array_keys($RIGHTS));}
+
+ include('core/templates.php');
+
+
+ #################################################
+ # Load IDS
+ #################################################
+ if (is_user_connected()&&$check_ID_base_on_page_load){
+ $ids=updateIDs();
+ }else{$ids=unstore();}
+ #################################################
+ #################################################
+ # Load current path tree
+ #################################################
+ if (is_user_connected()){
+ $tree=tree($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$_SESSION['current_path'],false,false,$allow_folder_size_stat);
+ }
+ #################################################
+
+
+
+
+
+ #################################################
+ # Functions
+ #################################################
+ # Data save/load & files
+ #################################################
+ function load($file){return (file_exists($file) ? unserialize(gzinflate(base64_decode(substr(file_get_contents($file),9,-strlen(6))))) : array() );}
+ function save($file,$data){return file_put_contents($file, '');}
+ function store($ids=null){if (!$ids){return false;}natcasesort($ids);return save($_SESSION['id_file'],$ids);}
+ function unstore(){return array_filter(load($_SESSION['id_file']));}
+ function save_folder_share($array=null){return save($_SESSION['folder_share_file'],$array);}
+ function load_folder_share(){return load($_SESSION['folder_share_file']);}
+ function save_users_rights($array=null){return save($_SESSION['users_rights_file'],$array);}
+ function load_users_rights(){return load($_SESSION['users_rights_file']);}
+ # Delete a file or a folder and apply changes in ids file
+ function delete_file_or_folder($id=null,$ids=null,$tree=array()){
+ global $ids,$tree;
+ if (empty($ids)){$ids=unstore();}
+ if (empty($id)){return false;}
+ if (empty($tree)){tree(null,$_SESSION['login'],false,false,$tree);}
+ $f=id2file($id);
+ if(is_file($f)){
+ # delete file & thumb
+ unlink($f);
+ $thumbfilename=get_thumbs_name($f);
+ if (is_file($thumbfilename)){unlink($thumbfilename);}
+ unset($ids[$id]);
+ store($ids);
+ return remove_branch($f,$id);
+ }else if (is_dir($f)){
+ $fthumbs=explode('/',$f); unset($fthumbs[0]);$fthumbs=implode('/',$fthumbs);
+ # delete dir
+ rrmdir($f);
+ rrmdir('thumbs/'.$fthumbs);
+ # remove all vanished sub files & folders from id file
+ foreach($ids as $id=>$path){
+ if (strpos($path, $f.'/')!==false){unset($ids[$id]);}
+ }
+ store($ids);
+ return remove_branch($f,$id);
+ }
+ return $tree;
+ }
+
+ # New folder in the current path
+ function new_folder($folder=null){
+ if (!$folder){return false;}
+ $thumbs_path='thumbs/'.$_SESSION['upload_user_path'].addslash_if_needed($_SESSION['current_path']);
+ $path=$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].addslash_if_needed($_SESSION['current_path']);
+ $complete_path=$path.$folder;
+ $complete_thumbs=$thumbs_path.$folder;
+ if (is_dir($complete_path)&&is_dir($complete_thumbs)){
+ # Folder already exists, rename
+ $folder=rename_item($folder,$path);
+ $complete_path=$path.$folder;
+ $complete_thumbs=$thumbs_path.$folder;
+ }else if(!is_dir($complete_path)&&is_dir($complete_thumbs)){
+ rrmdir($complete_thumbs);
+ }
+ mkdir($complete_path, 0744, true);
+ mkdir($complete_thumbs, 0744, true);
+ return addID($complete_path);
+ }
+
+ # checks if dir is empty
+ function is_empty_dir($src){
+ # form https://openclassrooms.com/forum/sujet/savoir-si-un-dossier-est-vide-39930
+ if (!is_dir($src)){return 'no such dir';}
+ $h = opendir($src);
+ while (($o = readdir($h)) !== FALSE){
+ if (($o != '.') and ($o != '..')){$c++;}
+ }
+ closedir($h);
+ if($c==0){return true;}else {return false; }
+ }
+
+ # store all client access to a file
+ function store_access_stat($file=null,$id=null){
+ if (!$file||!$id){return false;}
+ $host=$ref='∅';
+ if (isset($_SERVER['REMOTE_HOST'])){$host=$_SERVER['REMOTE_HOST'];}
+ if (isset($_SERVER['HTTP_REFERER'])){$ref=$_SERVER['HTTP_REFERER'];}
+ $data=array(
+ 'ip'=>$_SERVER['REMOTE_ADDR'],
+ 'host'=>$host,
+ 'referrer'=>$ref,
+ 'date'=>date('D d M, H:i:s'),
+ 'file'=>$file,
+ 'id'=>$id,
+ );
+ //FIXME not very good when multi-call
+ $stats=load($_SESSION['stats_file']);
+ if (!is_array($stats)){$stats=array();}
+ if (count($stats)>$_SESSION['stats_max_entries']){
+ $stats=array_values($stats);
+ unset($stats[0]);
+ }
+ $stats[]=$data;
+ save($_SESSION['stats_file'], $stats);
+ }
+ function addslash_if_needed($chaine){
+ if (substr($chaine,strlen($chaine)-1,1)!='/'&&!empty($chaine)){return $chaine.'/';}else{return $chaine;}
+ }
+ function rename_item($file=null,$folder=''){
+ if (!$file){return false;}
+ if (strpos($file, '/')!==false){$file=_basename($file);}
+ $folder=addslash_if_needed($folder);
+ $destination=$folder.$file;
+ $nb=1;
+ $extension=pathinfo($file,PATHINFO_EXTENSION);
+ $file2=$file;
+ while (is_file($destination) || is_dir($destination)){
+ $nb++;
+ $add='('.$nb.')';
+ if (is_file($destination)) {$file2=str_replace('.'.$extension,$add.'.'.$extension,$file);}
+ else{$file2=$file.$add;}
+ $destination=$folder.$file2;
+ }
+ return $file2;
+ }
+ function no_special_char($string){return preg_replace('/[\"*\/\:<>\?|]/','',$string);}
+ function file_curl_contents($url,$pretend=true){
+ # distant version of file_get_contents
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Charset: UTF-8'));
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_URL, $url);
+ if (!ini_get("safe_mode") && !ini_get('open_basedir') ) {curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);}
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
+ if ($pretend){curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0');}
+ curl_setopt($ch, CURLOPT_REFERER, 'http://noreferer.com');// notez le referer "custom"
+ $data = curl_exec($ch);
+ $response_headers = curl_getinfo($ch);
+ curl_close($ch);
+ return $data;
+ }
+ function getUrl() {
+ $url = @( $_SERVER["HTTPS"] != 'on' ) ? 'http://'.$_SERVER["SERVER_NAME"] : 'https://'.$_SERVER["SERVER_NAME"];
+ $url .= $_SERVER["SCRIPT_NAME"];
+ return $url;
+ }
+ function rrmdir($dir) {
+ # delete a folder and its content
+ if (is_dir($dir)) {
+ $objects = scandir($dir);
+ foreach ($objects as $object) {
+ if ($object != "." && $object != "..") {
+ if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
+ }
+ }
+ reset($objects);
+ rmdir($dir);
+ }
+ }
+ function _glob($path,$pattern='') {
+ # glob function fallback by Cyril MAGUIRE (thx bro' ;-)
+ if($path=='/'){
+ $path='';
+ }
+ $liste = array();
+ $pattern=str_replace('*','',$pattern);
+ if ($handle = opendir($path)) {
+ while (false !== ($file = readdir($handle))) {
+ if(stripos($file, $pattern)!==false || $pattern=='' && $file!='.' && $file!='..' && $file!='.htaccess') {
+ $liste[] = $path.$file;
+ }
+ }
+ closedir($handle);
+ }
+ natcasesort($liste);
+ return $liste;
+
+ }
+ function _basename($file){$array=explode('/',$file);if (is_array($array)){return end($array);}else{return $file;}}
+ function only_type($tree=null, $ext=null){
+ if (empty($tree)||empty($ext)){return false;}
+ if (is_string($tree)){
+ $extension=pathinfo($tree,PATHINFO_EXTENSION);
+ if (stripos($ext, $extension)===false||empty($extension)){return false;}
+ return true;
+ }elseif (is_array($tree)){
+ $tree=unset_first_element($tree);
+ if (empty($tree)){return false;}
+ foreach($tree as $file){
+ if (is_file($file)||is_dir($file)){
+ $extension=pathinfo($file,PATHINFO_EXTENSION);
+ if (stripos($ext, $extension)===false||empty($extension)){return false;}
+ }
+ }
+ return true;
+ }
+
+ }
+ function unset_first_element($array=null){
+ if (!$array){return false;}
+ $first=array_keys($array);$first=$first[0];
+ unset($array[$first]);
+ return $array;
+ }
+ function unzip($file, $destination){
+ if (!class_exists('ZipArchive')){return false;}
+ $zip = new ZipArchive() ;
+ if ($zip->open($file) !== TRUE) { return false;}
+ $zip->extractTo($destination);
+ $zip->close();
+ return true;
+ }
+
+ function zip($source, $destination)
+ {
+ if (!extension_loaded('zip')){return false;}
+ $zip = new ZipArchive();
+ if (is_file($destination)){unlink($destination);}
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {return false;}
+ if (is_string($source)){$source=array($source);}
+ foreach($source as $item){
+ if (is_dir($item) === true){
+ $files = array_keys(iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($item), RecursiveIteratorIterator::SELF_FIRST)));
+ $files[0]=dirname($files[1]);
+ foreach ($files as $key=>$file){
+ # Ignore "." and ".." folders
+ if( in_array(substr($file, strrpos($file, '/')+1), array('.', '..')) ){continue;}
+ $file_short=utf8_decode(str_replace(addslash_if_needed($_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$_SESSION['current_path']),'',$file));
+ if (is_dir($file) === true){
+ $zip->addEmptyDir($file_short);
+ }else if (is_file($file) === true){
+ $zip->addFromString($file_short, file_get_contents($file));
+ }
+ }
+ }
+ else if (is_file($item) === true){
+ $zip->addFromString(_basename($item), file_get_contents($item));
+ }
+
+ }
+
+ }
+
+ function check_path($path){
+ return (strpos($path, '//')===false && strpos($path, '..')===false && ( empty($path[0]) || (!empty($path[0]) && $path[0]!='/') ) );
+ }
+
+ function get_thumbs_name($file){
+ global $auto_thumb;
+ if($file[0]=='/'){
+ $file=substr($file,1);
+ }
+ return 'thumbs/'.preg_replace('#\.(jpe?g|png|gif)#i','_THUMB_'.$auto_thumb['default_width'].'x'.$auto_thumb['default_height'].'.$1',$file);
+ }
+
+ function get_thumbs_name_gallery($file){
+ global $gallery_thumbs_width;
+ if($file[0]=='/'){
+ $file=substr($file,1);
+ }
+ return 'thumbs/'.preg_replace('#\.(jpe?g|png|gif)#i','_THUMBGALLERY_'.$gallery_thumbs_width.'x'.$gallery_thumbs_width.'.$1',$file);
+ }
+
+ function recursive_glob($dir='.',$files=true){
+ # scann a folder and subfolders and return the tree
+ if (!isset($dossiers[0]) || $dossiers[0]!=$dir){$dossiers[0]=$dir;}
+ if (!is_dir($dir)&&$files){ return array($dir); }
+ elseif (!is_dir($dir)&&!$files){return array();}
+ $list=_glob(addslash_if_needed($dir));
+ foreach ($list as $dossier) {
+ $dossiers=array_merge($dossiers,recursive_glob($dossier,$files));
+ }
+ return $dossiers;
+ }
+
+ ############################################
+ # IDS functions
+ ############################################
+ # Delete the id if it's a burn one
+ function burned($id){
+ if ($id[0]=='*'&&!isset($_GET['thumbs'])){
+ if (!is_user_connected() || !is_owner($id)){removeID($id);}
+ }
+ }
+ # Create an ID for a file/folder
+ function addID($path,$ids=null){# $path must be complete upload path
+ global $ids;
+ if (!$ids){$ids=unstore();}
+ if ($id=array_search($path, $ids)){return $id;}
+ $item_id=uniqid(true);
+ $ids[$item_id]=$path;
+ store($ids);
+ return $item_id;
+ }
+
+ # remove an id from id file
+ function removeID($id){
+ $ids=unstore();
+ if (!empty($ids[$id])){unset ($ids[$id]);}
+ store($ids);
+ }
+
+ # remove unused ids, add new ids for current user
+ function updateIDs($ids=null,$folder_id=null){
+ if (!$ids){$ids=unstore();}
+ $sdi=array_flip($ids);$saveid=$savetree=false;
+ $ids=array_flip($sdi); # here, all the redundant ids have gone ^^
+ # scann all uploads folder (can be long but it's important)
+ # or only the requested folder
+ if (!empty($folder_id)){
+ $tree=recursive_glob(id2file($folder_id),true);
+ }else{
+ $tree=recursive_glob($_SESSION['upload_root_path'],true);
+ }
+ unset($tree[0]);
+ # add missing ids
+ foreach($tree as $index=>$file){
+ if (!isset($sdi[$file])){
+ $saveid=true;
+ $id=uniqid(true);
+ $ids[$id]=$file;
+ }else{unset($sdi[$file]);}
+ }
+ if (empty($folder_id)){
+ # remove ids with no file (not required for single folder update)
+ if (!empty($sdi)){
+ $saveid=true;
+ foreach ($sdi as $file=>$id){
+ if (!is_dir($file)&&!is_file($file)){
+ unset($ids[$id]);
+ if ($remove=array_search($file, $tree)){
+ unset($tree[$remove]);
+ }
+ }
+ }
+ }
+ }
+ if ($saveid){
+ store($ids);
+ regen_tree($_SESSION['login'],$ids);
+ }
+ return $ids;
+ }
+
+ function is_in($ext,$type){
+ global $behaviour;
+ if (!empty($behaviour[$type])){return array_search($ext,$behaviour[$type]);}else{return false;}
+ }
+ function id2file($id){
+ global $ids;
+ if (isset($ids[$id])){
+ return $ids[$id];
+ }else{
+ return false;
+ }
+ }
+ function file2id($file){
+ global $ids;
+ $sdi=array_flip($ids);
+ if (isset($sdi[$file])){return $sdi[$file];}else{return false;}
+ }
+ function only_folders($array=null){
+ if (empty($array)){return false;}
+ $tree=array();
+ foreach($array as $key=>$value){
+ if (is_dir($value)){$tree[]=$value;}
+
+ }
+ return $tree;
+ }
+ function add_branch($path=null,$id=null,$user=null,$tree=array()){
+ global $ids;
+ if (empty($path)){return false;}
+ if (empty($id)&&empty($ids)){return false;}
+ if (empty($id)){$id=file2id($path);}
+ if (empty($user)&&!empty($_SESSION['login'])){$user=$_SESSION['login'];}
+ if (empty($tree)){$tree=loadtree($user);}
+ $tree[$id]=$path;
+ natcasesort($tree);
+ savetree($user,$tree);
+ return $tree;
+ }
+ function remove_branch($path=null,$id=null,$user=null,$tree=array()){
+ global $ids;
+ if (empty($path)){return false;}
+ if (empty($id)&&empty($ids)){return false;}
+ if (empty($id)){$id=file2id($path);}
+ if (empty($user)&&!empty($_SESSION['login'])){$user=$_SESSION['login'];}
+ if (empty($tree)){$tree=loadtree($user);}
+ if (isset($tree[$id])||$id=array_search($path, $tree)){
+ unset($tree[$id]);
+ }
+ return $tree;
+ }
+ function rename_branch($new=null,$old=null,$id=null,$user=null,$tree=array()){
+ global $ids;
+ if (empty($new)||empty($old)||$new==$old){return false;}
+ if (empty($id)&&empty($ids)){return false;}
+ if (empty($id)){$id=file2id($old);}
+ if (empty($user)&&!empty($_SESSION['login'])){$user=$_SESSION['login'];}
+ if (empty($tree)){$tree=loadtree($user);}
+ if (isset($tree[$id])||$id=array_search($old, $tree)){
+ $tree[$id]=$new;
+ }
+ return $tree;
+ }
+ function savetree($user=null,$tree=array()){
+ if (empty($tree)){return false;}
+ if (empty($user)&&!empty($_SESSION['login'])){$user=$_SESSION['login'];}
+ save($_SESSION['private_folder'].'trees/'.$user.'.php',$tree);
+ }
+ function loadtree($user=null){
+ if (empty($user)&&!empty($_SESSION['login'])){$user=$_SESSION['login'];}
+ if (empty($_SESSION['private_folder'])){return false;}
+ $path=$_SESSION['private_folder'].'trees/'.$user.'.php';
+ if (is_file($path)){return load($path);}
+ return false;
+ }
+
+ # Creates the user's folder tree (for ids file) to reduce all actions to this folder and not to all upload dir
+ # if path, only regen a subfolder, return it
+ function regen_tree($user='',$ids=null,$path=null){
+ global $ids;
+ if (!$ids){$ids=unstore();}
+ if (empty($user)){$user=$_SESSION['login'];}
+ if (empty($path)){$path=$_SESSION['upload_root_path'].$user.'/';
+ /*if (!empty($user)){$path=$_SESSION['upload_root_path'].$user.'/';}
+ elseif (!empty($_SESSION['upload_user_path'])){
+ $path=$_SESSION['upload_root_path'].$_SESSION['upload_user_path'];
+ $user=$_SESSION['login'];
+ }else{$path=$_SESSION['upload_root_path'];}*/
+ }
+
+ $tree=array();
+ foreach($ids as $id=>$value){
+ if (strpos($value,$path)!==false){$tree[$id]=$value;}
+ }
+ return $tree;
+ }
+
+ # regen recursive folder tree if needed
+ function user_folder_tree($user=null){
+ if (!$user&&!empty($_SESSION['login'])){$user=$_SESSION['login'];}
+ if (isset($_SESSION['regenfolder'])||!is_file($_SESSION['private_folder'].$user.'.php')){
+ # regen folder tree
+ $tree=tree($_SESSION['upload_root_path'].$_SESSION['upload_user_path'],$user,true,true);
+ savetree($user,$tree);
+ unset($_SESSION['regenfolder']);
+ return $tree;
+ }else{
+ return loadtree($user);
+ }
+ }
+
+ # build folder content from the user's tree file to avoid excessive _glob access
+ function tree($folder=null,$user=false,$folders_only=false,$recursive=false,$tree=null){
+ global $current_tree,$ids;
+ if (!empty($current_tree)&&!$folders_only&&!$recursive){return $current_tree;}
+ $dir=array();
+ if (!$user){$user=$_SESSION['login'];}
+ if (!$tree){$tree=regen_tree($user);}
+ if (!empty($current_tree)&&$folders_only){$tree=only_folders($current_tree);}
+ elseif($folders_only){$tree=only_folders($tree);}
+
+ if (empty($folder)){$folder=$_SESSION['upload_root_path'].$_SESSION['upload_user_path'].$_SESSION['current_path'];}
+ if (!empty($tree)){
+ foreach ($tree as $id=>$path){
+ if ($recursive){
+ $p=addslash_if_needed($path);
+ $f=addslash_if_needed($folder);
+ $match=(strpos($p, $f)===0);
+ }else{
+ $match=(addslash_if_needed(dirname($path))===addslash_if_needed($folder));
+ }
+ if (!empty($_SESSION['filter'])){
+ $match=$match&&(strpos(_basename($path),$_SESSION['filter'])!==false);
+ }
+ if ($match===true){
+ $dir[$id]=$path;
+ }
+ }
+ }else{$dir=array();}
+ unset($_SESSION['filter']);
+ return $dir;
+
+ }
+ function deep_strip_tags($var){if (is_string($var)){return strip_tags($var);}if (is_array($var)){return array_map('deep_strip_tags',$var);}return $var; }
+ function visualizeIcon($extension){
+ global $behaviour;
+ $array=array_merge(array_flip($behaviour['FILES_TO_RETURN']),array_flip($behaviour['FILES_TO_ECHO']));
+ return isset($array[$extension]);
+ }
+ function generate_bozon_salt($length=512){
+ $salt='';
+ for($i=1;$i<=$length;$i++){
+ $salt.=chr(mt_rand(35,126));
+ }
+ return $salt;
+ }
+ function blur_password($pw){
+ if (!empty($pw)){return hash('sha512', BOZON_SALT.$pw);}
+ return false;
+ }
+ # to solve some problems on mime detection, fallback
+ if (function_exists('mime_content_type')){
+ function _mime_content_type($filename) {return mime_content_type($filename);}
+ }elseif (function_exists('finfo_file')){
+ function _mime_content_type($filename) {return finfo_file( finfo_open( FILEINFO_MIME_TYPE ), $filename );}
+ }else{
+ function _mime_content_type($filename){
+ #inspired by http://stackoverflow.com/questions/8225644/php-mime-type-checking-alternative-way-of-doing-it
+ $mime_types = array(
+ 'txt' => 'text/plain',
+ 'md' => 'text/plain',
+ 'nfo' => 'text/plain',
+ 'htm' => 'text/html',
+ 'html' => 'text/html',
+ 'php' => 'text/html',
+ 'css' => 'text/css',
+ 'js' => 'application/javascript',
+ 'json' => 'application/json',
+ 'xml' => 'application/xml',
+ 'swf' => 'application/x-shockwave-flash',
+ 'flv' => 'video/x-flv',
+
+ // images
+ 'png' => 'image/png',
+ 'jpe' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'jpg' => 'image/jpeg',
+ 'gif' => 'image/gif',
+ 'bmp' => 'image/bmp',
+ 'ico' => 'image/vnd.microsoft.icon',
+ 'tiff' => 'image/tiff',
+ 'tif' => 'image/tiff',
+ 'svg' => 'image/svg+xml',
+ 'svgz' => 'image/svg+xml',
+
+ // archives
+ 'zip' => 'application/zip',
+ 'rar' => 'application/x-rar-compressed',
+ 'exe' => 'application/x-msdownload',
+ 'msi' => 'application/x-msdownload',
+ 'cab' => 'application/vnd.ms-cab-compressed',
+
+ // audio/video
+ 'mp3' => 'audio/mpeg',
+ 'qt' => 'video/quicktime',
+ 'mov' => 'video/quicktime',
+ 'm3u' => 'audio/x-mpegurl',
+
+ // adobe
+ 'pdf' => 'application/pdf',
+ 'psd' => 'image/vnd.adobe.photoshop',
+ 'ai' => 'application/postscript',
+ 'eps' => 'application/postscript',
+ 'ps' => 'application/postscript',
+
+ // ms office
+ 'doc' => 'application/msword',
+ 'rtf' => 'application/rtf',
+ 'xls' => 'application/vnd.ms-excel',
+ 'ppt' => 'application/vnd.ms-powerpoint',
+ 'docx' => 'application/msword',
+ 'xlsx' => 'application/vnd.ms-excel',
+ 'pptx' => 'application/vnd.ms-powerpoint',
+
+
+ // open office
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ );
+
+ $ext=strtolower(pathinfo($filename,PATHINFO_EXTENSION));
+ if (array_key_exists($ext, $mime_types)) {return $mime_types[$ext];}
+ else {return 'application/octet-stream';}
+ }
+ }
+
+ # counts how much levels to go back (to close correctly)
+ function count_back($previous,$current){
+ $max=max(count($previous),count($current));
+ for($c=0; $c<$max;$c++){
+ if (!isset($previous[$c]) || !isset($current[$c]) || $previous[$c]!=$current[$c]){break;}
+ }
+ $c++;
+ return $max-$c;
+ }
+ function draw_tree($tree=null){
+ if (!$tree){return false;}
+ $first=array_keys($tree);
+ $second=$first[1];$first=$first[0];
+ $image_only=only_type($tree,'.jpg .jpeg .gif .png');
+ $sound_only=only_type($tree,'.mp3 .ogg');
+
+ if (!$image_only&&!$sound_only){
+ # file list tree
+ echo '';
+ $tree=array_map(function($i){return $i.'/';}, $tree);
+ natcasesort($tree);
+ echo ''._basename(rtrim($tree[$first], '/\\')).' ';
+ unset($tree[$first]);
+ if (empty($tree)){return false;}
+
+ $previous_branch=explode('/',$tree[$second]);
+ $previous_level=$current_level=count($previous_branch);
+
+ foreach ($tree as $id=>$branch){
+ if (!is_dir($branch)){$branch=rtrim($branch, '/\\');}
+ $current_branch=explode('/',$branch);
+ $current_level=count($current_branch);
+
+ if (is_dir($branch)&&$previous_level==$current_level){echo ' ';}
+ if ($current_level<$previous_level){
+ $nb=count_back($previous_branch,$current_branch);
+ echo str_repeat('',$nb);
+ }
+ if (is_dir($branch)){
+ echo ' '._basename(rtrim($branch, '/\\')).' ';
+ echo '';
+ }elseif (is_file($branch)){
+ $extension=strtolower(pathinfo($branch,PATHINFO_EXTENSION));
+ echo ''.$extension.' '._basename($branch).' ';
+ }
+ $previous_level=$current_level;$previous_branch=$current_branch;
+ }
+
+ echo ' ';
+ echo '';
+ }elseif($image_only){
+ # image gallery
+ if (!function_exists('auto_thumb')){include('core/auto_thumb.php');}
+ global $gallery_thumbs_width;
+ $title=explode('/',$tree[$first]);$title=$title[count($title)-1];unset($tree[$first]);
+ echo ' ';
+ echo ''.$title.' ';
+
+ foreach($tree as $id=>$image){
+ if (is_file($image)){
+ $link='index.php?f='.$id;
+ $file=_basename($image);
+ $filesize = sizeconvert(filesize($image));
+ $ext=strtolower(pathinfo($image,PATHINFO_EXTENSION));
+ if ($ext!='mp4'){
+ $size = getimagesize($image);
+ $size=$size[0].'x'.$size[1];
+ auto_thumb($image,$width=$gallery_thumbs_width,$height=$gallery_thumbs_width,$add_to_thumb_filename='_THUMBGALLERY_',$crop_image=true);
+ echo ''.$file.' '.$size.' '.$filesize.' ';
+
+ }else{
+ $size = sizeconvert(filesize($image));
+ echo ''.$file.' '.$size.' ';
+ }
+ }
+ }
+ echo ' ';
+ echo '
+
+ ';
+
+ }elseif($sound_only){
+ # music player
+ $title=explode('/',$tree[$first]);$title=$title[count($title)-1];unset($tree[$first]);
+
+ echo ''.$title.' ';
+ echo '';
+ echo ' ';
+ echo '';
+ $mult=3;
+ for ($vol=1;$vol<11;$vol++){
+ if ($vol<10){echo ' ';}
+ else{echo ' ';}
+
+ }
+
+ echo '
';
+
+ foreach($tree as $id=>$sound){
+ if (is_file($image)){
+ $link='index.php?f='.$id;
+ $file=_basename($sound);
+ $ext=strtolower(pathinfo($sound,PATHINFO_EXTENSION));
+ $size = sizeconvert(filesize($sound));
+ echo ''.$file.' '.$size.' ';
+ }
+ }
+ echo ' ';
+ echo '
+
+ ';
+ }
+ }
+
+ /*function template($key,$array){
+ global $templates;
+ if (isset($templates[$key])){
+ $tpl= str_replace(array_keys($array),array_values($array),$templates[$key]);
+ return $tpl;
+ }else{return false;}
+ }*/
+ function template($key,$array){
+ global $templates;
+
+ if (isset($templates[$key])){
+ $tpl=$templates[$key];
+ foreach($array as $key=>$value){
+ $tpl= str_replace($key,$value,$tpl);
+ }
+ return $tpl;
+ }else{return false;}
+ }
+
+ function navigatorLanguage(){
+ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
+ $language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+ return $language{0}.$language{1};
+ }else{return 'fr';}
+ }
+
+
+
+ # locales functions
+ function e($txt,$echo=true){
+ global $lang;
+ if (isset($lang[$txt])){$t= $lang[$txt];}else{$t= $txt;}
+ if ($echo){echo $t;}else{return $t;}
+ }
+ function available_languages(){
+ $l=_glob('locale/','php');
+ foreach($l as $key=>$lang){
+ $l[$key]=str_replace('.php','',_basename($lang));
+ }
+
+ return $l;
+ }
+ # Links functions
+ # create language links
+ function make_lang_link($pattern='#LANG '){
+ $langs=available_languages();
+ if (!empty($_GET['p'])){$page=$_GET['p'];}else{$page='';}
+ if(function_exists('returntoken')){$token=returnToken();}else{$token='';}
+ foreach($langs as $lang){
+ if ($_SESSION['language']==$lang){$class=' class="active'.$lang.'" ';}else{$class='class="'.$lang.'" ';}
+ echo str_replace(array('#CLASS','#LANG','#TOKEN','#PAGE'),array($class,$lang,$token,$page),$pattern);
+ }
+
+ }
+
+ # create the connection/admin button
+ function make_connect_link($label_admin=' ',$label_logout=' ',$label_login=' '){
+ $status='';
+ if (is_user_connected()){
+ if (!empty($_SESSION['login'])&&$label_admin==' '){$label_admin= $_SESSION['login'];}
+ if (!empty($_SESSION['status'])){$status= $_SESSION['status'];}
+ if(function_exists('returntoken')){$token=returnToken();}else{$token='';}
+ echo ' '.$label_admin.' ';
+ echo ' ';
+
+ }
+ else{echo ' ';}
+ }
+
+ # create the menu link (to change view)
+ function make_menu_link($pattern=''){
+ if(function_exists('returntoken')){$token=returnToken();}else{$token='';}
+ if (!empty($_GET['p'])){$page=$_GET['p'];}else{$page='';}
+ if ($_SESSION['aspect']=='icon'){$class=' active';}else{$class='';}
+ echo str_replace(array('#MENU','#THEME','#TOKEN','#PAGE','#CLASS','#TITLE'),array('icon',THEME_PATH,$token,$page,$class,e('See as icon',false)),$pattern);
+ if ($_SESSION['aspect']=='list'){$class=' active';}else{$class='';}
+ echo str_replace(array('#MENU','#THEME','#TOKEN','#PAGE','#CLASS','#TITLE'),array('list',THEME_PATH,$token,$page,$class,e('See as file list',false)),$pattern);
+ }
+
+ # create the mode links (to change access mode)
+ function make_mode_link($pattern=' '){
+ if(function_exists('returntoken')){$token=returnToken();}else{$token='';}
+ if ($_SESSION['mode']=='view'){$class='active';}else{$class='';}
+ echo str_replace(array('#MODE','#TITLE','#TOKEN','#CLASS'),array('view',e('Manage files',false),$token,$class),$pattern);
+ if ($_SESSION['mode']=='links'){$class='active';}else{$class='';}
+ echo str_replace(array('#MODE','#TITLE','#TOKEN','#CLASS'),array('links',e('Manage links',false),$token,$class),$pattern);
+ }
+
+ # Checks auto_restrict's session vars to know if a user is connected
+ function is_user_connected(){
+ if (empty($_SESSION['id_user'])||empty($_SESSION['login'])||empty($_SESSION['expire'])){
+ return false;
+ }
+ return true;
+ }
+
+ # echo some classes depending on filemode, pages etc
+ function body_classes(){
+ if (isset($_GET['users_list'])){echo 'users_list ';}
+ if (!empty($_GET['p'])){echo $_GET['p'].' ';}else{echo 'home ';}
+ if (!empty($_SESSION['language'])){echo 'body_'.$_SESSION['language'].' ';}
+ if (!empty($_SESSION['mode'])){echo $_SESSION['mode'].' ';}
+ if (!empty($_SESSION['aspect'])&&empty($_GET['f'])){echo $_SESSION['aspect'].' ';}
+ }
+
+
+ # Users functions
+ # return the user's name hashed or the user's name corresponding to a hash
+ function hash_user($user_or_hash){
+ if (!is_file('private/auto_restrict_users.php')){return false;}
+ include ('private/auto_restrict_users.php');
+ if (strlen($user_or_hash)>100){
+ # hash > user
+ foreach ($auto_restrict['users'] as $user=>$data){
+ $hash=hash('sha512',$data['salt'].$user);
+ if ($hash==$user_or_hash){return $user;}
+ }
+
+ return false;
+ }else{
+ # user > hash
+ if (!empty($auto_restrict['users'][$user_or_hash])){
+ return hash('sha512',$auto_restrict['users'][$user_or_hash]['salt'].$user_or_hash);
+ }
+ return false;
+ }
+ }
+
+ # Check if current user is the id's owner
+ function is_owner($id=null){
+ if (!$id || empty($_SESSION['login']) || !$f=id2file($id)){return false;}
+ $file=explode('/',$f);$owner=$file[1];
+ return $_SESSION['login']==$owner;
+ }
+ # Return id's owner
+ function return_owner($id=null){
+ if (!$id){return false;}
+ $file=explode('/',id2file($id));
+ if (!empty($file[1])){$owner=$file[1];}
+ else{$owner=e('Deleted',false);}
+
+ return $owner;
+ }
+
+ function is_allowed($action,$profile=null){
+ global $RIGHTS;
+ if (!is_user_connected()){return false;}
+ if (!isset($RIGHTS)){return false;}
+ if (!$profile&&!empty($_SESSION['status'])){$profile=$_SESSION['status'];}elseif (!$profile){return false;}
+ if ($profile=='superadmin'){return true;}
+ if (isset($RIGHTS[$profile][$action])){return true;}else{return false;}
+ }
+ /*
+ function is_admin(){
+ global $auto_restrict;
+ if (empty($_SESSION['login'])){return false;}
+ if (!empty($_SESSION['status'])){
+ if ($_SESSION['status']=='admin'||$_SESSION['status']=='superadmin'){return true;}
+ }else{
+ $first=first($auto_restrict['users']);
+ if ($_SESSION['login']==$first['login']){return true;}
+ if (isset($auto_restrict['users'][$_SESSION['login']]['status'])&&$auto_restrict['users'][$_SESSION['login']]['status']=='admin'){return true;}
+ }
+ return false;
+ }*/
+ function is_superadmin(){if (!empty($_SESSION['status'])&&$_SESSION['status']=='superadmin'){return true;}return false;}
+ function load_users_list(){
+ global $auto_restrict;
+ if (empty($auto_restrict["users"])){
+ $auto_restrict_users=$_SESSION['private_folder'].'auto_restrict_users.php';
+ if (!is_file($auto_restrict_users)){return false;}
+ include($auto_restrict_users);
+ }
+ return $auto_restrict["users"];
+ }
+
+ # Complete users rights
+ function complete_users_rights($users_rights=null){
+ global $auto_restrict,$default_profile_folder_max_size;
+ $save=false;
+ $users=$auto_restrict["users"];
+ if (empty($users)){return false;}
+ if (!$users_rights){$users_rights=load_users_rights();}
+ foreach ($users as $key=>$user){ # add missing
+ if (!isset($users_rights[$user['login']])){
+ $users_rights[$user['login']]=$default_profile_folder_max_size;
+ $save=true;
+ }
+ }
+ foreach ($users_rights as $user=>$size){ # remove deleted profiles
+ if (!isset($users[$user])){
+ unset($users_rights[$user]);
+ $save=true;
+ }
+ }
+ if ($save){save_users_rights($users_rights);}
+ return $users_rights;
+ }
+
+ # creates a form with the users list
+ function generate_users_folder_space_formlist($text='Check users to delete account and files'){
+ global $auto_restrict,$default_profile_folder_max_size;
+ $users_rights=complete_users_rights();
+ echo ''.$text.' ';
+ }
+
+
+ # Folder functions
+ # folder_size % functions
+ function sizeconvert( $bytes ){
+ $label = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB' );
+ for( $i = 0; $bytes >= 1024 && $i < ( count( $label ) -1 ); $bytes /= 1024, $i++ );
+ return( round( $bytes, 2 ) . " " . $label[$i] );
+ }
+ function folder_size($folder,$convert=true){
+ $tree=tree($folder,null,false,true);$size=0;
+ foreach($tree as $branch){
+ if (is_file(($branch))){$size+=filesize($branch);}
+ }
+ if ($convert){return sizeconvert($size);}
+ return $size;
+ }
+ function folder_free($folder,$mode=false){
+ if (empty($_SESSION['profile_folder_max_size'])){return false;}
+ $max=($_SESSION['profile_folder_max_size']*1048576);
+ $size=round($max-strval(folder_size($folder,false)),2);
+ if ($size<=0){return false;}
+ if (!$mode){ # converted size
+ return sizeconvert($size);
+ }elseif ($mode=1){ # oct
+ return $size;
+ }else{ # %
+ return round((100*$size)/$max,1);
+ }
+ }
+ function folder_fit($file=null,$size=null,$profile=null){
+ if (!$file&&!$size||!$profile){return false;}
+ $is_admin=is_superadmin();
+ if (empty($_SESSION['profile_folder_max_size'])&&!$is_admin){return false;}
+ $folder=$_SESSION['upload_root_path'].$profile;
+ $max=$_SESSION['profile_folder_max_size']*1048576;
+ if (!empty($file)){
+ if (!is_file($file)){return false;}
+ $size=filesize($file);
+ }
+ if (folder_size($folder,false)+$size>$max&&!$is_admin){return false;}
+ return true;
+ }
+
+ function folder_usage_draw($profile,$mode=1){
+
+ $folder=$_SESSION['upload_root_path'].$profile;
+ if (!is_dir($folder)){return false;}
+ if (empty($_SESSION['profile_folder_max_size'])){return false;}
+ if (is_admin()){return false;}
+ $free=folder_free($folder,1);
+ $user_size=$_SESSION['profile_folder_max_size']*1048576;
+ $used=round($user_size-$free,1);
+ $usedpc=round($used*100/$user_size,1);
+ $freepc=round($free*100/$user_size,1);
+ if (empty($free)){$free=0;}
+
+ if ($mode==1){echo ''.$usedpc.'% '.$freepc.'%
';}
+ if ($mode==2){echo '
';}
+ if ($mode==3){echo ''.$freepc.'% '.e('free',false).' ('.sizeconvert($free).')
';}
+ }
+
+ function draw_lb_link($file,$alt=null,$text_link=' ',$group='',$type='iframe'){
+ if(@is_array(getimagesize($file))){$type='img';}
+ if (!empty($group)){$group='data-group="'.$group.'"';}
+ echo ''.$text_link.' ';
+ }
+
+ function start_session(){if (!session_id()){session_start();}}
+
+ function extract_config_vars(){
+ preg_match_all("#\$([^';=]*?)=#", file_get_contents('config.php'), $vars);aff($vars);
+ $conf=array();
+ foreach($vars[1] as $index=>$varname){echo $varname;
+ if (!isset($$varname)){global $$varname;}
+ $conf[$$varname]=$$varname;
+ }
+ return $conf;
+ }
+
+
+
+
+ #################################################
+ # Debug functions
+ #################################################
+ function aff($var,$stop=true){
+ $dat=debug_backtrace();$origin='';
+ echo 'Arret ligne '.$dat[0]['line'].' dans le fichier '.$dat[0]['file'].'
';
+ echo '';var_dump($var);echo '
';
+ foreach (array_reverse($dat) as $data){
+ $dir=dirname($data['file']).'/';
+ $fil=_basename($data['file']);
+ $origin.=''.$dir.' '.$fil.' '.$data['function'].'() '.$data['line'].' ';
+ }
+ $origin.='
';
+ echo ''.$origin.'
';
+ if ($stop){exit();}
+ }
+ function li($string){echo ''.$string.' ';}
+ function debug_log($str){file_put_contents('debug.html', $str,FILE_APPEND);}
+ function chrono($name='chrono',$delete=false){
+ if ($delete){@unlink('debug.html');}
+ global $debug_mode;
+ if (!$debug_mode){return false;}
+ if (!isset($_SESSION[$name])){$_SESSION[$name]=microtime(true);}
+ else{
+ $count=round(microtime(true)-$_SESSION[$name],2);
+ if ($count<1){$color='lightgreen';$color2='black';}
+ if ($count>1&&$count<=2){$color='yellow';$color2='maroon';}
+ if ($count>2&&$count<=5){$color='orange';$color2='maroon';}
+ if ($count>5){$color='red';$color2='pink';}
+ $debug= ' '.date('h:i:s').' '.$name.':'.$count.'sec '; unset($_SESSION[$name]);
+ $dat=debug_backtrace();
+ foreach (array_reverse($dat) as $data){
+ $dir=dirname($data['file']).'/';
+ $fil=_basename($data['file']);
+ $debug.= ''.$fil.' '.$data['function'].'() l.'.$data['line'].' ';
+ }
+ $debug.=' ';
+ debug_log($debug);
+ unset($_SESSION[$name]);
+ }
+
+ }
+?>
\ No newline at end of file
diff --git a/sources/core/core.php.zip b/sources/core/core.php.zip
new file mode 100644
index 0000000..3c26310
Binary files /dev/null and b/sources/core/core.php.zip differ
diff --git a/sources/core/js/VanillaJS.js b/sources/core/js/VanillaJS.js
new file mode 100644
index 0000000..5a03b6a
--- /dev/null
+++ b/sources/core/js/VanillaJS.js
@@ -0,0 +1,328 @@
+/* VanillaJS v0.1 by bronco@warriordudimanche.net */
+ // fonctions systeme ----------------------------------------------------
+ function when_ready(funct){document.addEventListener("DOMContentLoaded",funct,false);}
+ function _(obj,single){
+ if (typeof obj=='string'){
+ if (single){return first(obj);}
+ else{return all(obj);}
+ }else{
+ if (single && obj[0]){return obj[0];}
+ }
+ return obj;
+ }
+ function _tcl(el,cl){
+ if (el.classList) {
+ el.classList.toggle(cl)
+ } else {
+ var classes = el.className.split(' ')
+ var existingIndex = classes.indexOf(cl)
+ if (existingIndex >= 0)
+ classes.splice(existingIndex, 1)
+ else
+ classes.push(cl);
+ el.className = classes.join(' ')
+ }
+ }
+ function _acl(el,cl){
+ if (el.classList){ el.classList.add(cl);}
+ else {el.className += ' ' + cl; }
+ }
+ function _rcl(el,cl){
+ if (el.classList)
+ el.classList.remove(cl)
+ else
+ el.className = el.className.replace(new RegExp('(^| )' + cl.split(' ').join('|') + '( |$)', 'gi'), ' ')
+ }
+ function _adev(obj,ev,funct){if (obj.addEventListener){obj.addEventListener(ev, funct);}}
+ function _tglval(valToTgl,val1,val2){if (valToTgl==val1){return val2;}else{return val1;}}
+
+
+ // parcours du DOM ----------------------------------------------------
+ function all(tag){return document.querySelectorAll(tag);}
+ function first(tag){return document.querySelector(tag);}
+ function allIn(obj,selector){
+ obj=_(obj,1);if (!obj){return false}
+ return obj.querySelectorAll(selector);
+ }
+ function firstIn(obj,selector){
+ obj=_(obj,1);if (!obj){return false}
+ if (selector) {return obj.querySelector(selector);}else{return obj.children[0];}
+ }
+ function lastIn(obj,selector){
+ if (typeof obj=='string'){obj=first(obj);}
+ if (!obj){return false}
+ if (selector) {
+ childs=obj.querySelectorAll(selector);
+ if (!childs){return false;}
+ if (!childs.length){return childs;}
+ return childs[childs.length-1];
+ }else{return obj.lastElementChild;}
+ }
+ function parent(obj,degree){
+ obj=_(obj,1);if (!obj){return false}
+ if (!degree||degree==1){return obj.parentNode;}
+ else{
+ for (i=1;i<=degree;i++){
+ obj=obj.parentNode;
+ console.log(obj.getAttribute('class'))
+ }
+ return obj;
+ }
+
+ }
+ function next(obj){
+ obj=_(obj,1);if (!obj){return false}
+ return obj.nextElementSibling;
+ }
+
+
+
+ // contenu ----------------------------------------------------
+ function remove(obj,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.parentNode.removeChild(obj);return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.parentNode.removeChild(el);});
+ }
+ if (callback) {callback();}
+ }
+ function prepend(obj,content,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.innerHTML=content+obj.innerHTML;return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.innerHTML=content+el.innerHTML;});
+ }
+ if (callback) {callback();}
+ }
+ function append(obj,content,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.innerHTML+=content;return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.innerHTML+=content;});
+ }
+ if (callback) {callback();}
+ }
+ function before(obj, content,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.insertAdjacentHTML('beforebegin', content);return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.insertAdjacentHTML('beforebegin', content);});
+ }
+ if (callback) {callback();}
+ }
+ function after(obj, content,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.insertAdjacentHTML('afterend', content);return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.insertAdjacentHTML('afterend', content);});
+ }
+ if (callback) {callback();}
+ }
+ function clear(obj,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.innerHTML='';return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.innerHTML='';});
+ }
+ if (callback) {callback();}
+ }
+
+
+
+ // Ajax ----------------------------------------------------
+ function ajax(url,data,method,target,callback){
+ if (!target){target ='';}
+ if (!method){method='GET';}
+ if (!data){data='';}
+ // Envoi de la requête
+ request = new XMLHttpRequest;
+ request.open(method, url, true);
+ if (method=='POST'){request.setRequestHeader("Content-type","application/x-www-form-urlencoded");}
+ request.send(data);
+
+ // Gestion de la réponse du serveur
+ request.onreadystatechange=function(){
+ if (request.readyState==4 && request.status==200){
+ rep=request.responseText;
+ if (target){
+ if (typeof target=='string'){target=all(target);}
+ if (!target.length){target.innerHTML=rep;return true;}
+ if (target.length){ [].forEach.call(target, function(el) {el.innerHTML=rep;}); }
+ }else{return rep;}
+
+ }
+ }
+ if (callback) {callback();}
+ }
+ function onProgress(e) {
+ var percentComplete = (e.position / e.totalSize)*100;
+ return percentComplete;
+ }
+
+ function appendAjax(url,data,method,target,onload){
+ if (!target){target ='';}
+ if (!method){method='GET';}
+ if (!data){data='';}
+ // Envoi de la requête
+ request = new XMLHttpRequest;
+ request.onprogress=onProgress;
+ request.onload=onload;
+ request.onerror=function(){return 'Error loading !';}
+ request.open(method, url, true);
+ if (method=='POST'){request.setRequestHeader("Content-type","application/x-www-form-urlencoded");}
+ request.send(data);
+
+ // Gestion de la réponse du serveur
+ request.onreadystatechange=function(){
+ if (request.readyState==4 && request.status==200){
+ rep=request.responseText;
+ if (target){
+ if (typeof target=='string'){target=all(target);}
+ append(target,rep);
+
+ return true;
+ }else{
+
+ return rep;
+ }
+
+ }
+ }
+
+ }
+ function get(url){
+ request = new XMLHttpRequest();request.open('GET', url, true);request.send();
+ request.onreadystatechange=function(){
+ if (request.readyState==4 && request.status==200){return request.responseText;}
+ }
+ }
+ function post(url){
+ request = new XMLHttpRequest();request.open('POST', url, true);request.send();
+ request.onreadystatechange=function(){
+ if (this.readyState==4){return request.responseText;}
+ }
+ }
+
+ // Classes ----------------------------------------------------
+ function addClass(obj,classname,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){_acl(obj,classname);return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {_acl(el,classname);});
+ }
+ if (callback) {callback();}
+ }
+ function removeClass(obj,classname,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){_rcl(obj,classname);return true;}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {_rcl(el,classname);});
+ }
+ if (callback) {callback();}
+ }
+ function toggleClass(obj,classname,callback){
+ obj=_(obj);if (!obj||obj.length==0){return false}
+ if (!obj.length){_tcl(obj,classname);}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {_tcl(el,classname)});
+ }
+ if (callback){callback();}
+ }
+ function hasClass(obj,classname,callback){
+ obj=_(obj,1);if (!obj){return false}
+ return obj.className && new RegExp("(\\s|^)" + classname + "(\\s|$)").test(obj.className);
+ }
+
+ // visibilité ----------------------------------------------------
+ function show(obj){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.style.display ='';}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.style.display ='';});
+ }
+ if (callback) {callback();}
+ }
+ function hide(obj,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.style.display ='none';}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.style.display ='none';});
+ }
+ if (callback) {callback();}
+ }
+ function toggle(obj,callback){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){obj.style.display=_tglval(obj.style.display, 'none' ,'');}
+ if (obj.length){
+ [].forEach.call(obj, function(el) {el.style.display=_tglval(el.style.display, 'none' ,'');});
+ }
+ if (callback) {callback();}
+ }
+ function fadeTo(obj,opacity,callback){return style(obj,'opacity:'+opacity+';');}
+
+
+ // attributs ----------------------------------------------------
+ function attr(obj,attr,value){
+ obj=_(obj);if (!obj){return false}
+ if (!obj.length){
+ if (value){obj.setAttribute(attr,value);}
+ else{
+ return obj.getAttribute(attr);
+ }
+ }
+ if (obj.length){
+ if (value){
+ [].forEach.call(obj, function(el) {el.setAttribute(attr,value);});
+ }else{return obj[0].getAttribute(attr);}
+ }
+ }
+ function removeAttr(obj,attr,value){
+ obj=_(obj);if (!obj){return false}
+ [].forEach.call(obj, function(el) {el.removeAttribute(attr,value);});
+ }
+ function style(obj,css,callback){return attr(obj,'style',css); }
+ function id(obj){return attr(obj,'id');}
+ function href(obj){return attr(obj,'href');}
+
+
+
+ // Evènement ----------------------------------------------------
+ function on(ev,obj,funct,callback){
+ obj=_(obj);
+ if (!obj){obj=window.document;}
+ if (!obj[0]){_adev(obj,ev,funct);}
+ else{[].forEach.call(obj, function(el) {_adev(el,ev,funct);});}
+ if (callback) {callback();}
+ }
+ function onDomChange(funct,callback){on("DOMSubtreeModified",'',funct);if (callback) {callback();} }
+
+ // divers ----------------------------------------------------
+ function isInViewport(obj) {
+ obj=_(obj,1);if (!obj){return false}
+ var rect = obj.getBoundingClientRect();
+ var html = document.documentElement;
+ return (
+ rect.top >= 0 &&
+ rect.left >= 0 &&
+ rect.bottom <= (window.innerHeight || html.clientHeight) &&
+ rect.right <= (window.innerWidth || html.clientWidth)
+ );
+ }
+ function each(obj,funct,callback){
+ obj=_(obj);if (!obj){return false}
+ if (obj.length){Array.prototype.forEach.call(obj,funct);}
+ if (callback) {callback();}
+ }
+ function numVal(obj){
+ obj=_(obj,1);if (!obj){return false}
+ if (val=attr(obj,"value")){return parseInt(val);}else{return parseInt(obj.innerHTML);}
+ }
+ function value(obj){
+ obj=_(obj,1);if (!obj){return false}
+ if (val=attr(obj,"value")){return val;}else{return obj.innerHTML;}
+ }
+
+function refresh(){location.reload();}
+
+
+
diff --git a/sources/core/js/audio.js b/sources/core/js/audio.js
new file mode 100644
index 0000000..e5fde2b
--- /dev/null
+++ b/sources/core/js/audio.js
@@ -0,0 +1,24 @@
+(function(h,o,g){var p=function(){for(var b=/audio(.min)?.js.*/,a=document.getElementsByTagName("script"),c=0,d=a.length;c ',settings:{autoplay:false,loop:false,preload:true,imageLocation:p+"player-graphics.gif",swfLocation:p+"audiojs.swf",useFlash:function(){var b=document.createElement("audio");return!(b.canPlayType&&b.canPlayType("audio/mpeg;").replace(/no/,""))}(),hasFlash:function(){if(navigator.plugins&&navigator.plugins.length&&navigator.plugins["Shockwave Flash"])return true;else if(navigator.mimeTypes&&navigator.mimeTypes.length){var b=
+navigator.mimeTypes["application/x-shockwave-flash"];return b&&b.enabledPlugin}else try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(a){}return false}(),createPlayer:{markup:' 00:00 /00:00
',
+playPauseClass:"play-pause",scrubberClass:"scrubber",progressClass:"progress",loaderClass:"loaded",timeClass:"time",durationClass:"duration",playedClass:"played",errorMessageClass:"error-message",playingClass:"playing",loadingClass:"loading",errorClass:"error"},css:' .audiojs audio { position: absolute; left: -1px; } .audiojs { width: 460px; height: 36px; background: #404040; overflow: hidden; font-family: monospace; font-size: 12px; background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #444), color-stop(0.5, #555), color-stop(0.51, #444), color-stop(1, #444)); background-image: -moz-linear-gradient(center top, #444 0%, #555 50%, #444 51%, #444 100%); -webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); -moz-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); -o-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); } .audiojs .play-pause { width: 25px; height: 40px; padding: 4px 6px; margin: 0px; float: left; overflow: hidden; border-right: 1px solid #000; } .audiojs p { display: none; width: 25px; height: 40px; margin: 0px; cursor: pointer; } .audiojs .play { display: block; } .audiojs .scrubber { position: relative; float: left; width: 280px; background: #5a5a5a; height: 14px; margin: 10px; border-top: 1px solid #3f3f3f; border-left: 0px; border-bottom: 0px; overflow: hidden; } .audiojs .progress { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #ccc; z-index: 1; background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ccc), color-stop(0.5, #ddd), color-stop(0.51, #ccc), color-stop(1, #ccc)); background-image: -moz-linear-gradient(center top, #ccc 0%, #ddd 50%, #ccc 51%, #ccc 100%); } .audiojs .loaded { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #000; background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.5, #333), color-stop(0.51, #222), color-stop(1, #222)); background-image: -moz-linear-gradient(center top, #222 0%, #333 50%, #222 51%, #222 100%); } .audiojs .time { float: left; height: 36px; line-height: 36px; margin: 0px 0px 0px 6px; padding: 0px 6px 0px 12px; border-left: 1px solid #000; color: #ddd; text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5); } .audiojs .time em { padding: 0px 2px 0px 0px; color: #f9f9f9; font-style: normal; } .audiojs .time strong { padding: 0px 0px 0px 2px; font-weight: normal; } .audiojs .error-message { float: left; display: none; margin: 0px 10px; height: 36px; width: 400px; overflow: hidden; line-height: 36px; white-space: nowrap; color: #fff; text-overflow: ellipsis; -o-text-overflow: ellipsis; -icab-text-overflow: ellipsis; -khtml-text-overflow: ellipsis; -moz-text-overflow: ellipsis; -webkit-text-overflow: ellipsis; } .audiojs .error-message a { color: #eee; text-decoration: none; padding-bottom: 1px; border-bottom: 1px solid #999; white-space: wrap; } .audiojs .play { background: url("$1") -2px -1px no-repeat; } .audiojs .loading { background: url("$1") -2px -31px no-repeat; } .audiojs .error { background: url("$1") -2px -61px no-repeat; } .audiojs .pause { background: url("$1") -2px -91px no-repeat; } .playing .play, .playing .loading, .playing .error { display: none; } .playing .pause { display: block; } .loading .play, .loading .pause, .loading .error { display: none; } .loading .loading { display: block; } .error .time, .error .play, .error .pause, .error .scrubber, .error .loading { display: none; } .error .error { display: block; } .error .play-pause p { cursor: auto; } .error .error-message { display: block; }',
+trackEnded:function(){},flashError:function(){var b=this.settings.createPlayer,a=j(b.errorMessageClass,this.wrapper),c='Missing flash player plugin.';if(this.mp3)c+=' Download audio file .';g[h].helpers.removeClass(this.wrapper,b.loadingClass);g[h].helpers.addClass(this.wrapper,b.errorClass);a.innerHTML=c},loadError:function(){var b=this.settings.createPlayer,a=j(b.errorMessageClass,this.wrapper);g[h].helpers.removeClass(this.wrapper,
+b.loadingClass);g[h].helpers.addClass(this.wrapper,b.errorClass);a.innerHTML='Error loading: "'+this.mp3+'"'},init:function(){g[h].helpers.addClass(this.wrapper,this.settings.createPlayer.loadingClass)},loadStarted:function(){var b=this.settings.createPlayer,a=j(b.durationClass,this.wrapper),c=Math.floor(this.duration/60),d=Math.floor(this.duration%60);g[h].helpers.removeClass(this.wrapper,b.loadingClass);a.innerHTML=(c<10?"0":"")+c+":"+(d<10?"0":"")+d},loadProgress:function(b){var a=this.settings.createPlayer,
+c=j(a.scrubberClass,this.wrapper);j(a.loaderClass,this.wrapper).style.width=c.offsetWidth*b+"px"},playPause:function(){this.playing?this.settings.play():this.settings.pause()},play:function(){g[h].helpers.addClass(this.wrapper,this.settings.createPlayer.playingClass)},pause:function(){g[h].helpers.removeClass(this.wrapper,this.settings.createPlayer.playingClass)},updatePlayhead:function(b){var a=this.settings.createPlayer,c=j(a.scrubberClass,this.wrapper);j(a.progressClass,this.wrapper).style.width=
+c.offsetWidth*b+"px";a=j(a.playedClass,this.wrapper);c=this.duration*b;b=Math.floor(c/60);c=Math.floor(c%60);a.innerHTML=(b<10?"0":"")+b+":"+(c<10?"0":"")+c}},create:function(b,a){a=a||{};return b.length?this.createAll(a,b):this.newInstance(b,a)},createAll:function(b,a){var c=a||document.getElementsByTagName("audio"),d=[];b=b||{};for(var e=0,i=c.length;ea.loadedPercent)){a.updatePlayhead.call(a,[c]);a.element.skipTo(c)}};a.updatePlayhead=function(c){a.settings.updatePlayhead.apply(a,[c])};a.play=function(){if(!a.settings.preload){a.settings.preload=true;a.element.init(a.mp3)}a.playing=true;a.element.pplay();a.settings.play.apply(a)};a.pause=function(){a.playing=false;a.element.ppause();a.settings.pause.apply(a)};a.setVolume=function(c){a.element.setVolume(c)};a.loadStarted=function(){a.swfReady=
+true;a.settings.preload&&a.element.init(a.mp3);a.settings.autoplay&&a.play.apply(a)}},injectFlash:function(b,a){var c=this.flashSource.replace(/\$1/g,a);c=c.replace(/\$2/g,b.settings.swfLocation);c=c.replace(/\$3/g,+new Date+Math.random());var d=b.wrapper.innerHTML,e=document.createElement("div");e.innerHTML=c+d;b.wrapper.innerHTML=e.innerHTML;b.element=this.helpers.getSwf(a)},helpers:{merge:function(b,a){for(attr in a)if(b.hasOwnProperty(attr)||a.hasOwnProperty(attr))b[attr]=a[attr]},clone:function(b){if(b==
+null||typeof b!=="object")return b;var a=new b.constructor,c;for(c in b)a[c]=arguments.callee(b[c]);return a},addClass:function(b,a){RegExp("(\\s|^)"+a+"(\\s|$)").test(b.className)||(b.className+=" "+a)},removeClass:function(b,a){b.className=b.className.replace(RegExp("(\\s|^)"+a+"(\\s|$)")," ")},injectCss:function(b,a){for(var c="",d=document.getElementsByTagName("style"),e=a.replace(/\$1/g,b.settings.imageLocation),i=0,f=d.length;i1?b[b.length-1]:b}},events:{memoryLeaking:false,listeners:[],addListener:function(b,a,c){if(b.addEventListener)b.addEventListener(a,c,false);else if(b.attachEvent){this.listeners.push(b);if(!this.memoryLeaking){window.attachEvent("onunload",function(){if(this.listeners)for(var d=0,e=this.listeners.length;d-1)d||b.init.apply(b);if(b.element.readyState>1){b.settings.autoplay&&b.play.apply(b);clearInterval(a);c=setInterval(function(){b.loadProgress.apply(b);b.loadedPercent>=1&&clearInterval(c)})}},10);b.readyTimer=a;b.loadTimer=c}},purge:function(b){var a=b.attributes,c;if(a)for(c=0;cthis.loadedPercent)){this.element.currentTime=this.duration*b;this.updatePlayhead()}},load:function(b){this.loadStartedCalled=false;this.source.setAttribute("src",b);this.element.load();this.mp3=b;g[h].events.trackLoadProgress(this)},
+loadError:function(){this.settings.loadError.apply(this)},init:function(){this.settings.init.apply(this)},loadStarted:function(){if(!this.element.duration)return false;this.duration=this.element.duration;this.updatePlayhead();this.settings.loadStarted.apply(this)},loadProgress:function(){if(this.element.buffered!=null&&this.element.buffered.length){if(!this.loadStartedCalled)this.loadStartedCalled=this.loadStarted();this.loadedPercent=this.element.buffered.end(this.element.buffered.length-1)/this.duration;
+this.settings.loadProgress.apply(this,[this.loadedPercent])}},playPause:function(){this.playing?this.pause():this.play()},play:function(){/(ipod|iphone|ipad)/i.test(navigator.userAgent)&&this.element.readyState==0&&this.init.apply(this);if(!this.settings.preload){this.settings.preload=true;this.element.setAttribute("preload","auto");g[h].events.trackLoadProgress(this)}this.playing=true;this.element.play();this.settings.play.apply(this)},pause:function(){this.playing=false;this.element.pause();this.settings.pause.apply(this)},
+setVolume:function(b){this.element.volume=b},trackEnded:function(){this.skipTo.apply(this,[0]);this.settings.loop||this.pause.apply(this);this.settings.trackEnded.apply(this)}};var j=function(b,a){var c=[];a=a||document;if(a.getElementsByClassName)c=a.getElementsByClassName(b);else{var d,e,i=a.getElementsByTagName("*"),f=RegExp("(^|\\s)"+b+"(\\s|$)");d=0;for(e=i.length;d1?c:c[0]}})("audiojs","audiojsInstance",this);
diff --git a/sources/core/js/audiojs.swf b/sources/core/js/audiojs.swf
new file mode 100644
index 0000000..483599f
Binary files /dev/null and b/sources/core/js/audiojs.swf differ
diff --git a/sources/core/js/blazy.js b/sources/core/js/blazy.js
new file mode 100644
index 0000000..bb71fbf
--- /dev/null
+++ b/sources/core/js/blazy.js
@@ -0,0 +1,6 @@
+/*!
+ hey, [be]Lazy.js - v1.5.2 - 2015.12.01
+ A lazy loading and multi-serving image script
+ (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy
+*/
+ (function(k,f){"function"===typeof define&&define.amd?define(f):"object"===typeof exports?module.exports=f():k.Blazy=f()})(this,function(){function k(b){var c=b._util;c.elements=v(b.options.selector);c.count=c.elements.length;c.destroyed&&(c.destroyed=!1,b.options.container&&h(b.options.container,function(a){l(a,"scroll",c.validateT)}),l(window,"resize",c.saveViewportOffsetT),l(window,"resize",c.validateT),l(window,"scroll",c.validateT));f(b)}function f(b){for(var c=b._util,a=0;a=e.left&&g.bottom>=e.top&&g.left<=e.right&&g.top<=e.bottom||n(d,b.options.successClass))b.load(d),c.elements.splice(a,1),c.count--,a--}0===c.count&&b.destroy()}function q(b,c,a){if(!n(b,a.successClass)&&(c||a.loadInvisible||0=window.screen.width)return p=a.src,!1});k(a)}});
\ No newline at end of file
diff --git a/sources/core/js/lightbox.js b/sources/core/js/lightbox.js
new file mode 100644
index 0000000..cc3f45d
--- /dev/null
+++ b/sources/core/js/lightbox.js
@@ -0,0 +1,72 @@
+/*
+ Minimalist Lightbox by Bronco (bronco@warriordudimanche.net)
+*/
+var lb_hide=function(){
+ var lb_nav=document.getElementById("lb_nav");
+ var lb_overlay=document.getElementById("lb_overlay");
+
+ lb_overlay.style.height=0;
+ lb_overlay.style.opacity=0;
+ lb_nav.style.height=0;
+ lb_nav.style.opacity=0;
+ event.preventDefault();
+ event.stopPropagation();
+}
+
+var lb_show=function(obj){
+ var lb_overlay=document.getElementById("lb_overlay");
+ var lb_content=document.getElementById("lb_content");
+ var lb_img=document.getElementById("lb_img");
+ var lb_info=document.getElementById("lb_content-info");
+ var lb_nav=document.getElementById("lb_nav");
+ var lb_prev=document.getElementById("lb_prev");
+ var lb_next=document.getElementById("lb_next");
+ var type=obj.getAttribute("data-type");
+ var path=obj.getAttribute("href");
+ var alt=obj.getAttribute("alt");
+ var group=obj.getAttribute("data-group");
+ if (group==null&&path!="prev"&&path!="next"){
+ lb_prev.style.display="none";
+ lb_next.style.display="none";
+ }else{
+ group_set=document.querySelectorAll("a[data-group="+group+"]");
+ if (group_set.length>0){
+ for (var index=0; index0){
+ prev=group_set[index-1];
+ lb_prev.style.display="block";
+ lb_next.setAttribute("style","margin-left:0");
+ }else{
+ prev=null;
+ lb_prev.setAttribute("style","display:none;");
+ lb_next.setAttribute("style","margin-left:32px");
+ }
+ if (index[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+=""+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return""+(escaped?code:escape(code,true))+"\n
"}return''+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"\n"+quote+" \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?" \n":" \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+""+type+">\n"};Renderer.prototype.listitem=function(text){return""+text+" \n"};Renderer.prototype.paragraph=function(text){return""+text+"
\n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+" \n"+"\n"+body+" \n"+"
\n"};Renderer.prototype.tablerow=function(content){return"\n"+content+" \n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+""+type+">\n"};Renderer.prototype.strong=function(text){return""+text+" "};Renderer.prototype.em=function(text){return""+text+" "};Renderer.prototype.codespan=function(text){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?" ":" "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='"+text+" ";return out};Renderer.prototype.image=function(href,title,text){var out=' ":">";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i /g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:"+escape(e.message+"",true)+" "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}());
diff --git a/sources/core/js/micromarkdown.js b/sources/core/js/micromarkdown.js
new file mode 100644
index 0000000..ad19061
--- /dev/null
+++ b/sources/core/js/micromarkdown.js
@@ -0,0 +1,10 @@
+/* * * * * * * * * * * *
+ * micromarkdown .js *
+ * Version 0.3.4 *
+ * License: MIT *
+ * Simon Waldherr *
+ * * * * * * * * * * * */
+
+var micromarkdown={useajax:!1,regexobject:{headline:/^(\#{1,6})([^\#\n]+)$/m,code:/\s\`\`\`\n?([^`]+)\`\`\`/g,hr:/^(?:([\*\-_] ?)+)\1\1$/gm,lists:/^((\s*((\*|\-)|\d(\.|\))) [^\n]+)\n)+/gm,bolditalic:/(?:([\*_~]{1,3}))([^\*_~\n]+[^\*_~\s])\1/g,links:/!?\[([^\]<>]+)\]\(([^ \)<>]+)( "[^\(\)\"]+")?\)/g,reflinks:/\[([^\]]+)\]\[([^\]]+)\]/g,smlinks:/\@([a-z0-9]{3,})\@(t|gh|fb|gp|adn)/gi,mail:/<(([a-z0-9_\-\.])+\@([a-z0-9_\-\.])+\.([a-z]{2,7}))>/gim,tables:/\n(([^|\n]+ *\| *)+([^|\n]+\n))((:?\-+:?\|)+(:?\-+:?)*\n)((([^|\n]+ *\| *)+([^|\n]+)\n)+)/g,include:/[\[<]include (\S+) from (https?:\/\/[a-z0-9\.\-]+\.[a-z]{2,9}[a-z0-9\.\-\?\&\/]+)[\]>]/gi,url:/<([a-zA-Z0-9@:%_\+.~#?&\/=]{2,256}\.[a-z]{2,4}\b(\/[\-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)?)>/g,url2:/[ \t\n]([a-zA-Z]{2,16}:\/\/[a-zA-Z0-9@:%_\+.~#?&=]{2,256}.[a-z]{2,4}\b(\/[\-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)?)[ \t\n]/g},codeblocks:{},parse:function(a,b){"use strict";var c,d,e,f,g,h,i,j,k,l,m,n=0,o=[],p=0,q=0,r=0,s="";for(a="\n"+a+"\n",b!==!0&&(micromarkdown.regexobject.lists=/^((\s*(\*|\d\.) [^\n]+)\n)+/gm),a=a.replace("$&","$&");null!==(m=micromarkdown.regexobject.code.exec(a));)s=micromarkdown.crc32(m[0]),micromarkdown.codeblocks[s]="\n"+micromarkdown.htmlEncode(m[1]).replace(/\n/gm," ").replace(/\ /gm," ")+"
\n",a=a.replace(m[0]," §§§"+s+"§§§ ");for(;null!==(m=micromarkdown.regexobject.headline.exec(a));)k=m[1].length,a=a.replace(m[0],""+m[2]+" \n");for(;null!==(m=micromarkdown.regexobject.lists.exec(a));){for(p=0,l="*"===m[0].trim().substr(0,1)||"-"===m[0].trim().substr(0,1)?"":"",h=m[0].split("\n"),i=[],d=0,g=!1,q=0;qn;)l+=i.pop(),d--,p--;for(;n>d;)"*"===c[0].trim().substr(0,1)||"-"===c[0].trim().substr(0,1)?(l+="")):(l+="",i.push(" ")),d++,p++;l+=""+c[6]+" \n"}for(;p>0;)l+=" ",p--;l+="*"===m[0].trim().substr(0,1)||"-"===m[0].trim().substr(0,1)?"":"",a=a.replace(m[0],l+"\n")}for(;null!==(m=micromarkdown.regexobject.tables.exec(a));){for(l="",h=m[1].split("|"),f=m[4].split("|"),q=0;q",'',' ',' '],q=0;q";for(l+=" ",e=["",' ',' ',' '],i=m[7].split("\n"),q=0;q",r=0;r";l+="\n"}l+="
",a=a.replace(m[0],l)}for(q=0;3>q;q++)for(;null!==(m=micromarkdown.regexobject.bolditalic.exec(a));)if(l=[],"~~"===m[1])a=a.replace(m[0],""+m[2]+"");else{switch(m[1].length){case 1:l=[""," "];break;case 2:l=[""," "];break;case 3:l=[""," "]}a=a.replace(m[0],l[0]+m[2]+l[1])}for(;null!==(m=micromarkdown.regexobject.links.exec(a));)a="!"===m[0].substr(0,1)?a.replace(m[0],' \n'):a.replace(m[0],"'+m[1]+" \n");for(;null!==(m=micromarkdown.regexobject.mail.exec(a));)a=a.replace(m[0],''+m[1]+" ");for(;null!==(m=micromarkdown.regexobject.url.exec(a));)l=m[1],-1===l.indexOf("://")&&(l="http://"+l),a=a.replace(m[0],"'+l.replace(/(https:\/\/|http:\/\/|mailto:|ftp:\/\/)/gim,"")+" ");for(;null!==(m=micromarkdown.regexobject.reflinks.exec(a));)i=new RegExp("\\["+m[2]+"\\]: ?([^ \n]+)","gi"),null!==(h=i.exec(a))&&(a=a.replace(m[0],"'+m[1]+" "),o.push(h[0]));for(q=0;q'+m[1]+" ")}for(;null!==(m=micromarkdown.regexobject.url2.exec(a));)l=m[1],a=a.replace(m[0],"'+l+" ");for(;null!==(m=micromarkdown.regexobject.hr.exec(a));)a=a.replace(m[0],"\n \n");if(micromarkdown.useajax!==!1&&b!==!0)for(;null!==(m=micromarkdown.regexobject.include.exec(a));)if(h=m[2].replace(/[\.\:\/]+/gm,""),i="",document.getElementById(h)?i=document.getElementById(h).innerHTML.trim():micromarkdown.ajax(m[2]),"csv"===m[1]&&""!==i){for(j={";":[]," ":[],",":[],"|":[]},j[0]=[";"," ",",","|"],i=i.split("\n"),r=0;r0&&j[j[0][r]]!==!1&&(j[j[0][r]][q]!==j[j[0][r]][q-1]||1===j[j[0][r]][q])&&(j[j[0][r]]=!1);if(j[";"]!==!1||j[" "]!==!1||j[","]!==!1||j["|"]!==!1){for(j[";"]!==!1?j=";":j[" "]?j=" ":j[","]?j=",":j["|"]&&(j="|"),l="",q=0;q",r=0;r"+micromarkdown.htmlEncode(h[r])+"";l+=""}l+="
",a=a.replace(m[0],l)}else a=a.replace(m[0],""+i.join("\n")+"
")}else a=a.replace(m[0],"");a=a.replace(/ {2,}[\n]{1,}/gim," "),a=a.replace(/[\n]{2,}/gim," ");for(var t in micromarkdown.codeblocks)micromarkdown.codeblocks.hasOwnProperty(t)&&(a=a.replace("§§§"+t+"§§§",micromarkdown.codeblocks[t]));return a=a.replace("$&","$&")},ajax:function(a){"use strict";var b;if(document.getElementById(a.replace(/[\.\:\/]+/gm,"")))return!1;if(window.ActiveXObject)try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){return b=null,c}else b=new XMLHttpRequest;b.onreadystatechange=function(){if(4===b.readyState){var c=document.createElement("code");c.innerHTML=b.responseText,c.id=a.replace(/[\.\:\/]+/gm,""),c.style.display="none",document.getElementsByTagName("body")[0].appendChild(c),micromarkdown.useajax()}},b.open("GET",a,!0),b.setRequestHeader("Content-type","application/x-www-form-urlencoded"),b.send()},crc32:function(a){"use strict";var b,c,d,e,f=0,g=["00000000","77073096","EE0E612C","990951BA","076DC419","706AF48F","E963A535","9E6495A3","0EDB8832","79DCB8A4","E0D5E91E","97D2D988","09B64C2B","7EB17CBD","E7B82D07","90BF1D91","1DB71064","6AB020F2","F3B97148","84BE41DE","1ADAD47D","6DDDE4EB","F4D4B551","83D385C7","136C9856","646BA8C0","FD62F97A","8A65C9EC","14015C4F","63066CD9","FA0F3D63","8D080DF5","3B6E20C8","4C69105E","D56041E4","A2677172","3C03E4D1","4B04D447","D20D85FD","A50AB56B","35B5A8FA","42B2986C","DBBBC9D6","ACBCF940","32D86CE3","45DF5C75","DCD60DCF","ABD13D59","26D930AC","51DE003A","C8D75180","BFD06116","21B4F4B5","56B3C423","CFBA9599","B8BDA50F","2802B89E","5F058808","C60CD9B2","B10BE924","2F6F7C87","58684C11","C1611DAB","B6662D3D","76DC4190","01DB7106","98D220BC","EFD5102A","71B18589","06B6B51F","9FBFE4A5","E8B8D433","7807C9A2","0F00F934","9609A88E","E10E9818","7F6A0DBB","086D3D2D","91646C97","E6635C01","6B6B51F4","1C6C6162","856530D8","F262004E","6C0695ED","1B01A57B","8208F4C1","F50FC457","65B0D9C6","12B7E950","8BBEB8EA","FCB9887C","62DD1DDF","15DA2D49","8CD37CF3","FBD44C65","4DB26158","3AB551CE","A3BC0074","D4BB30E2","4ADFA541","3DD895D7","A4D1C46D","D3D6F4FB","4369E96A","346ED9FC","AD678846","DA60B8D0","44042D73","33031DE5","AA0A4C5F","DD0D7CC9","5005713C","270241AA","BE0B1010","C90C2086","5768B525","206F85B3","B966D409","CE61E49F","5EDEF90E","29D9C998","B0D09822","C7D7A8B4","59B33D17","2EB40D81","B7BD5C3B","C0BA6CAD","EDB88320","9ABFB3B6","03B6E20C","74B1D29A","EAD54739","9DD277AF","04DB2615","73DC1683","E3630B12","94643B84","0D6D6A3E","7A6A5AA8","E40ECF0B","9309FF9D","0A00AE27","7D079EB1","F00F9344","8708A3D2","1E01F268","6906C2FE","F762575D","806567CB","196C3671","6E6B06E7","FED41B76","89D32BE0","10DA7A5A","67DD4ACC","F9B9DF6F","8EBEEFF9","17B7BE43","60B08ED5","D6D6A3E8","A1D1937E","38D8C2C4","4FDFF252","D1BB67F1","A6BC5767","3FB506DD","48B2364B","D80D2BDA","AF0A1B4C","36034AF6","41047A60","DF60EFC3","A867DF55","316E8EEF","4669BE79","CB61B38C","BC66831A","256FD2A0","5268E236","CC0C7795","BB0B4703","220216B9","5505262F","C5BA3BBE","B2BD0B28","2BB45A92","5CB36A04","C2D7FFA7","B5D0CF31","2CD99E8B","5BDEAE1D","9B64C2B0","EC63F226","756AA39C","026D930A","9C0906A9","EB0E363F","72076785","05005713","95BF4A82","E2B87A14","7BB12BAE","0CB61B38","92D28E9B","E5D5BE0D","7CDCEFB7","0BDBDF21","86D3D2D4","F1D4E242","68DDB3F8","1FDA836E","81BE16CD","F6B9265B","6FB077E1","18B74777","88085AE6","FF0F6A70","66063BCA","11010B5C","8F659EFF","F862AE69","616BFFD3","166CCF45","A00AE278","D70DD2EE","4E048354","3903B3C2","A7672661","D06016F7","4969474D","3E6E77DB","AED16A4A","D9D65ADC","40DF0B66","37D83BF0","A9BCAE53","DEBB9EC5","47B2CF7F","30B5FFE9","BDBDF21C","CABAC28A","53B39330","24B4A3A6","BAD03605","CDD70693","54DE5729","23D967BF","B3667A2E","C4614AB8","5D681B02","2A6F2B94","B40BBE37","C30C8EA1","5A05DF1B","2D02EF8D"];for(b=0,c=0,e=a.length,f=-1^f,d=0;e>d;d++)b=255&(f^a.charCodeAt(d)),c="0x"+g[b],f=f>>>8^c;return-1^f},countingChars:function(a,b){"use strict";return a=a.split(b),"object"==typeof a?a.length-1:0},htmlEncode:function(a){"use strict";var b=document.createElement("div");return b.appendChild(document.createTextNode(a)),a=b.innerHTML,b=void 0,a},mmdCSSclass:function(a,b){"use strict";var c;return-1!==a.indexOf("/")&&b!==!0?(c=a.split("/"),c=0===c[1].length?c[2].split("."):c[0].split("."),'class="mmd_'+c[c.length-2].replace(/[^\w\d]/g,"")+c[c.length-1]+'" '):""}};!function(a,b){"use strict";"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.returnExports=b()}(this,function(){"use strict";return micromarkdown});
+
+/* /micromarkdown */
\ No newline at end of file
diff --git a/sources/core/js/playlist.js b/sources/core/js/playlist.js
new file mode 100644
index 0000000..154d879
--- /dev/null
+++ b/sources/core/js/playlist.js
@@ -0,0 +1,40 @@
+function play(song_link) {
+ removeClass(document.querySelectorAll(".sound"),"playing");
+ addClass(song_link,"playing");
+
+ player=document.querySelector("audio");
+ player.setAttribute("src",song_link.getAttribute("data-src"));
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+}
+
+// Setup the player to autoplay the next track (personal change in vanilla js)
+audiojs.events.ready(function() {
+ var a = audiojs.createAll(
+ {
+ trackEnded: function() {
+ var current = document.querySelector(".playing");
+ next=next(current);
+ removeClass(current,"playing");
+ addClass(next,"playing");
+ audio.load(next.getAttribute("data-src"));
+ audio.play();
+ },
+ css:false}
+ );
+ audio=a[0];
+ on ("click","span[data-volume]",function(){
+ audio.setVolume(this.getAttribute("data-volume"));
+ removeClass("span[data-volume]","active");
+ toggleClass(this,"active");
+ event.preventDefault();
+ return false;
+ });
+ // Load in the first track
+ var audio = a[0];
+ first_link=first(".sound");
+ first = first_link.getAttribute("data-src");
+ addClass(first_link,"playing");
+ audio.load(first);
+});
\ No newline at end of file
diff --git a/sources/core/js/qr.js b/sources/core/js/qr.js
new file mode 100644
index 0000000..32da312
--- /dev/null
+++ b/sources/core/js/qr.js
@@ -0,0 +1,760 @@
+/* qr.js -- QR code generator in Javascript (revision 2011-01-19)
+ * Written by Kang Seonghoon .
+ *
+ * This source code is in the public domain; if your jurisdiction does not
+ * recognize the public domain the terms of Creative Commons CC0 license
+ * apply. In the other words, you can always do what you want.
+ */
+
+var QRCode = (function(){
+
+/* Quick overview: QR code composed of 2D array of modules (a rectangular
+ * area that conveys one bit of information); some modules are fixed to help
+ * the recognition of the code, and remaining data modules are further divided
+ * into 8-bit code words which are augumented by Reed-Solomon error correcting
+ * codes (ECC). There could be multiple ECCs, in the case the code is so large
+ * that it is helpful to split the raw data into several chunks.
+ *
+ * The number of modules is determined by the code's "version", ranging from 1
+ * (21x21) to 40 (177x177). How many ECC bits are used is determined by the
+ * ECC level (L/M/Q/H). The number and size (and thus the order of generator
+ * polynomial) of ECCs depend to the version and ECC level.
+ */
+
+// per-version information (cf. JIS X 0510:2004 pp. 30--36, 71)
+//
+// [0]: the degree of generator polynomial by ECC levels
+// [1]: # of code blocks by ECC levels
+// [2]: left-top positions of alignment patterns
+//
+// the number in this table (in particular, [0]) does not exactly match with
+// the numbers in the specficiation. see augumenteccs below for the reason.
+var VERSIONS = [
+ null,
+ [[10, 7,17,13], [ 1, 1, 1, 1], []],
+ [[16,10,28,22], [ 1, 1, 1, 1], [4,16]],
+ [[26,15,22,18], [ 1, 1, 2, 2], [4,20]],
+ [[18,20,16,26], [ 2, 1, 4, 2], [4,24]],
+ [[24,26,22,18], [ 2, 1, 4, 4], [4,28]],
+ [[16,18,28,24], [ 4, 2, 4, 4], [4,32]],
+ [[18,20,26,18], [ 4, 2, 5, 6], [4,20,36]],
+ [[22,24,26,22], [ 4, 2, 6, 6], [4,22,40]],
+ [[22,30,24,20], [ 5, 2, 8, 8], [4,24,44]],
+ [[26,18,28,24], [ 5, 4, 8, 8], [4,26,48]],
+ [[30,20,24,28], [ 5, 4,11, 8], [4,28,52]],
+ [[22,24,28,26], [ 8, 4,11,10], [4,30,56]],
+ [[22,26,22,24], [ 9, 4,16,12], [4,32,60]],
+ [[24,30,24,20], [ 9, 4,16,16], [4,24,44,64]],
+ [[24,22,24,30], [10, 6,18,12], [4,24,46,68]],
+ [[28,24,30,24], [10, 6,16,17], [4,24,48,72]],
+ [[28,28,28,28], [11, 6,19,16], [4,28,52,76]],
+ [[26,30,28,28], [13, 6,21,18], [4,28,54,80]],
+ [[26,28,26,26], [14, 7,25,21], [4,28,56,84]],
+ [[26,28,28,30], [16, 8,25,20], [4,32,60,88]],
+ [[26,28,30,28], [17, 8,25,23], [4,26,48,70,92]],
+ [[28,28,24,30], [17, 9,34,23], [4,24,48,72,96]],
+ [[28,30,30,30], [18, 9,30,25], [4,28,52,76,100]],
+ [[28,30,30,30], [20,10,32,27], [4,26,52,78,104]],
+ [[28,26,30,30], [21,12,35,29], [4,30,56,82,108]],
+ [[28,28,30,28], [23,12,37,34], [4,28,56,84,112]],
+ [[28,30,30,30], [25,12,40,34], [4,32,60,88,116]],
+ [[28,30,30,30], [26,13,42,35], [4,24,48,72,96,120]],
+ [[28,30,30,30], [28,14,45,38], [4,28,52,76,100,124]],
+ [[28,30,30,30], [29,15,48,40], [4,24,50,76,102,128]],
+ [[28,30,30,30], [31,16,51,43], [4,28,54,80,106,132]],
+ [[28,30,30,30], [33,17,54,45], [4,32,58,84,110,136]],
+ [[28,30,30,30], [35,18,57,48], [4,28,56,84,112,140]],
+ [[28,30,30,30], [37,19,60,51], [4,32,60,88,116,144]],
+ [[28,30,30,30], [38,19,63,53], [4,28,52,76,100,124,148]],
+ [[28,30,30,30], [40,20,66,56], [4,22,48,74,100,126,152]],
+ [[28,30,30,30], [43,21,70,59], [4,26,52,78,104,130,156]],
+ [[28,30,30,30], [45,22,74,62], [4,30,56,82,108,134,160]],
+ [[28,30,30,30], [47,24,77,65], [4,24,52,80,108,136,164]],
+ [[28,30,30,30], [49,25,81,68], [4,28,56,84,112,140,168]]];
+
+// mode constants (cf. Table 2 in JIS X 0510:2004 p. 16)
+var MODE_TERMINATOR = 0;
+var MODE_NUMERIC = 1, MODE_ALPHANUMERIC = 2, MODE_OCTET = 4, MODE_KANJI = 8;
+
+// validation regexps
+var NUMERIC_REGEXP = /^\d*$/;
+var ALPHANUMERIC_REGEXP = /^[A-Za-z0-9 $%*+\-./:]*$/;
+var ALPHANUMERIC_OUT_REGEXP = /^[A-Z0-9 $%*+\-./:]*$/;
+
+// ECC levels (cf. Table 22 in JIS X 0510:2004 p. 45)
+var ECCLEVEL_L = 1, ECCLEVEL_M = 0, ECCLEVEL_Q = 3, ECCLEVEL_H = 2;
+
+// GF(2^8)-to-integer mapping with a reducing polynomial x^8+x^4+x^3+x^2+1
+// invariant: GF256_MAP[GF256_INVMAP[i]] == i for all i in [1,256)
+var GF256_MAP = [], GF256_INVMAP = [-1];
+for (var i = 0, v = 1; i < 255; ++i) {
+ GF256_MAP.push(v);
+ GF256_INVMAP[v] = i;
+ v = (v * 2) ^ (v >= 128 ? 0x11d : 0);
+}
+
+// generator polynomials up to degree 30
+// (should match with polynomials in JIS X 0510:2004 Appendix A)
+//
+// generator polynomial of degree K is product of (x-\alpha^0), (x-\alpha^1),
+// ..., (x-\alpha^(K-1)). by convention, we omit the K-th coefficient (always 1)
+// from the result; also other coefficients are written in terms of the exponent
+// to \alpha to avoid the redundant calculation. (see also calculateecc below.)
+var GF256_GENPOLY = [[]];
+for (var i = 0; i < 30; ++i) {
+ var prevpoly = GF256_GENPOLY[i], poly = [];
+ for (var j = 0; j <= i; ++j) {
+ var a = (j < i ? GF256_MAP[prevpoly[j]] : 0);
+ var b = GF256_MAP[(i + (prevpoly[j-1] || 0)) % 255];
+ poly.push(GF256_INVMAP[a ^ b]);
+ }
+ GF256_GENPOLY.push(poly);
+}
+
+// alphanumeric character mapping (cf. Table 5 in JIS X 0510:2004 p. 19)
+var ALPHANUMERIC_MAP = {};
+for (var i = 0; i < 45; ++i) {
+ ALPHANUMERIC_MAP['0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'.charAt(i)] = i;
+}
+
+// mask functions in terms of row # and column #
+// (cf. Table 20 in JIS X 0510:2004 p. 42)
+var MASKFUNCS = [
+ function(i,j) { return (i+j) % 2 == 0; },
+ function(i,j) { return i % 2 == 0; },
+ function(i,j) { return j % 3 == 0; },
+ function(i,j) { return (i+j) % 3 == 0; },
+ function(i,j) { return (((i/2)|0) + ((j/3)|0)) % 2 == 0; },
+ function(i,j) { return (i*j) % 2 + (i*j) % 3 == 0; },
+ function(i,j) { return ((i*j) % 2 + (i*j) % 3) % 2 == 0; },
+ function(i,j) { return ((i+j) % 2 + (i*j) % 3) % 2 == 0; }];
+
+// returns true when the version information has to be embeded.
+var needsverinfo = function(ver) { return ver > 6; };
+
+// returns the size of entire QR code for given version.
+var getsizebyver = function(ver) { return 4 * ver + 17; };
+
+// returns the number of bits available for code words in this version.
+var nfullbits = function(ver) {
+ /*
+ * |<--------------- n --------------->|
+ * | |<----- n-17 ---->| |
+ * +-------+ ///+-------+ ----
+ * | | ///| | ^
+ * | 9x9 | @@@@@ ///| 9x8 | |
+ * | | # # # @5x5@ # # # | | |
+ * +-------+ @@@@@ +-------+ |
+ * # ---|
+ * ^ |
+ * # |
+ * @@@@@ @@@@@ @@@@@ | n
+ * @5x5@ @5x5@ @5x5@ n-17
+ * @@@@@ @@@@@ @@@@@ | |
+ * # | |
+ * ////// v |
+ * //////# ---|
+ * +-------+ @@@@@ @@@@@ |
+ * | | @5x5@ @5x5@ |
+ * | 8x9 | @@@@@ @@@@@ |
+ * | | v
+ * +-------+ ----
+ *
+ * when the entire code has n^2 modules and there are m^2-3 alignment
+ * patterns, we have:
+ * - 225 (= 9x9 + 9x8 + 8x9) modules for finder patterns and
+ * format information;
+ * - 2n-34 (= 2(n-17)) modules for timing patterns;
+ * - 36 (= 3x6 + 6x3) modules for version information, if any;
+ * - 25m^2-75 (= (m^2-3)(5x5)) modules for alignment patterns
+ * if any, but 10m-20 (= 2(m-2)x5) of them overlaps with
+ * timing patterns.
+ */
+ var v = VERSIONS[ver];
+ var nbits = 16*ver*ver + 128*ver + 64; // finder, timing and format info.
+ if (needsverinfo(ver)) nbits -= 36; // version information
+ if (v[2].length) { // alignment patterns
+ nbits -= 25 * v[2].length * v[2].length - 10 * v[2].length - 55;
+ }
+ return nbits;
+};
+
+// returns the number of bits available for data portions (i.e. excludes ECC
+// bits but includes mode and length bits) in this version and ECC level.
+var ndatabits = function(ver, ecclevel) {
+ var nbits = nfullbits(ver) & ~7; // no sub-octet code words
+ var v = VERSIONS[ver];
+ nbits -= 8 * v[0][ecclevel] * v[1][ecclevel]; // ecc bits
+ return nbits;
+}
+
+// returns the number of bits required for the length of data.
+// (cf. Table 3 in JIS X 0510:2004 p. 16)
+var ndatalenbits = function(ver, mode) {
+ switch (mode) {
+ case MODE_NUMERIC: return (ver < 10 ? 10 : ver < 27 ? 12 : 14);
+ case MODE_ALPHANUMERIC: return (ver < 10 ? 9 : ver < 27 ? 11 : 13);
+ case MODE_OCTET: return (ver < 10 ? 8 : 16);
+ case MODE_KANJI: return (ver < 10 ? 8 : ver < 27 ? 10 : 12);
+ }
+};
+
+// returns the maximum length of data possible in given configuration.
+var getmaxdatalen = function(ver, mode, ecclevel) {
+ var nbits = ndatabits(ver, ecclevel) - 4 - ndatalenbits(ver, mode); // 4 for mode bits
+ switch (mode) {
+ case MODE_NUMERIC:
+ return ((nbits/10) | 0) * 3 + (nbits%10 < 4 ? 0 : nbits%10 < 7 ? 1 : 2);
+ case MODE_ALPHANUMERIC:
+ return ((nbits/11) | 0) * 2 + (nbits%11 < 6 ? 0 : 1);
+ case MODE_OCTET:
+ return (nbits/8) | 0;
+ case MODE_KANJI:
+ return (nbits/13) | 0;
+ }
+};
+
+// checks if the given data can be encoded in given mode, and returns
+// the converted data for the further processing if possible. otherwise
+// returns null.
+//
+// this function does not check the length of data; it is a duty of
+// encode function below (as it depends on the version and ECC level too).
+var validatedata = function(mode, data) {
+ switch (mode) {
+ case MODE_NUMERIC:
+ if (!data.match(NUMERIC_REGEXP)) return null;
+ return data;
+
+ case MODE_ALPHANUMERIC:
+ if (!data.match(ALPHANUMERIC_REGEXP)) return null;
+ return data.toUpperCase();
+
+ case MODE_OCTET:
+ if (typeof data === 'string') { // encode as utf-8 string
+ var newdata = [];
+ for (var i = 0; i < data.length; ++i) {
+ var ch = data.charCodeAt(i);
+ if (ch < 0x80) {
+ newdata.push(ch);
+ } else if (ch < 0x800) {
+ newdata.push(0xc0 | (ch >> 6),
+ 0x80 | (ch & 0x3f));
+ } else if (ch < 0x10000) {
+ newdata.push(0xe0 | (ch >> 12),
+ 0x80 | ((ch >> 6) & 0x3f),
+ 0x80 | (ch & 0x3f));
+ } else {
+ newdata.push(0xf0 | (ch >> 18),
+ 0x80 | ((ch >> 12) & 0x3f),
+ 0x80 | ((ch >> 6) & 0x3f),
+ 0x80 | (ch & 0x3f));
+ }
+ }
+ return newdata;
+ } else {
+ return data;
+ }
+ }
+};
+
+// returns the code words (sans ECC bits) for given data and configurations.
+// requires data to be preprocessed by validatedata. no length check is
+// performed, and everything has to be checked before calling this function.
+var encode = function(ver, mode, data, maxbuflen) {
+ var buf = [];
+ var bits = 0, remaining = 8;
+ var datalen = data.length;
+
+ // this function is intentionally no-op when n=0.
+ var pack = function(x, n) {
+ if (n >= remaining) {
+ buf.push(bits | (x >> (n -= remaining)));
+ while (n >= 8) buf.push((x >> (n -= 8)) & 255);
+ bits = 0;
+ remaining = 8;
+ }
+ if (n > 0) bits |= (x & ((1 << n) - 1)) << (remaining -= n);
+ };
+
+ var nlenbits = ndatalenbits(ver, mode);
+ pack(mode, 4);
+ pack(datalen, nlenbits);
+
+ switch (mode) {
+ case MODE_NUMERIC:
+ for (var i = 2; i < datalen; i += 3) {
+ pack(parseInt(data.substring(i-2,i+1), 10), 10);
+ }
+ pack(parseInt(data.substring(i-2), 10), [0,4,7][datalen%3]);
+ break;
+
+ case MODE_ALPHANUMERIC:
+ for (var i = 1; i < datalen; i += 2) {
+ pack(ALPHANUMERIC_MAP[data.charAt(i-1)] * 45 +
+ ALPHANUMERIC_MAP[data.charAt(i)], 11);
+ }
+ if (datalen % 2 == 1) {
+ pack(ALPHANUMERIC_MAP[data.charAt(i-1)], 6);
+ }
+ break;
+
+ case MODE_OCTET:
+ for (var i = 0; i < datalen; ++i) {
+ pack(data[i], 8);
+ }
+ break;
+ };
+
+ // final bits. it is possible that adding terminator causes the buffer
+ // to overflow, but then the buffer truncated to the maximum size will
+ // be valid as the truncated terminator mode bits and padding is
+ // identical in appearance (cf. JIS X 0510:2004 sec 8.4.8).
+ pack(MODE_TERMINATOR, 4);
+ if (remaining < 8) buf.push(bits);
+
+ // the padding to fill up the remaining space. we should not add any
+ // words when the overflow already occurred.
+ while (buf.length + 1 < maxbuflen) buf.push(0xec, 0x11);
+ if (buf.length < maxbuflen) buf.push(0xec);
+ return buf;
+};
+
+// calculates ECC code words for given code words and generator polynomial.
+//
+// this is quite similar to CRC calculation as both Reed-Solomon and CRC use
+// the certain kind of cyclic codes, which is effectively the division of
+// zero-augumented polynomial by the generator polynomial. the only difference
+// is that Reed-Solomon uses GF(2^8), instead of CRC's GF(2), and Reed-Solomon
+// uses the different generator polynomial than CRC's.
+var calculateecc = function(poly, genpoly) {
+ var modulus = poly.slice(0);
+ var polylen = poly.length, genpolylen = genpoly.length;
+ for (var i = 0; i < genpolylen; ++i) modulus.push(0);
+ for (var i = 0; i < polylen; ) {
+ var quotient = GF256_INVMAP[modulus[i++]];
+ if (quotient >= 0) {
+ for (var j = 0; j < genpolylen; ++j) {
+ modulus[i+j] ^= GF256_MAP[(quotient + genpoly[j]) % 255];
+ }
+ }
+ }
+ return modulus.slice(polylen);
+};
+
+// auguments ECC code words to given code words. the resulting words are
+// ready to be encoded in the matrix.
+//
+// the much of actual augumenting procedure follows JIS X 0510:2004 sec 8.7.
+// the code is simplified using the fact that the size of each code & ECC
+// blocks is almost same; for example, when we have 4 blocks and 46 data words
+// the number of code words in those blocks are 11, 11, 12, 12 respectively.
+var augumenteccs = function(poly, nblocks, genpoly) {
+ var subsizes = [];
+ var subsize = (poly.length / nblocks) | 0, subsize0 = 0;
+ var pivot = nblocks - poly.length % nblocks;
+ for (var i = 0; i < pivot; ++i) {
+ subsizes.push(subsize0);
+ subsize0 += subsize;
+ }
+ for (var i = pivot; i < nblocks; ++i) {
+ subsizes.push(subsize0);
+ subsize0 += subsize+1;
+ }
+ subsizes.push(subsize0);
+
+ var eccs = [];
+ for (var i = 0; i < nblocks; ++i) {
+ eccs.push(calculateecc(poly.slice(subsizes[i], subsizes[i+1]), genpoly));
+ }
+
+ var result = [];
+ var nitemsperblock = (poly.length / nblocks) | 0;
+ for (var i = 0; i < nitemsperblock; ++i) {
+ for (var j = 0; j < nblocks; ++j) {
+ result.push(poly[subsizes[j] + i]);
+ }
+ }
+ for (var j = pivot; j < nblocks; ++j) {
+ result.push(poly[subsizes[j+1] - 1]);
+ }
+ for (var i = 0; i < genpoly.length; ++i) {
+ for (var j = 0; j < nblocks; ++j) {
+ result.push(eccs[j][i]);
+ }
+ }
+ return result;
+};
+
+// auguments BCH(p+q,q) code to the polynomial over GF(2), given the proper
+// genpoly. the both input and output are in binary numbers, and unlike
+// calculateecc genpoly should include the 1 bit for the highest degree.
+//
+// actual polynomials used for this procedure are as follows:
+// - p=10, q=5, genpoly=x^10+x^8+x^5+x^4+x^2+x+1 (JIS X 0510:2004 Appendix C)
+// - p=18, q=6, genpoly=x^12+x^11+x^10+x^9+x^8+x^5+x^2+1 (ibid. Appendix D)
+var augumentbch = function(poly, p, genpoly, q) {
+ var modulus = poly << q;
+ for (var i = p - 1; i >= 0; --i) {
+ if ((modulus >> (q+i)) & 1) modulus ^= genpoly << i;
+ }
+ return (poly << q) | modulus;
+};
+
+// creates the base matrix for given version. it returns two matrices, one of
+// them is the actual one and the another represents the "reserved" portion
+// (e.g. finder and timing patterns) of the matrix.
+//
+// some entries in the matrix may be undefined, rather than 0 or 1. this is
+// intentional (no initialization needed!), and putdata below will fill
+// the remaining ones.
+var makebasematrix = function(ver) {
+ var v = VERSIONS[ver], n = getsizebyver(ver);
+ var matrix = [], reserved = [];
+ for (var i = 0; i < n; ++i) {
+ matrix.push([]);
+ reserved.push([]);
+ }
+
+ var blit = function(y, x, h, w, bits) {
+ for (var i = 0; i < h; ++i) {
+ for (var j = 0; j < w; ++j) {
+ matrix[y+i][x+j] = (bits[i] >> j) & 1;
+ reserved[y+i][x+j] = 1;
+ }
+ }
+ };
+
+ // finder patterns and a part of timing patterns
+ // will also mark the format information area (not yet written) as reserved.
+ blit(0, 0, 9, 9, [0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x17f, 0x00, 0x40]);
+ blit(n-8, 0, 8, 9, [0x100, 0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x7f]);
+ blit(0, n-8, 9, 8, [0xfe, 0x82, 0xba, 0xba, 0xba, 0x82, 0xfe, 0x00, 0x00]);
+
+ // the rest of timing patterns
+ for (var i = 9; i < n-8; ++i) {
+ matrix[6][i] = matrix[i][6] = ~i & 1;
+ reserved[6][i] = reserved[i][6] = 1;
+ }
+
+ // alignment patterns
+ var aligns = v[2], m = aligns.length;
+ for (var i = 0; i < m; ++i) {
+ var minj = (i==0 || i==m-1 ? 1 : 0), maxj = (i==0 ? m-1 : m);
+ for (var j = minj; j < maxj; ++j) {
+ blit(aligns[i], aligns[j], 5, 5, [0x1f, 0x11, 0x15, 0x11, 0x1f]);
+ }
+ }
+
+ // version information
+ if (needsverinfo(ver)) {
+ var code = augumentbch(ver, 6, 0x1f25, 12);
+ var k = 0;
+ for (var i = 0; i < 6; ++i) {
+ for (var j = 0; j < 3; ++j) {
+ matrix[i][(n-11)+j] = matrix[(n-11)+j][i] = (code >> k++) & 1;
+ reserved[i][(n-11)+j] = reserved[(n-11)+j][i] = 1;
+ }
+ }
+ }
+
+ return {matrix: matrix, reserved: reserved};
+};
+
+// fills the data portion (i.e. unmarked in reserved) of the matrix with given
+// code words. the size of code words should be no more than available bits,
+// and remaining bits are padded to 0 (cf. JIS X 0510:2004 sec 8.7.3).
+var putdata = function(matrix, reserved, buf) {
+ var n = matrix.length;
+ var k = 0, dir = -1;
+ for (var i = n-1; i >= 0; i -= 2) {
+ if (i == 6) --i; // skip the entire timing pattern column
+ var jj = (dir < 0 ? n-1 : 0);
+ for (var j = 0; j < n; ++j) {
+ for (var ii = i; ii > i-2; --ii) {
+ if (!reserved[jj][ii]) {
+ // may overflow, but (undefined >> x)
+ // is 0 so it will auto-pad to zero.
+ matrix[jj][ii] = (buf[k >> 3] >> (~k&7)) & 1;
+ ++k;
+ }
+ }
+ jj += dir;
+ }
+ dir = -dir;
+ }
+ return matrix;
+};
+
+// XOR-masks the data portion of the matrix. repeating the call with the same
+// arguments will revert the prior call (convenient in the matrix evaluation).
+var maskdata = function(matrix, reserved, mask) {
+ var maskf = MASKFUNCS[mask];
+ var n = matrix.length;
+ for (var i = 0; i < n; ++i) {
+ for (var j = 0; j < n; ++j) {
+ if (!reserved[i][j]) matrix[i][j] ^= maskf(i,j);
+ }
+ }
+ return matrix;
+}
+
+// puts the format information.
+var putformatinfo = function(matrix, reserved, ecclevel, mask) {
+ var n = matrix.length;
+ var code = augumentbch((ecclevel << 3) | mask, 5, 0x537, 10) ^ 0x5412;
+ for (var i = 0; i < 15; ++i) {
+ var r = [0,1,2,3,4,5,7,8,n-7,n-6,n-5,n-4,n-3,n-2,n-1][i];
+ var c = [n-1,n-2,n-3,n-4,n-5,n-6,n-7,n-8,7,5,4,3,2,1,0][i];
+ matrix[r][8] = matrix[8][c] = (code >> i) & 1;
+ // we don't have to mark those bits reserved; always done
+ // in makebasematrix above.
+ }
+ return matrix;
+};
+
+// evaluates the resulting matrix and returns the score (lower is better).
+// (cf. JIS X 0510:2004 sec 8.8.2)
+//
+// the evaluation procedure tries to avoid the problematic patterns naturally
+// occuring from the original matrix. for example, it penaltizes the patterns
+// which just look like the finder pattern which will confuse the decoder.
+// we choose the mask which results in the lowest score among 8 possible ones.
+//
+// note: zxing seems to use the same procedure and in many cases its choice
+// agrees to ours, but sometimes it does not. practically it doesn't matter.
+var evaluatematrix = function(matrix) {
+ // N1+(k-5) points for each consecutive row of k same-colored modules,
+ // where k >= 5. no overlapping row counts.
+ var PENALTY_CONSECUTIVE = 3;
+ // N2 points for each 2x2 block of same-colored modules.
+ // overlapping block does count.
+ var PENALTY_TWOBYTWO = 3;
+ // N3 points for each pattern with >4W:1B:1W:3B:1W:1B or
+ // 1B:1W:3B:1W:1B:>4W, or their multiples (e.g. highly unlikely,
+ // but 13W:3B:3W:9B:3W:3B counts).
+ var PENALTY_FINDERLIKE = 40;
+ // N4*k points for every (5*k)% deviation from 50% black density.
+ // i.e. k=1 for 55~60% and 40~45%, k=2 for 60~65% and 35~40%, etc.
+ var PENALTY_DENSITY = 10;
+
+ var evaluategroup = function(groups) { // assumes [W,B,W,B,W,...,B,W]
+ var score = 0;
+ for (var i = 0; i < groups.length; ++i) {
+ if (groups[i] >= 5) score += PENALTY_CONSECUTIVE + (groups[i]-5);
+ }
+ for (var i = 5; i < groups.length; i += 2) {
+ var p = groups[i];
+ if (groups[i-1] == p && groups[i-2] == 3*p && groups[i-3] == p &&
+ groups[i-4] == p && (groups[i-5] >= 4*p || groups[i+1] >= 4*p)) {
+ // this part differs from zxing...
+ score += PENALTY_FINDERLIKE;
+ }
+ }
+ return score;
+ };
+
+ var n = matrix.length;
+ var score = 0, nblacks = 0;
+ for (var i = 0; i < n; ++i) {
+ var row = matrix[i];
+ var groups;
+
+ // evaluate the current row
+ groups = [0]; // the first empty group of white
+ for (var j = 0; j < n; ) {
+ var k;
+ for (k = 0; j < n && row[j]; ++k) ++j;
+ groups.push(k);
+ for (k = 0; j < n && !row[j]; ++k) ++j;
+ groups.push(k);
+ }
+ score += evaluategroup(groups);
+
+ // evaluate the current column
+ groups = [0];
+ for (var j = 0; j < n; ) {
+ var k;
+ for (k = 0; j < n && matrix[j][i]; ++k) ++j;
+ groups.push(k);
+ for (k = 0; j < n && !matrix[j][i]; ++k) ++j;
+ groups.push(k);
+ }
+ score += evaluategroup(groups);
+
+ // check the 2x2 box and calculate the density
+ var nextrow = matrix[i+1] || [];
+ nblacks += row[0];
+ for (var j = 1; j < n; ++j) {
+ var p = row[j];
+ nblacks += p;
+ // at least comparison with next row should be strict...
+ if (row[j-1] == p && nextrow[j] === p && nextrow[j-1] === p) {
+ score += PENALTY_TWOBYTWO;
+ }
+ }
+ }
+
+ score += PENALTY_DENSITY * ((Math.abs(nblacks / n / n - 0.5) / 0.05) | 0);
+ return score;
+};
+
+// returns the fully encoded QR code matrix which contains given data.
+// it also chooses the best mask automatically when mask is -1.
+var generate = function(data, ver, mode, ecclevel, mask) {
+ var v = VERSIONS[ver];
+ var buf = encode(ver, mode, data, ndatabits(ver, ecclevel) >> 3);
+ buf = augumenteccs(buf, v[1][ecclevel], GF256_GENPOLY[v[0][ecclevel]]);
+
+ var result = makebasematrix(ver);
+ var matrix = result.matrix, reserved = result.reserved;
+ putdata(matrix, reserved, buf);
+
+ if (mask < 0) {
+ // find the best mask
+ maskdata(matrix, reserved, 0);
+ putformatinfo(matrix, reserved, ecclevel, 0);
+ var bestmask = 0, bestscore = evaluatematrix(matrix);
+ maskdata(matrix, reserved, 0);
+ for (mask = 1; mask < 8; ++mask) {
+ maskdata(matrix, reserved, mask);
+ putformatinfo(matrix, reserved, ecclevel, mask);
+ var score = evaluatematrix(matrix);
+ if (bestscore > score) {
+ bestscore = score;
+ bestmask = mask;
+ }
+ maskdata(matrix, reserved, mask);
+ }
+ mask = bestmask;
+ }
+
+ maskdata(matrix, reserved, mask);
+ putformatinfo(matrix, reserved, ecclevel, mask);
+ return matrix;
+};
+
+// the public interface is trivial; the options available are as follows:
+//
+// - version: an integer in [1,40]. when omitted (or -1) the smallest possible
+// version is chosen.
+// - mode: one of 'numeric', 'alphanumeric', 'octet'. when omitted the smallest
+// possible mode is chosen.
+// - ecclevel: one of 'L', 'M', 'Q', 'H'. defaults to 'L'.
+// - mask: an integer in [0,7]. when omitted (or -1) the best mask is chosen.
+//
+// for generate{HTML,PNG}:
+//
+// - modulesize: a number. this is a size of each modules in pixels, and
+// defaults to 5px.
+// - margin: a number. this is a size of margin in *modules*, and defaults to
+// 4 (white modules). the specficiation mandates the margin no less than 4
+// modules, so it is better not to alter this value unless you know what
+// you're doing.
+var QRCode = {
+ 'generate': function(data, options) {
+ var MODES = {'numeric': MODE_NUMERIC, 'alphanumeric': MODE_ALPHANUMERIC,
+ 'octet': MODE_OCTET};
+ var ECCLEVELS = {'L': ECCLEVEL_L, 'M': ECCLEVEL_M, 'Q': ECCLEVEL_Q,
+ 'H': ECCLEVEL_H};
+
+ options = options || {};
+ var ver = options.version || -1;
+ var ecclevel = ECCLEVELS[(options.ecclevel || 'L').toUpperCase()];
+ var mode = options.mode ? MODES[options.mode.toLowerCase()] : -1;
+ var mask = 'mask' in options ? options.mask : -1;
+
+ if (mode < 0) {
+ if (typeof data === 'string') {
+ if (data.match(NUMERIC_REGEXP)) {
+ mode = MODE_NUMERIC;
+ } else if (data.match(ALPHANUMERIC_OUT_REGEXP)) {
+ // while encode supports case-insensitive
+ // encoding, we restrict the data to be
+ // uppercased when auto-selecting the mode.
+ mode = MODE_ALPHANUMERIC;
+ } else {
+ mode = MODE_OCTET;
+ }
+ } else {
+ mode = MODE_OCTET;
+ }
+ } else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC ||
+ mode == MODE_OCTET)) {
+ throw 'invalid or unsupported mode';
+ }
+
+ data = validatedata(mode, data);
+ if (data === null) throw 'invalid data format';
+
+ if (ecclevel < 0 || ecclevel > 3) throw 'invalid ECC level';
+
+ if (ver < 0) {
+ for (ver = 1; ver <= 40; ++ver) {
+ if (data.length <= getmaxdatalen(ver, mode, ecclevel)) break;
+ }
+ if (ver > 40) throw 'too large data';
+ } else if (ver < 1 || ver > 40) {
+ throw 'invalid version';
+ }
+
+ if (mask != -1 && (mask < 0 || mask > 8)) throw 'invalid mask';
+
+ return generate(data, ver, mode, ecclevel, mask);
+ },
+
+ 'generateHTML': function(data, options) {
+ options = options || {};
+ var matrix = QRCode['generate'](data, options);
+ var modsize = Math.max(options.modulesize || 5, 0.5);
+ var margin = Math.max(options.margin || 4, 0.0);
+
+ var e = document.createElement('div');
+ var n = matrix.length;
+ var html = [''];
+ for (var i = 0; i < n; ++i) {
+ html.push('');
+ for (var j = 0; j < n; ++j) {
+ html.push(' ');
+ }
+ html.push(' ');
+ }
+ e.className = 'qrcode';
+ e.innerHTML = html.join('') + '
';
+ return e;
+ },
+
+ 'generatePNG': function(data, options) {
+ options = options || {};
+ var matrix = QRCode['generate'](data, options);
+ var modsize = Math.max(options.modulesize || 5, 0.5);
+ var margin = Math.max(options.margin || 4, 0.0);
+ var n = matrix.length;
+ var size = modsize * (n + 2 * margin);
+
+ var canvas = document.createElement('canvas'), context;
+ canvas.width = canvas.height = size;
+ context = canvas.getContext('2d');
+ if (!context) throw 'canvas support is needed for PNG output';
+
+ context.fillStyle = '#fff';
+ context.fillRect(0, 0, size, size);
+ context.fillStyle = '#000';
+ for (var i = 0; i < n; ++i) {
+ for (var j = 0; j < n; ++j) {
+ if (matrix[i][j]) {
+ context.fillRect(modsize * (margin + j),
+ modsize * (margin + i),
+ modsize, modsize);
+ }
+ }
+ }
+ //context.fillText('evaluation: ' + evaluatematrix(matrix), 10, 10);
+ return canvas.toDataURL();
+ }
+};
+
+return QRCode;
+})();
diff --git a/sources/core/js/scrolltotop.js b/sources/core/js/scrolltotop.js
new file mode 100644
index 0000000..03495d8
--- /dev/null
+++ b/sources/core/js/scrolltotop.js
@@ -0,0 +1,94 @@
+/*
+# ------------------ BEGIN LICENSE BLOCK ------------------
+#
+# Copyright (c) 2009 - 2014 Cyril MAGUIRE
+# Licensed under the CeCILL v2.1 license.
+# See http://www.cecill.info/licences.fr.html
+#
+# ------------------- END LICENSE BLOCK -------------------
+*/
+;(function(window,undefined) {
+
+ 'use_strict';
+
+ var timeOut;
+ var isIE = isIE();
+ var bodyTag = first('body');
+ var idOfBody = id(bodyTag);
+ if (idOfBody == null) {
+ idOfBody = 'top';
+ bodyTag.setAttribute('id', 'top');
+ }
+
+ function isIE() {
+ var nav = navigator.userAgent.toLowerCase();
+ return (nav.indexOf('msie') != -1) ? parseInt(nav.split('msie')[1]) : false;
+ }
+
+ function backToTop() {
+ if (document.body.scrollTop!=0 || document.documentElement.scrollTop!=0){
+ window.scrollBy(0,-50);
+ timeOut=setTimeout('backToTop()',10);
+ }
+ else {
+ clearTimeout(timeOut);
+ }
+ }
+
+ function getScrollPosition() {
+ return Array((document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft,(document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop);
+ }
+
+ function Remove(idOfParent,idToRemove) {
+ if (isIE) {
+ document.getElementById(idToRemove).removeNode(true);
+ } else {
+ var Node1 = document.getElementById(idOfParent);
+ var len = Node1.childNodes.length;
+
+ for(var i = 0; i < len; i++){
+ if (Node1.childNodes[i] != undefined && Node1.childNodes[i].id != undefined && Node1.childNodes[i].id == idToRemove){
+ Node1.removeChild(Node1.childNodes[i]);
+ }
+ }
+ }
+ }
+
+ function addElement(idOfParent,idToAdd,htmlToInsert) {
+ var DomParent = document.getElementById(idOfParent);//id of body
+ var newdiv = document.createElement('div');
+
+ newdiv.setAttribute('id',idToAdd);
+ newdiv.innerHTML = htmlToInsert;
+
+ DomParent.appendChild(newdiv);
+ }
+
+ function displayBackButton() {
+ var pos = [];
+ var fleche = '▲';
+
+ if (isIE) {
+ fleche = '▲';
+ }
+ pos = getScrollPosition();
+ var topLink = document.getElementById('toplink');
+ if (pos[1] > 150) {
+ if (topLink == null) {
+ addElement(idOfBody,'toplink',''+fleche+' ');
+ }
+ } else {
+ if (topLink != null) {
+ Remove(idOfBody,'toplink');
+ }
+ }
+ }
+
+ //add to global namespace
+ window.onscroll = displayBackButton;
+ window.displayBackButton = displayBackButton;
+ window.backToTop = backToTop;
+
+
+})(window);
+
\ No newline at end of file
diff --git a/sources/core/js/sorttable.js b/sources/core/js/sorttable.js
new file mode 100644
index 0000000..38b0fc6
--- /dev/null
+++ b/sources/core/js/sorttable.js
@@ -0,0 +1,495 @@
+/*
+ SortTable
+ version 2
+ 7th April 2007
+ Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
+
+ Instructions:
+ Download this file
+ Add to your HTML
+ Add class="sortable" to any table you'd like to make sortable
+ Click on the headers to sort
+
+ Thanks to many, many people for contributions and suggestions.
+ Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
+ This basically means: do what you want with it.
+*/
+
+
+var stIsIE = /*@cc_on!@*/false;
+
+sorttable = {
+ init: function() {
+ // quit if this function has already been called
+ if (arguments.callee.done) return;
+ // flag this function so we don't do the same thing twice
+ arguments.callee.done = true;
+ // kill the timer
+ if (_timer) clearInterval(_timer);
+
+ if (!document.createElement || !document.getElementsByTagName) return;
+
+ sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
+
+ forEach(document.getElementsByTagName('table'), function(table) {
+ if (table.className.search(/\bsortable\b/) != -1) {
+ sorttable.makeSortable(table);
+ }
+ });
+
+ },
+
+ makeSortable: function(table) {
+ if (table.getElementsByTagName('thead').length == 0) {
+ // table doesn't have a tHead. Since it should have, create one and
+ // put the first table row in it.
+ the = document.createElement('thead');
+ the.appendChild(table.rows[0]);
+ table.insertBefore(the,table.firstChild);
+ }
+ // Safari doesn't support table.tHead, sigh
+ if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
+
+ if (table.tHead.rows.length != 1) return; // can't cope with two header rows
+
+ // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
+ // "total" rows, for example). This is B&R, since what you're supposed
+ // to do is put them in a tfoot. So, if there are sortbottom rows,
+ // for backwards compatibility, move them to tfoot (creating it if needed).
+ sortbottomrows = [];
+ for (var i=0; i5' : ' ▴';
+ this.appendChild(sortrevind);
+ return;
+ }
+ if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
+ // if we're already sorted by this column in reverse, just
+ // re-reverse the table, which is quicker
+ sorttable.reverse(this.sorttable_tbody);
+ this.className = this.className.replace('sorttable_sorted_reverse',
+ 'sorttable_sorted');
+ this.removeChild(document.getElementById('sorttable_sortrevind'));
+ sortfwdind = document.createElement('span');
+ sortfwdind.id = "sorttable_sortfwdind";
+ sortfwdind.innerHTML = stIsIE ? ' 6 ' : ' ▾';
+ this.appendChild(sortfwdind);
+ return;
+ }
+
+ // remove sorttable_sorted classes
+ theadrow = this.parentNode;
+ forEach(theadrow.childNodes, function(cell) {
+ if (cell.nodeType == 1) { // an element
+ cell.className = cell.className.replace('sorttable_sorted_reverse','');
+ cell.className = cell.className.replace('sorttable_sorted','');
+ }
+ });
+ sortfwdind = document.getElementById('sorttable_sortfwdind');
+ if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
+ sortrevind = document.getElementById('sorttable_sortrevind');
+ if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
+
+ this.className += ' sorttable_sorted';
+ sortfwdind = document.createElement('span');
+ sortfwdind.id = "sorttable_sortfwdind";
+ sortfwdind.innerHTML = stIsIE ? ' 6 ' : ' ▾';
+ this.appendChild(sortfwdind);
+
+ // build an array to sort. This is a Schwartzian transform thing,
+ // i.e., we "decorate" each row with the actual sort key,
+ // sort based on the sort keys, and then put the rows back in order
+ // which is a lot faster because you only do getInnerText once per row
+ row_array = [];
+ col = this.sorttable_columnindex;
+ rows = this.sorttable_tbody.rows;
+ for (var j=0; j 12) {
+ // definitely dd/mm
+ return sorttable.sort_ddmm;
+ } else if (second > 12) {
+ return sorttable.sort_mmdd;
+ } else {
+ // looks like a date, but we can't tell which, so assume
+ // that it's dd/mm (English imperialism!) and keep looking
+ sortfn = sorttable.sort_ddmm;
+ }
+ }
+ }
+ }
+ return sortfn;
+ },
+
+ getInnerText: function(node) {
+ // gets the text we want to use for sorting for a cell.
+ // strips leading and trailing whitespace.
+ // this is *not* a generic getInnerText function; it's special to sorttable.
+ // for example, you can override the cell text with a customkey attribute.
+ // it also gets .value for fields.
+
+ if (!node) return "";
+
+ hasInputs = (typeof node.getElementsByTagName == 'function') &&
+ node.getElementsByTagName('input').length;
+
+ if (node.getAttribute("sorttable_customkey") != null) {
+ return node.getAttribute("sorttable_customkey");
+ }
+ else if (typeof node.textContent != 'undefined' && !hasInputs) {
+ return node.textContent.replace(/^\s+|\s+$/g, '');
+ }
+ else if (typeof node.innerText != 'undefined' && !hasInputs) {
+ return node.innerText.replace(/^\s+|\s+$/g, '');
+ }
+ else if (typeof node.text != 'undefined' && !hasInputs) {
+ return node.text.replace(/^\s+|\s+$/g, '');
+ }
+ else {
+ switch (node.nodeType) {
+ case 3:
+ if (node.nodeName.toLowerCase() == 'input') {
+ return node.value.replace(/^\s+|\s+$/g, '');
+ }
+ case 4:
+ return node.nodeValue.replace(/^\s+|\s+$/g, '');
+ break;
+ case 1:
+ case 11:
+ var innerText = '';
+ for (var i = 0; i < node.childNodes.length; i++) {
+ innerText += sorttable.getInnerText(node.childNodes[i]);
+ }
+ return innerText.replace(/^\s+|\s+$/g, '');
+ break;
+ default:
+ return '';
+ }
+ }
+ },
+
+ reverse: function(tbody) {
+ // reverse the rows in a tbody
+ newrows = [];
+ for (var i=0; i=0; i--) {
+ tbody.appendChild(newrows[i]);
+ }
+ delete newrows;
+ },
+
+ /* sort functions
+ each sort function takes two parameters, a and b
+ you are comparing a[0] and b[0] */
+ sort_numeric: function(a,b) {
+ aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
+ if (isNaN(aa)) aa = 0;
+ bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
+ if (isNaN(bb)) bb = 0;
+ return aa-bb;
+ },
+ sort_alpha: function(a,b) {
+ if (a[0]==b[0]) return 0;
+ if (a[0] 0 ) {
+ var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
+ swap = true;
+ }
+ } // for
+ t--;
+
+ if (!swap) break;
+
+ for(var i = t; i > b; --i) {
+ if ( comp_func(list[i], list[i-1]) < 0 ) {
+ var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
+ swap = true;
+ }
+ } // for
+ b++;
+
+ } // while(swap)
+ }
+}
+
+/* ******************************************************************
+ Supporting functions: bundled here to avoid depending on a library
+ ****************************************************************** */
+
+// Dean Edwards/Matthias Miller/John Resig
+
+/* for Mozilla/Opera9 */
+if (document.addEventListener) {
+ document.addEventListener("DOMContentLoaded", sorttable.init, false);
+}
+
+/* for Internet Explorer */
+/*@cc_on @*/
+/*@if (@_win32)
+ document.write("
+
+ ';
+ $m3u='
+
+
+
+
+ ';
+ if(!empty($f)){
+ set_time_limit (0);
+ store_access_stat($f,$id);
+ $call_qrcode=' ';
+
+ # password mode
+ if (isset($_POST['password'])){
+ # the file id is a md5 password.original id
+ $blured=blur_password($_POST['password']);
+ $sub_id=str_replace($blured,'',$id); # here we try to recover the original id to compare
+ }
+ if (strlen($id)>23 && empty($_POST['password'])){
+ require(THEME_PATH.'/header.php');
+ echo '
+
+
'.e('This share is protected, please type the correct password:',false).'
+
+
+ ';
+ require(THEME_PATH.'/footer.php');
+ }else if(empty($_POST['password'])||!empty($_POST['password']) && $blured.$sub_id==$id){
+ # normal mode or access granted
+ if ($f && is_file($f)){
+
+ # file request => return file according to $behaviour var (see core.php)
+ $type=_mime_content_type($f);
+ $ext=strtolower(pathinfo($f,PATHINFO_EXTENSION));
+ if ($ext=='md'){
+ include('core/markdown.php');
+ require(THEME_PATH.'/header_markdown.php');
+ echo $qrcode;
+ echo parse(url2link(file_get_contents($f)));
+ echo $call_qrcode;
+ require(THEME_PATH.'/footer_markdown.php');
+
+ }else if ($ext=='m3u'){
+ require(THEME_PATH.'/header.php');
+ echo $qrcode;
+ echo str_replace('index.php?f='.$id,'#m3u_link',$templates['dialog_share']);
+ echo $call_qrcode;
+ require(THEME_PATH.'/footer.php');
+
+ }else if (is_in($ext,'FILES_TO_ECHO')!==false){
+ require(THEME_PATH.'/header.php');
+ echo $qrcode;
+ echo ''.htmlspecialchars(file_get_contents($f)).' ';
+ echo $call_qrcode;
+ require(THEME_PATH.'/footer.php');
+ }else if (is_in($ext,'FILES_TO_RETURN')!==false||$type=='text/plain'&&empty($ext)){
+ header('Content-type: '.$type.'; charset=utf-8');
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Length: '.filesize($f));
+ readfile($f);
+ }else{
+ header('Content-type: '.$type);
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Length: '.filesize($f));
+ # lance le téléchargement des fichiers non affichables
+ header('Content-Disposition: attachment; filename="'._basename($f).'"');
+ readfile($f);
+ }
+ # burn access ?
+ burned($id);
+ exit();
+
+ }else if ($f && is_dir($f)){
+ # folder request: return the folder & subfolders tree
+ $tree=tree($f,return_owner($id),false,true);
+ if (!isset($_GET['rss'])&&!isset($_GET['json'])){ # no html, header etc for rss feed & json data
+ require(THEME_PATH.'/header.php');
+ echo $qrcode;
+ echo ' ';
+ draw_tree($tree);
+ echo '
';
+ echo '
+ '.$call_qrcode;
+ if ($allow_shared_folder_RSS_feed||$allow_shared_folder_JSON_feed){
+ echo '
'.e('This page in',false);
+ }
+ if ($allow_shared_folder_RSS_feed){
+ echo ' ';
+ }
+ if ($allow_shared_folder_JSON_feed){
+ echo '
Json ';
+ }
+ if ($allow_shared_folder_download){
+ echo '
+
'.e('Download a zip from this folder',false).'';
+ }
+ echo '
';
+ require(THEME_PATH.'/footer.php');
+ }
+
+ }else{
+ require(THEME_PATH.'/header.php');
+ echo '
+
+ '.e('This link is no longer available, sorry.',false).'
+
+
';
+ require(THEME_PATH.'/footer.php');
+ }
+
+ # json format of a shared folder (but not for a locked one)
+ if (isset($_GET['json']) && !empty($tree) && strlen($id)<=23){
+ $upload_path_size=strlen($_SESSION['upload_root_path']);
+ foreach ($tree as $branch){
+ $id_tree[file2id($branch)]=$branch;
+ }
+ # burn access ?
+ burned($id);
+ exit(json_encode($id_tree));
+ }
+
+ # RSS format of a shared folder (but not for a locked one)
+ if (isset($_GET['rss']) && !empty($tree) && strlen($id)<=23){
+ $rss=array('infos'=>'','items'=>'');
+ $rss['infos']=array(
+ 'title'=>_basename($f),
+ 'description'=>e('Rss feed of ',false)._basename($f),
+ //'guid'=>$_SESSION['home'].'?f='.$id,
+ 'link'=>htmlentities($_SESSION['home'].'?f='.$id.'&rss'),
+ );
+
+ include('core/Array2feed.php');
+ $upload_path_size=strlen($_SESSION['upload_root_path']);
+ foreach ($tree as $branch){
+ $id_branch=file2id($branch);
+ $rss['items'][]=array(
+ 'title'=>_basename($branch),
+ 'description'=>'',
+ 'pubDate'=>makeRSSdate(date("d-m-Y H:i:s.",filemtime($branch))),
+ 'link'=>$_SESSION['home'].'?f='.$id_branch,
+ 'guid'=>$_SESSION['home'].'?f='.$id_branch,
+ );
+ }
+ array2feed($rss);
+ # burn access ?
+ burned($id);
+ exit();
+ }
+ }
+
+ }else{
+ require(THEME_PATH.'/header.php');
+ echo '
+
+ '.e('This link is no longer available, sorry.',false).'
+
+
';
+ require(THEME_PATH.'/footer.php');
+ }
+
+
+
+?>
\ No newline at end of file
diff --git a/sources/core/templates.php b/sources/core/templates.php
new file mode 100644
index 0000000..952f6fd
--- /dev/null
+++ b/sources/core/templates.php
@@ -0,0 +1,71 @@
+e('Delete this file',false),
+ '#tooltip_link'=>e('Get the share link',false),
+ '#tooltip_qrcode'=>e('Get the qrcode of this link',false),
+ '#tooltip_rename'=>e('Rename this file (share link will not change)',false),
+ '#tooltip_lock'=>e('Put a password on this share',false),
+ '#tooltip_burn'=>e('Turn this share into a burn after access share',false),
+ '#tooltip_renew'=>e('Regen the share link',false),
+ '#tooltip_zipfolder'=>e('Download a zip from this folder',false),
+ '#Move_file_or_folder'=>e('Move file or folder',false),
+ '#Move_to'=>e('Move to',false),
+ '#Move'=>e('Move',false),
+ '#To'=>e('To',false),
+ '#Lock_access'=>e('Lock access',false),
+ '#Please_give_a_password'=>e('Please give a password to lock access to this file',false),
+ '#Rename_file'=>e('Rename this file?',false),
+ '#Rename_item'=>e('Rename this item?',false),
+ '#Rename'=>e('Rename',false),
+ '#Delete_item'=>e('Delete this item?',false),
+ '#Delete'=>e('Delete',false),
+ '#Share_folder'=>e('Share folder',false),
+ '#Share_link'=>e('Share link',false),
+ '#share_text'=>e('Select the users you want to share with',false),
+ '#Copy_link'=>e('Copy this share link',false),
+ '#theme'=>THEME_PATH,
+ '#YES'=>e('Yes',false),
+ '#Move_to'=>e('Move this file to another directory',false),
+ '#Create_new_folder'=>e('Create a subfolder',false),
+ '#Create_folder_title'=>e('Create a subfolder in this folder',false),
+ '#New_folder'=>e('New folder',false),
+ '#paste_url'=>e('Paste a file\'s URL',false),
+ '#paste_url_title'=>e('Paste a file\'s URL to get it on this server',false),
+ '#Read_m3u_playlist'=>e('Read m3u playlist',false),
+ '#local_filename'=>e('Force local filename (leave empty=no change)',false),
+ '#filename'=>e('filename (optionnal)',false),
+
+);
+if (!empty($token)){
+ $replacement['#TOKEN']=$token;
+}
+function load_templates($tpl_array=null){
+ global $replacement;
+ $k=array_keys($replacement);
+ $r=array_values($replacement);
+ $path=THEME_PATH.'/templates/';
+ if (empty($tpl_array)){
+ $tpl_array=_glob($path,$pattern='html');
+ }
+ foreach($tpl_array as $key=>$tpl){
+ $tpl=_basename($tpl);
+ $tpl_name=substr($tpl,0,strlen($tpl)-5);
+ $templates[$tpl_name]=str_replace($k,$r,file_get_contents($path.$tpl));
+ }
+ return $templates;
+}
+
+$templates=load_templates();
+
+
+
+?>
diff --git a/sources/core/test.html b/sources/core/test.html
new file mode 100644
index 0000000..b018b40
--- /dev/null
+++ b/sources/core/test.html
@@ -0,0 +1,2298 @@
+
+
+Bédés
+ #One Shot
+
+ 0 à 9
+
+ 4 Princes De Ganahan (Les)
+
+ 9-11
+
+ 28 jours plus tard
+
+ 42 agents intergalactiques
+
+ 100 âmes
+
+ 666
+
+
+ A
+
+ Abymes
+
+ Achile Talon
+
+ Acriborea
+
+ ADN
+
+ Aigles de Rome (Les)
+
+ Aigles Décapités (Les)
+
+ Ailes Du Phaeton (Les)
+
+ Akira
+
+ Alcyon
+
+ Alim Le Tanneur
+
+ Alpha
+
+ Alter Ego
+
+ Alzéor Mondraggo
+
+ Ames d'Hélios (Les)
+
+ Amulet
+
+ Anachron
+
+ Anahire
+
+ Angor
+
+ Anita Bomba
+
+ Apocalypse Mania
+
+ Aquablue
+
+ Arawn
+
+ Arcanes
+
+ Arcanes d'Alya (Les)
+
+ Arcanes du Minuit Midi (Les)
+
+ Arctica
+
+ Aria
+
+ Asceltis
+
+ Ash
+
+ Asphodèle
+
+ Aspic
+
+ Assassin
+
+ Astérix
+
+ Atalante
+
+ Atalante - L'odyssée
+
+ Attila Mon Amour
+
+ Auberge du bout du monde (L)
+
+ Au delà des Nuages
+
+ Avant l'Incal
+
+ Aventure rocambolesque (Une)
+
+ Aventures d'Alef Thau (Les)
+
+ Awrah
+
+ Azur
+
+
+ B
+
+ Back World
+
+ Balade Au Bout du Monde
+
+ Balle dans la tête (Une)
+
+ Barracuda
+
+ Beauté
+
+ Bidochons (Les)
+
+ Black Op
+
+ Black Sad
+
+ Blake Et Mortimer
+
+ Blast
+
+ Bleu Lézard
+
+ Block 109
+
+ Blondes (Les)
+
+ Blueberry
+
+ Boche (Le)
+
+ Bone
+
+ Borderline
+
+ Boule et Bill
+
+ Bouncer
+
+
+ C
+
+ Canardo
+
+ Cape et de Crocs (De)
+
+ Carmen Mc Callum
+
+ Carnets de Darwin (Les)
+
+ Carême
+
+ Casse (Le)
+
+ Cassio
+
+ Castaka
+
+ Caste Des Méta-barons (La)
+
+ Cellule Poison
+
+ Ce qui est à Nous
+
+ Cercle de Minsk (Le)
+
+ Cercles d'Akamoth (Les)
+
+ Chambres Noires
+
+ Champs d'Azur (Les)
+
+ Chant d'excalibur (Le)
+
+ Chant Des Stryges (Le)
+
+ Chasseur d'éclairs (Le)
+
+ Chasseurs de Reliques
+
+ Chat (Le)
+
+ Chat du Rabbin (Le)
+
+ Chats
+
+ Chinaman
+
+ Chronique des immortels (La)
+
+ Chroniques Barbares
+
+ Chroniques de La Lune Noire (Les)
+
+ Chroniques de Légion (Les)
+
+ Chroniques de Magon (Les)
+
+ Cicatrice du souvenir (La)
+
+ Cinquième Evangile (Le)
+
+ Clan des Chimères (Le)
+
+ Code Mc Callum
+
+ Coeur de Sang (Le)
+
+ Coeurs Boudinés (Les)
+
+ Collège invisible (Le)
+
+ Combat Ordinaire (Le)
+
+ Commedia des ratés (La)
+
+ Communardes
+
+ Complainte des Landes Perdues
+
+ Comptines D'Halloween
+
+ Confrérie du Crabe (La)
+
+ Conquistador
+
+ Contes du Korrigan (Les)
+
+ Corpus Hermeticum
+
+ Croisade
+
+ Croix de Cazenac (La)
+
+ Cross Fire
+
+ Cryozone
+
+ Crève Coeur
+
+ Crépuscule des Dieux (Le)
+
+ Cycle des deux Horizons (Le)
+
+ Cyclopes
+
+ Cédric
+
+ Célestin Gobe La Lune
+
+
+ D
+
+ D
+
+ Dallas Bar
+
+ Dantes
+
+ Dent D'Ours
+
+ Dernier livre de la jungle (Le)
+
+ Dernier Templier (Le)
+
+ Dernier Troyen (Le)
+
+ Destins
+
+ Donjon
+
+ Donjon de Naheulbeuk (Le)
+
+ pdf T01 (S01, P01).pdf
+ pdf T02 (S01, P02).pdf
+ pdf T03 (S02, P01).pdf
+ pdf T04 (S02, P02).pdf
+ pdf T05 (S02, P03).pdf
+ pdf T06 (S02, P04).pdf
+ pdf T07 (S03, P01).pdf
+ pdf T08 (S03, P02).pdf
+ pdf T09 (S03, P03).pdf
+ pdf T10 (S04, P01).pdf
+ pdf T11 (S04, P02).pdf
+ pdf T12 (S04, P03).pdf
+ pdf T13 (S04, P04).pdf
+ pdf T16 (S05, P03).pdf
+ pdf T17.pdf
+
+ Double Gauche
+
+ Double Je
+
+ Double Masque
+
+ Décalogue (Le)
+
+ Démons d'Alexia (Les)
+
+
+ E
+
+ Eaux de Mortelune (Les)
+
+ Ecluses du Ciel (Les)
+
+ Ecole Capucine (L)
+
+ Ekho
+
+ Elfes
+
+ Elixirs
+
+ El Nino
+
+ Elyne
+
+ Empire USA
+
+ Enfants d'ailleurs (Les)
+
+ Enragés (Les)
+
+ Ensembles Contraires (Les)
+
+ Eva Medusa
+
+ Éclipse
+
+ Élias Le Maudit
+
+ Épée de Cristal (L)
+
+
+ F
+
+ Fantômes Blancs
+
+ Feux D'askel (Les)
+
+ Fils de L'officier (Le)
+
+ Finkel
+
+ Fléau des Dieux (Le)
+
+ Fond du monde (Le)
+
+ Forêt (La)
+
+ Fraternity
+
+ Fugitifs de l'ombre (Les)
+
+ Fulu
+
+
+ G
+
+ Galfalek
+
+ Gardien de la lance (Le)
+
+ Gardiens du sang (Les)
+
+ Garulfo
+
+ Gaston Lagaffe
+
+ Geeks (Les)
+
+ Geste Des Chevaliers Dragon (La)
+
+ Gibier de Potence
+
+ Gipsy
+
+ Gloria Victis
+
+ Gnome de Troy
+
+ Golden City
+
+ Golden Cup
+
+ Golden Dogs
+
+ Golias
+
+ Gord
+
+ Gorn
+
+ Graine de Folie (La)
+
+ Grand Jeu (Le)
+
+ Grand Mort (Le)
+
+ Grand pouvoir du Chninkel (Le)
+
+ Grand Siècle (Le)
+
+ Grand Vampire (Le)
+
+ Green Manor
+
+ Guerre Eternelle (La)
+
+
+ H
+
+ Hallooween Blues
+
+ Hannibal Meriadec et les Larmes Odin
+
+ Hardland
+
+ Hauteclaire
+
+ Haute Sécurité
+
+ Hauteville House
+
+ Hertz
+
+ Homme de Goût (Un)
+
+ Horacio d'alba
+
+ Horologium
+
+ Héléna
+
+ Héritage du Diable (L)
+
+
+ I
+
+ I.N.R.I
+
+ IAN
+
+ Idole dans la bombe (L)
+
+ Ile des Morts (L)
+
+ Ils étaient dix
+
+ Immortels (Les)
+
+ Ingmar
+
+ Insurgés d'edaleth (Les)
+
+ IRS
+
+ Isaac Le Pirate
+
+ Isabellae
+
+ Ivanhoé
+
+ Ivresse des fantômes (L)
+
+ Iznogoud
+
+
+ J
+
+ Jessica Blandy
+
+ Je Suis Légion
\ No newline at end of file
diff --git a/sources/index.php b/sources/index.php
new file mode 100644
index 0000000..69cb81e
--- /dev/null
+++ b/sources/index.php
@@ -0,0 +1,37 @@
+'.$message.' ';}
+# page request
+if (!empty($page)&&is_file(THEME_PATH.$page.'.php')){
+ # request for a specific page
+ include(THEME_PATH.$page.'.php');
+}else{
+ # no page request -> home
+ include(THEME_PATH.'home.php');
+}
+#########################################################################################
+require(THEME_PATH.'/footer.php');
+$_SESSION['ERRORS']='';
+?>
\ No newline at end of file
diff --git a/sources/locale/de.php b/sources/locale/de.php
new file mode 100644
index 0000000..21d1a9d
--- /dev/null
+++ b/sources/locale/de.php
@@ -0,0 +1,292 @@
+ "Lasse die Dateien hier fallen oder wähle eine lokale Datei aus",
+# "Error, max filelength:" => "",
+# ": Error, forbidden file format !" => "",
+# "The file to big for the server\'s config" => "",
+# "The file to big for this page" => "",
+# "There was a problem during upload (file was truncated)" => "",
+# "No file upload" => "",
+# "No temp folder" => "",
+# "Write error on server" => "",
+# "The file doesn\'t fit" => "",
+# "Upload error" => "",
+
+##################################################
+# ./core/auto_restrict.php
+##################################################
+# "Account created:" => "",
+# "New password saved for " => "",
+# "Error saving new password for " => "",
+
+##################################################
+# ./core/commands_GET_vars.php
+##################################################
+# "Rss feed of stats" => "",
+
+##################################################
+# ./core/core.php
+##################################################
+# "Private folder is not writable" => "",
+# "Private folder is not readable" => "",
+# "Temp folder is not writable" => "",
+# "Temp folder is not readable" => "",
+# "Problem accessing tree folder: not readable" => "",
+# "Problem accessing tree/folder file: not writable" => "",
+# "Problem accessing " => "",
+# ": folder not readable" => "",
+# ": folder not writable" => "",
+# "is not installed on this server" => "",
+ "More info" => "Mehr Infos",
+ "Problem accessing ID file: not readable" => "Fehler beim Zugriff auf ID-Datei: nicht lesbar",
+ "Problem accessing ID file: not writable" => "Fehler beim Zugriff auf ID-Datei: nicht schreibbar",
+# "Problem accessing stats file: not readable" => "",
+# "Problem accessing stats file: not writable" => "",
+ "Logout" => "Abmelden",
+ "Connection" => "Verbindung",
+# "See as icon" => "",
+# "See as file list" => "",
+ "Manage files" => "Dateien verwalten",
+ "Manage links" => "Links verwalten",
+# "Deleted" => "",
+# "used" => "",
+# "free" => "",
+
+##################################################
+# ./core/GET_POST_admin_data.php
+##################################################
+# "is not writable" => "",
+# "created" => "",
+ "Problem accessing remote file." => "Fehler beim Zugriff auf Remote-Datei",
+# "moved to" => "",
+# "Changes saved" => "",
+
+##################################################
+# ./core/listfiles.php
+##################################################
+ "The user can access this only one time" => "Zugriff nur einmalig",
+ "The user can access this only with the password" => "Zugriff nur mit Passwort",
+ "View this share" => "Datei öffnen",
+# "View this file" => "",
+# "Edit this file" => "",
+# "Share this folder with another user" => "",
+ "Convert this zip file to folder" => "Dieses Archiv in einen Ordner entpacken",
+# "Check all" => "",
+# "Filename" => "",
+# "Filesize" => "",
+# "Foldersize" => "",
+# "Load" => "",
+# "more" => "",
+# "No file or folder" => "",
+
+##################################################
+# ./core/share.php
+##################################################
+ "This share is protected, please type the correct password:" => "Diese Freigabe ist passwortgesichert, bitte gib das richtige Passwort ein: ",
+ "This page in" => "Diese Seite in ???",
+ "Download a zip from this folder" => "Ordner als Zip-Archiv herunterladen",
+ "This link is no longer available, sorry." => "Oh nein, dieser Link ist nicht mehr verfügbar.",
+# "Rss feed of " => "",
+
+##################################################
+# ./core/templates.php
+##################################################
+ "Delete this file" => "Datei löschen",
+ "Get the share link" => "Freigabe-Link generieren",
+# "Get the qrcode of this link" => "",
+ "Rename this file (share link will not change)" => "Datei umbenennen (Freigabe-Link bleibt unverändert)",
+ "Put a password on this share" => "Diese Freigabe mit einem Passwort sichern",
+ "Turn this share into a burn after access share" => "Diese Freigabe in eine Einmal-Freigabe verwandeln",
+ "Regen the share link" => "Freigabe-Link erneuern",
+ "Move file or folder" => "Datei/Ordner verschieben",
+ "Move to" => "Verschieben nach",
+ "Move" => "Verschieben",
+ "To" => "Nach",
+ "Lock access" => "Zugriff sperren",
+ "Please give a password to lock access to this file" => "Gib ein Passwort ein, um diese Datei zu sichern",
+# "Rename this file?" => "",
+# "Rename this item?" => "",
+ "Rename" => "Umbenennen",
+# "Delete this item?" => "",
+ "Delete" => "Löschen",
+# "Share folder" => "",
+ "Share link" => "Freigabe-Link",
+# "Select the users you want to share with" => "",
+ "Copy this share link" => "Freigabe-Link kopieren",
+ "Yes" => "Ja",
+ "Move this file to another directory" => "Datei in einen anderen Ordner verschieben",
+ "Create a subfolder" => "Unterordner erstellen",
+ "Create a subfolder in this folder" => "Unterordner in diesem Ordner erstellen",
+# "New folder" => "",
+ "Paste a file\'s URL" => "Datei-URL einfügen",
+ "Paste a file\'s URL to get it on this server" => "Datei-URL einfügen, um sie auf den Server zu laden",
+# "Read m3u playlist" => "",
+# "Force local filename (leave empty=no change)" => "",
+# "filename (optionnal)" => "",
+
+##################################################
+# ./index.php
+##################################################
+# "Click to remove" => "",
+
+##################################################
+# ./templates/default/admin.php
+##################################################
+ "Choose a folder" => "Ordner auswählen",
+# "Root:" => "",
+# "Filter:" => "",
+# "Paste a file\'s URL to get it on this server" => "",
+# "Delete selected items" => "",
+# "Zip and download selected items" => "",
+
+##################################################
+# ./templates/default/editor.php
+##################################################
+# "Path:" => "",
+# "Write" => "",
+# "See" => "",
+# "Help" => "",
+# "Filename" => "",
+# "Save" => "",
+# "markdown_help" => "",
+
+##################################################
+# ./templates/default/edit_profiles.php
+##################################################
+# "New profile" => "",
+
+##################################################
+# ./templates/default/footer.php
+##################################################
+# "Fork me on github" => "",
+
+##################################################
+# ./templates/default/header.php
+##################################################
+ "Drag, drop, share." => "Drag, Drop, Share.",
+# "Home" => "",
+# "Edit profiles rights" => "",
+ "Users list" => "Liste der Benutzer",
+ "New user" => "Neuer Benutzer",
+ "Access log file" => "Logs ansehen",
+# "Change password" => "",
+# "Rebuild base" => "",
+# "Text editor" => "",
+# "Click or dragover to reveal dropzone" => "",
+# "Upload" => "",
+ "Search in the uploaded files" => "In den hochgeladenen Daten suchen",
+ "Filter" => "Filter",
+# "Markdown editor" => "",
+# "Access log" => "",
+# "Create an account" => "",
+ "Please, login" => "Anmelden, bitte",
+# "Users profiles" => "",
+# "Configure profiles rights" => "",
+
+##################################################
+# ./templates/default/header_markdown.php
+##################################################
+
+##################################################
+# ./templates/default/home.php
+##################################################
+ "BoZoN is a simple filesharing app." => "BoZoN ist eine unkomplizierte Filesharing-App.",
+ "Easy to install, free and opensource" => "Einfach zu installieren, gratis und Open Source",
+ "Just copy BoZoN\'s files on your server. That\'s it." => "Kopiere die Dateien einfach auf deinen Server. Das war's.",
+ "You can freely fork BoZoN and use it as specified in the AGPL licence" => "Du kannst BoZoN einfach auschecken und benutzen, wie in der AGPL beschrieben.",
+# "Easy to use!" => "",
+ "Drag the file you want to share to upload it on the server" => "Lade Dateien per Drag & Drop auf den Server hoch!",
+ "Share the link with your friends" => "Teile Freigabe-Links mit deinen Freunden!",
+# "BoZoN can do more!" => "",
+# "No database: easy to backup or move to a new server." => "",
+# "Lock the access to the file/folder with a password." => "",
+ "Share a file or a folder with a unique acces link with the «burn mode»:" => "Teile Dateien & Ordner über einen Einmal-Link mit dem 'Burn-Modus'!",
+ "Renew a share link with a single clic" => "Erneuere Freigabe-Links mit nur einem Klick!",
+ "Download a folder content into a zip" => "Lade Orderninhalte als Zip herunter!",
+ "Acces to BoZoN on smartphone without any specific app: your browser is enougth" => "Greife mit deinem Smartphone auf BoZoN zu: Dein Browser genügt!",
+# "Use a qrcode to share your link with smartphone users." => "",
+# "Add, remove users and manage their rights" => "",
+ "To upload a folder, just zip and upload it: with one clic it will be turned into a folder on the server." => "Lade ganze Ordner als Archiv hoch: Entpacke sie auf dem Server mit nur einem Klick!",
+ "Modify the templates & style to make your own BoZoN" => "Modifiziere die Templates & Themes und mach' dir dein eigenes BoZoN",
+
+##################################################
+# ./templates/default/login.php
+##################################################
+ "Login" => "Anmelden",
+# "New account" => "",
+# "Change password" => "",
+ "This login is not available, please try another one" => "Dieser Login ist nicht verfügbar, probiere einen anderen",
+ "Wrong combination login/pass" => "Benutzername/Passwort falsch",
+# "The passwords doesn\'t match." => "",
+# "Problem with admin password." => "",
+# "Account created:" => "",
+# "Password changed" => "",
+# "User:" => "",
+# "Old password" => "",
+ "Password" => "Passwort",
+# "Repeat password" => "",
+ "Stay connected" => "Angemeldet bleiben",
+
+##################################################
+# ./templates/default/stats.php
+##################################################
+# "No stats" => "",
+ "Date" => "Datum",
+ "File" => "Datei",
+# "Owner" => "",
+# "IP" => "",
+ "Origin" => "Quelle",
+ "Host" => "Host",
+ "Delete all stat data" => "Statistik löschen",
+# "Export log:" => "",
+
+##################################################
+# ./templates/default/users.php
+##################################################
+# "Status" => "",
+# "Space" => "",
+ "Check users to delete account and files" => "Benutzer auswählen, um den Account und die Daten zu löschen",
+# "Select new status for the users" => "",
+# "User" => "",
+# "Admin" => "",
+# "Configure folders max size" => "",
+# "Change users\'passwords" => "",
+# "Double-clic to generate a password" => "",
+
+##################################################
+# Orphans
+##################################################
+ "Easy to use !" => "Benutzerfreundlich !",
+ "BoZoN can do more !" => "BoZoN kann mehr !",
+ "When burn is on, the user can access the file/folder only once" => "Wenn der Burn-Modus aktiviert ist, kann der User nur ein Mal auf die Freigabe zufreifen.",
+ "account created" => "Account angelegt",
+ "tiny file sharing app, coded with love and php by " => "tiny file sharing app, coded with love and php by ",
+ "Type to filter the list" => "Liste filtern",
+ "Create your account" => "Erstelle deinen Account",
+ "No file on the server" => "Keine Dateien auf dem Server",
+ "Delete this file ?" => "Diese Datei löschen?",
+ "Rename this file ?" => "Diese Datei umbenennen?",
+ "New_folder" => "Neuer_Ordner",
+ "Move files" => "Dateien verschieben",
+ "Files list" => "Liste der Dateien",
+ "Move a file by clicking on it and choosing the destination folder in the list" => "Zum Verschieben Datei anklicken und Zielordner wählen",
+ "Move a folder by clicking on the move icon and choosing the destination folder in the list" => "Zum Verschieben eines Ordners auf das Verschieben-Symbol klicken und Zielordner auswählen",
+ "Lock the access to the file/folder with a password" => "Sichere den Zugriff auf Dateien & Ordner mit einem Passwort",
+ "Renew the share link of the file/folder (in case of a stolen link for example)" => "Freigabe-Link erneuern (z.B. wenn der Link gestohlen wurde)",
+ "Root" => "Root",
+ "If you want to remove the password, just click on Renew button" => "Klicke auf den Renew-Button, um das Passwort zu ändern",
+ "List" => "List",
+ "Icons" => "Icons",
+ "Change theme" => "Theme ändern",
+ "Connect" => "Verbinden",
+
+);
+?>
\ No newline at end of file
diff --git a/sources/locale/en.php b/sources/locale/en.php
new file mode 100644
index 0000000..38957c7
--- /dev/null
+++ b/sources/locale/en.php
@@ -0,0 +1,355 @@
+ "",
+# "Error, max filelength:" => "",
+# ": Error, forbidden file format !" => "",
+# "The file to big for the server\'s config" => "",
+# "The file to big for this page" => "",
+# "There was a problem during upload (file was truncated)" => "",
+# "No file upload" => "",
+# "No temp folder" => "",
+# "Write error on server" => "",
+# "The file doesn\'t fit" => "",
+# "Upload error" => "",
+
+##################################################
+# ./core/auto_restrict.php
+##################################################
+# "Account created:" => "",
+# "New password saved for " => "",
+# "Error saving new password for " => "",
+
+##################################################
+# ./core/commands_GET_vars.php
+##################################################
+# "Rss feed of stats" => "",
+
+##################################################
+# ./core/core.php
+##################################################
+# "Private folder is not writable" => "",
+# "Private folder is not readable" => "",
+# "Temp folder is not writable" => "",
+# "Temp folder is not readable" => "",
+# "Problem accessing tree folder: not readable" => "",
+# "Problem accessing tree/folder file: not writable" => "",
+# "Problem accessing " => "",
+# ": folder not readable" => "",
+# ": folder not writable" => "",
+# "is not installed on this server" => "",
+# "More info" => "",
+# "Problem accessing ID file: not readable" => "",
+# "Problem accessing ID file: not writable" => "",
+# "Problem accessing stats file: not readable" => "",
+# "Problem accessing stats file: not writable" => "",
+# "Logout" => "",
+# "Connection" => "",
+# "See as icon" => "",
+# "See as file list" => "",
+# "Manage files" => "",
+# "Manage links" => "",
+# "Deleted" => "",
+# "used" => "",
+# "free" => "",
+
+##################################################
+# ./core/GET_POST_admin_data.php
+##################################################
+# "is not writable" => "",
+# "created" => "",
+# "Problem accessing remote file." => "",
+# "moved to" => "",
+# "Changes saved" => "",
+
+##################################################
+# ./core/listfiles.php
+##################################################
+# "The user can access this only one time" => "",
+# "The user can access this only with the password" => "",
+# "View this share" => "",
+# "View this file" => "",
+# "Edit this file" => "",
+# "Share this folder with another user" => "",
+# "Convert this zip file to folder" => "",
+# "Check all" => "",
+# "Filename" => "",
+# "Filesize" => "",
+# "Foldersize" => "",
+# "Load" => "",
+# "more" => "",
+# "No file or folder" => "",
+
+##################################################
+# ./core/share.php
+##################################################
+# "This share is protected, please type the correct password:" => "",
+# "This page in" => "",
+# "Download a zip from this folder" => "",
+# "This link is no longer available, sorry." => "",
+# "Rss feed of " => "",
+
+##################################################
+# ./core/templates.php
+##################################################
+# "Delete this file" => "",
+# "Get the share link" => "",
+# "Get the qrcode of this link" => "",
+# "Rename this file (share link will not change)" => "",
+# "Put a password on this share" => "",
+# "Turn this share into a burn after access share" => "",
+# "Regen the share link" => "",
+# "Download a zip from this folder" => "",
+# "Move file or folder" => "",
+# "Move to" => "",
+# "Move" => "",
+# "To" => "",
+# "Lock access" => "",
+# "Please give a password to lock access to this file" => "",
+# "Rename this file?" => "",
+# "Rename this item?" => "",
+# "Rename" => "",
+# "Delete this item?" => "",
+# "Delete" => "",
+# "Share folder" => "",
+# "Share link" => "",
+# "Select the users you want to share with" => "",
+# "Copy this share link" => "",
+# "Yes" => "",
+# "Move this file to another directory" => "",
+# "Create a subfolder" => "",
+# "Create a subfolder in this folder" => "",
+# "New folder" => "",
+# "Paste a file\'s URL" => "",
+# "Paste a file\'s URL to get it on this server" => "",
+# "Read m3u playlist" => "",
+# "Force local filename (leave empty=no change)" => "",
+# "filename (optionnal)" => "",
+
+##################################################
+# ./index.php
+##################################################
+# "Click to remove" => "",
+
+##################################################
+# ./templates/default/admin.php
+##################################################
+# "Choose a folder" => "",
+# "Root:" => "",
+# "Filter:" => "",
+# "Create a subfolder in this folder" => "",
+# "Paste a file\'s URL to get it on this server" => "",
+# "Delete selected items" => "",
+# "Zip and download selected items" => "",
+
+##################################################
+# ./templates/default/editor.php
+##################################################
+# "Path:" => "",
+# "Write" => "",
+# "See" => "",
+# "Help" => "",
+# "Filename" => "",
+# "Save" => "",
+ "markdown_help" => "# Title 1
+ ## Title 2
+ ### Title 3
+ #### Title 4
+ ##### Title 5
+ ###### Title 6
+
+ *italic* or _italic_
+ **bold** or __bold__
+ **_bold italic_**
+ ~~strike~~
+
+ 1. First ordered list item
+ 2. Another item
+ ⋅⋅* Unordered sub-list.
+ 1. Actual numbers doesn't matter, just that it's a number
+ ⋅⋅1. Ordered sub-list
+ 4. And another item.
+ ⋅⋅⋅You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
+
+ ⋅⋅⋅To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅
+ ⋅⋅⋅Note that this line is separate, but within the same paragraph.⋅⋅
+ ⋅⋅⋅(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
+
+ * Unordered list can use asterisks
+ - Or minuses
+ + Or pluses
+
+ Links
+ [I'm an inline-style link](https://www.google.com)
+
+ [I'm an inline-style link with title](https://www.google.com 'Google's Homepage')
+
+ [I'm a reference-style link][Arbitrary case-insensitive reference text]
+
+ [I'm a relative reference to a repository file](../blob/master/LICENSE)
+
+ [You can use numbers for reference-style link definitions][1]
+
+ Or leave it empty and use the [link text itself].
+
+ URLs and URLs in angle brackets will automatically get turned into links.
+ http://www.example.com or and sometimes
+ example.com (but not on Github, for example).
+
+ Some text to show that the reference links can follow later.
+
+ [arbitrary case-insensitive reference text]: https://www.mozilla.org
+ [1]: http://slashdot.org
+ [link text itself]: http://www.reddit.com
+
+ Images
+ Inline-style:
+ ![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
+
+ Reference-style:
+ ![alt text][logo]
+
+ [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
+
+ Code
+ ```javascript
+ var s = 'JavaScript syntax highlighting';
+ alert(s);
+ ```
+
+ | Tables | Are | Cool |
+ | ------------- |:-------------:| -----:|
+ | col 3 is | right-aligned | $1600 |
+ | col 2 is | centered | $12 |
+ | zebra stripes | are neat | $1 |
+
+ > Blockquotes are very handy in email to emulate reply text.
+ > This line is part of the same quote.
+
+ Horizontal rules
+ Three or more...
+
+ --- Hyphens
+ *** Asterisks
+ ___ Underscores
+ ",
+
+##################################################
+# ./templates/default/edit_profiles.php
+##################################################
+# "New profile" => "",
+
+##################################################
+# ./templates/default/footer.php
+##################################################
+# "Fork me on github" => "",
+
+##################################################
+# ./templates/default/header.php
+##################################################
+# "Drag, drop, share." => "",
+# "Home" => "",
+# "Edit profiles rights" => "",
+# "Users list" => "",
+# "New user" => "",
+# "Access log file" => "",
+# "Change password" => "",
+# "Rebuild base" => "",
+# "Text editor" => "",
+# "Click or dragover to reveal dropzone" => "",
+# "Upload" => "",
+# "Search in the uploaded files" => "",
+# "Filter" => "",
+# "Markdown editor" => "",
+# "Access log" => "",
+# "Create an account" => "",
+# "Please, login" => "",
+# "Users profiles" => "",
+# "Configure profiles rights" => "",
+# "Manage links" => "",
+# "Manage files" => "",
+
+##################################################
+# ./templates/default/header_markdown.php
+##################################################
+# "Drag, drop, share." => "",
+
+##################################################
+# ./templates/default/home.php
+##################################################
+# "BoZoN is a simple filesharing app." => "",
+# "Easy to install, free and opensource" => "",
+# "Just copy BoZoN\'s files on your server. That\'s it." => "",
+# "You can freely fork BoZoN and use it as specified in the AGPL licence" => "",
+# "More info" => "",
+# "Easy to use!" => "",
+# "Drag the file you want to share to upload it on the server" => "",
+# "Share the link with your friends" => "",
+# "BoZoN can do more!" => "",
+# "No database: easy to backup or move to a new server." => "",
+# "Lock the access to the file/folder with a password." => "",
+# "Share a file or a folder with a unique acces link with the «burn mode»:" => "",
+# "Renew a share link with a single clic" => "",
+# "Download a folder content into a zip" => "",
+# "Acces to BoZoN on smartphone without any specific app: your browser is enougth" => "",
+# "Use a qrcode to share your link with smartphone users." => "",
+# "Add, remove users and manage their rights" => "",
+# "To upload a folder, just zip and upload it: with one clic it will be turned into a folder on the server." => "",
+# "Modify the templates & style to make your own BoZoN" => "",
+
+##################################################
+# ./templates/default/login.php
+##################################################
+# "Login" => "",
+# "New account" => "",
+# "Change password" => "",
+# "Please, login" => "",
+# "This login is not available, please try another one" => "",
+# "Wrong combination login/pass" => "",
+# "The passwords doesn\'t match." => "",
+# "Problem with admin password." => "",
+# "Account created:" => "",
+# "Password changed" => "",
+# "User:" => "",
+# "Old password" => "",
+# "Password" => "",
+# "Repeat password" => "",
+# "Stay connected" => "",
+
+##################################################
+# ./templates/default/stats.php
+##################################################
+# "No stats" => "",
+# "Date" => "",
+# "File" => "",
+# "Owner" => "",
+# "IP" => "",
+# "Origin" => "",
+# "Host" => "",
+# "Delete all stat data" => "",
+# "Export log:" => "",
+
+##################################################
+# ./templates/default/users.php
+##################################################
+# "Delete" => "",
+# "Status" => "",
+# "Space" => "",
+# "Password" => "",
+# "Check users to delete account and files" => "",
+# "Select new status for the users" => "",
+# "User" => "",
+# "Admin" => "",
+# "Configure folders max size" => "",
+# "Change users\'passwords" => "",
+# "Double-clic to generate a password" => "",
+
+);
+?>
\ No newline at end of file
diff --git a/sources/locale/es.php b/sources/locale/es.php
new file mode 100644
index 0000000..e1f2fe9
--- /dev/null
+++ b/sources/locale/es.php
@@ -0,0 +1,338 @@
+ "Deposita los archivos aquí o haz clic para escoger uno en tu ordenador",
+ "Error, max filelength:" => "Error, tamaño máximo para los archivos:",
+# ": Error, forbidden file format !" => "",
+# "The file to big for the server\'s config" => "",
+# "The file to big for this page" => "",
+# "There was a problem during upload (file was truncated)" => "",
+# "No file upload" => "",
+# "No temp folder" => "",
+# "Write error on server" => "",
+ "The file doesn\'t fit" => "El archivos no cabe",
+ "Upload error" => "Error subiendo el archivo",
+
+##################################################
+# ./core/auto_restrict.php
+##################################################
+ "Account created:" => "Cuenta creada:",
+ "New password saved for " => "Nueva contraseña cambiada para ",
+ "Error saving new password for " => "Error guardando la nueva contraseña para ",
+
+##################################################
+# ./core/commands_GET_vars.php
+##################################################
+ "Rss feed of stats" => "Enlace RSS de las estadísticas",
+
+##################################################
+# ./core/core.php
+##################################################
+ "Private folder is not writable" => "Carpeta Private protegida contra la escritura",
+ "Private folder is not readable" => "Carpeta Private protegida contra la lectura",
+ "Temp folder is not writable" => "Carpeta Temp protegida contra la escritura",
+ "Temp folder is not readable" => "Carpeta Temp protegida contra la lectura",
+ "Problem accessing tree folder: not readable" => "Carpeta Tree protegida contra la lectura",
+ "Problem accessing tree/folder file: not writable" => "Carpeta Tree protegida contra la escritura",
+ "Problem accessing " => "Problema accediendo a ",
+ ": folder not readable" => ": Carpeta protegida contra la lectura",
+ ": folder not writable" => ": Carpeta protegida contra la escritura",
+ "is not installed on this server" => "no está instalado en este servidor",
+ "More info" => "Más informaciones",
+ "Problem accessing ID file: not readable" => "Error de acceso leyendo el archivo ID.",
+ "Problem accessing ID file: not writable" => "Error de acceso escribiendo al archivo ID.",
+ "Problem accessing stats file: not readable" => "",
+ "Problem accessing stats file: not writable" => "",
+ "Logout" => "Salir",
+ "Connection" => "Connección",
+ "See as icon" => "Ver como iconos",
+ "See as file list" => "Ver como lista",
+ "Manage files" => "Gestionar los archivos",
+ "Manage links" => "Gestionar los enlaces",
+ "Deleted" => "Borrado",
+ "used" => "utilizado",
+ "free" => "libre",
+
+##################################################
+# ./core/GET_POST_admin_data.php
+##################################################
+ "is not writable" => "está protegido contra la escritura",
+ "created" => "creado",
+ "Problem accessing remote file." => "Imposible acceder al archivo remoto",
+ "moved to" => "movido a",
+ "Changes saved" => "Cambios almacenados",
+
+##################################################
+# ./core/listfiles.php
+##################################################
+ "The user can access this only one time" => "El usuario solo puede acceder al archivo una vez",
+ "The user can access this only with the password" => "El usuario solo puede acceder al archivo con una contraseña",
+ "View this share" => "Ver este archivo",
+ "View this file" => "Ver el archivo",
+ "Edit this file" => "Modificar el archivo",
+ "Share this folder with another user" => "Comparte esta carpeta con otro usuario",
+ "Convert this zip file to folder" => "Convertir este archivo Zip en carpeta",
+ "Check all" => "Seleccionar todo",
+ "Filename" => "Nombre del archivo",
+ "Filesize" => "Tamaño del archivo",
+ "Foldersize" => "Tamaño de la carpeta",
+ "Load" => "Cargar",
+ "more" => "más",
+ "No file or folder" => "Ningún archivo",
+
+##################################################
+# ./core/share.php
+##################################################
+ "This share is protected, please type the correct password:" => "Este enlace está protegido por una contraseña:",
+ "This page in" => "Esta página en formato ",
+ "Download a zip from this folder" => "Bajar un zip con esta carpeta",
+ "This link is no longer available, sorry." => "Este enlace está caducado.",
+ "Rss feed of " => "Enlace RSS de ",
+
+##################################################
+# ./core/templates.php
+##################################################
+ "Delete this file" => "Borra este archivo",
+ "Get the share link" => "Conseguir el enlace público",
+ "Get the qrcode of this link" => "Consigue el código qr del enlace",
+ "Rename this file (share link will not change)" => "Cambiar el nombre (el enlace no cambiará)",
+ "Put a password on this share" => "Proteger con una contraseña",
+ "Turn this share into a burn after access share" => "Pasar al modo acceso único",
+ "Regen the share link" => "Renovar el enlace público",
+ "Move file or folder" => "Mover archivo/carpeta",
+ "Move to" => "Mover a",
+ "Move" => "Mover",
+ "To" => "A",
+ "Lock access" => "Impedir el acceso",
+ "Please give a password to lock access to this file" => "Por favor, ingresa una contraseña para el archivo",
+ "Rename this file?" => "Renombrar el archivo",
+ "Rename this item?" => "¿ Cambiar el nombre del archivo ?",
+ "Rename" => "Cambiar el nombre",
+ "Delete this item?" => "¿ Borrar este elemento ?",
+ "Delete" => "Borrar",
+ "Share folder" => "Compartir carpeta",
+ "Share link" => "Enlace público",
+ "Select the users you want to share with" => "Selecciona los usuarios con quien compartir la carpeta",
+ "Copy this share link" => "Copia este enlace público",
+ "Yes" => "Sí",
+ "Move this file to another directory" => "Desplazar este archivo a otra carpeta",
+ "Create a subfolder" => "Crear una carpeta nueva",
+ "Create a subfolder in this folder" => "Crear una subcarpeta nueva en esta carpeta",
+ "New folder" => "Nueva carpeta",
+ "Paste a file\'s URL" => "Pegar una dirección",
+ "Paste a file\'s URL to get it on this server" => "Pega la dirección de un archivo para duplicarlo",
+# "Read m3u playlist" => "",
+ "Force local filename (leave empty=no change)" => "Cambiar el nombre del archivo (vacío = nombre original)",
+ "filename (optionnal)" => "Nombre del archivo (facultativo)",
+
+##################################################
+# ./index.php
+##################################################
+ "Click to remove" => "Haz clic para quitar",
+
+##################################################
+# ./templates/default/admin.php
+##################################################
+ "Choose a folder" => "Escoja una carpeta",
+ "Root:" => "Raíz :",
+ "Filter:" => "Filtro :",
+ "Paste a file\'s URL to get it on this server" => "Pegar una dirección para guardar el archivo",
+ "Delete selected items" => "Borrar los archivos seleccionados",
+ "Zip and download selected items" => "Crea un archivo Zip con la selección",
+
+##################################################
+# ./templates/default/editor.php
+##################################################
+ "Path:" => "Camino:",
+ "Write" => "Escribir",
+ "See" => "Ver",
+ "Help" => "Ayuda",
+ "Save" => "Guardar",
+ "markdown_help" => "# Título 1
+ ## Título 2
+ ### Título 3
+ #### Título 4
+ ##### Título 5
+ ###### Título 6
+
+ *bastardilla* o _bastardilla_
+ **negrilla** ou __negrilla__
+ **_negrilla bastardilla_**
+ ~~tachado~~
+
+ 1. lista ordenada
+ 2. segunda línea
+ ⋅⋅* no ordenado
+ 1. los números no tienen importancia
+ ⋅⋅1. ordenado
+
+ + lista no ordenada
+ - lista no ordenada
+ * lista no ordenada
+
+ [Texto del enlace](https://direccion.com)
+ ![Alt de la imagen](http://direccion/imagen.jpg)
+
+ ```javascript
+ var s = 'JavaScript syntax highlighting';
+ alert(s);
+ ```
+
+ | Tableros | son | Chulos |
+ | -------------- |:-----------------:| ------:|
+ | col 3 está | alienada derecha | $1600 |
+ | col 2 está | centrada | $12 |
+
+ > para las citas
+ > éste carácter primero:'>'
+
+ --- o *** o ___ = línea",
+
+##################################################
+# ./templates/default/edit_profiles.php
+##################################################
+ "New profile" => "Nuevo perfil",
+
+##################################################
+# ./templates/default/footer.php
+##################################################
+ "Fork me on github" => "Forkéame en github",
+
+##################################################
+# ./templates/default/header.php
+##################################################
+ "Drag, drop, share." => "Arrastra, deposita, comparte.",
+ "Home" => "Entrada",
+ "Edit profiles rights" => "Cambiar los derechos de los perfiles",
+ "Users list" => "Lista de usuarios",
+ "New user" => "Nuevo usuario",
+ "Access log file" => "Estadísticas de acceso",
+ "Change password" => "Cambiar la contraseña.",
+ "Rebuild base" => "Completar la base",
+ "Text editor" => "Editor de texto",
+ "Click or dragover to reveal dropzone" => "Haz click o arrastra un archivo para desubrir la zona de upload",
+ "Upload" => "Subir",
+ "Search in the uploaded files" => "Buscar en los archivos del servidor",
+ "Filter" => "Filtrar",
+ "Markdown editor" => "Editor Markdown",
+ "Access log" => "Log de accesos",
+ "Create an account" => "Crear una cuenta",
+ "Please, login" => "Conéctate",
+ "Users profiles" => "Usuarios",
+ "Configure profiles rights" => "Configurar los derechos de los perfiles",
+
+##################################################
+# ./templates/default/header_markdown.php
+##################################################
+
+##################################################
+# ./templates/default/home.php
+##################################################
+ "BoZoN is a simple filesharing app." => "BoZoN es una simple utilidad de almacenamiento y de reparto de archivos.",
+ "Easy to install, free and opensource" => "Fácil de instalar, libre y de código abierto",
+ "Just copy BoZoN\'s files on your server. That\'s it." => "Solo tienes que subir los archivos de Bozon a tu servidor y ¡ ya está !",
+ "You can freely fork BoZoN and use it as specified in the AGPL licence" => "Puedes copiar y modificar libremente esta utilidad según la licencia AGPL",
+ "Easy to use!" => "Fácil de utilizar",
+ "Drag the file you want to share to upload it on the server" => "Deposita el archivo que quieras subir al servidor",
+ "Share the link with your friends" => "Comparte la dirección con los demás...",
+ "BoZoN can do more!" => "¡ Hay más !",
+ "No database: easy to backup or move to a new server." => "Ningún base de datos: fácil de guardar o de trasladar a otro servidor.",
+ "Lock the access to the file/folder with a password." => "Pónle una contraseña al archivo.",
+ "Share a file or a folder with a unique acces link with the «burn mode»:" => "Comparte un archivo o una carpeta con un enlace público de acceso único con el modo «burn».",
+ "Renew a share link with a single clic" => "Cambia un enlace público con solo un clic.",
+ "Download a folder content into a zip" => "Baja una carpeta de tu BoZoN directamente en formato zip.",
+ "Acces to BoZoN on smartphone without any specific app: your browser is enougth" => "Ingresa en tu BoZoN desde tu móvil solo con el navegador.",
+ "Use a qrcode to share your link with smartphone users." => "Utiliza un QRcode para compartir enlaces con móviles",
+ "Add, remove users and manage their rights" => "Añade y borra cuentas de usuarios y gestiona sus derechos",
+ "To upload a folder, just zip and upload it: with one clic it will be turned into a folder on the server." => "Sube una carpeta completa: la zipeas, la subes al servidor y la dezipeas con un clic.",
+ "Modify the templates & style to make your own BoZoN" => "Crea tu propio BoZoN cambiando el tema y el estilo css",
+
+##################################################
+# ./templates/default/login.php
+##################################################
+ "Login" => "Login",
+ "New account" => "Nueva cuenta",
+ "This login is not available, please try another one" => "Este nombre ya existe, por favor, ingrese uno diferente.",
+ "Wrong combination login/pass" => "Error en el nombre o en la contraseña",
+ "The passwords doesn\'t match." => "Las contraseñas no corresponden",
+ "Problem with admin password." => "La contraseña anterior es falsa.",
+ "Password changed" => "Contraseña cambiada",
+ "User:" => "Usuario:",
+ "Old password" => "Contraseña anterior.",
+ "Password" => "Contraseña",
+ "Repeat password" => "Repetir la contraseña.",
+ "Stay connected" => "Permanecer conectado",
+
+##################################################
+# ./templates/default/stats.php
+##################################################
+ "No stats" => "Ninguna estadística",
+ "Date" => "Fecha",
+ "File" => "archivo",
+ "Owner" => "Propietario",
+# "IP" => "",
+ "Origin" => "Página de origen",
+ "Host" => "Huésped",
+ "Delete all stat data" => "Borrar las estadìsticas",
+ "Export log:" => "Exportar el log :",
+
+##################################################
+# ./templates/default/users.php
+##################################################
+ "Status" => "Estatus",
+ "Space" => "Espacio",
+ "Check users to delete account and files" => "Selecciona los usuarios para borrar su cuenta y sus archivos",
+ "Select new status for the users" => "Cambia el estatus de los usuarios",
+ "User" => "Usuario",
+ "Admin" => "Administrador",
+ "Configure folders max size" => "Limitar la capacidad de las carpetas de usuarios",
+ "Change users\'passwords" => "Cambiar la contraseña de los usuarios",
+ "Double-clic to generate a password" => "Doble clic para generar una contraseña",
+
+##################################################
+# Orphans
+##################################################
+ "When burn is on, the user can access the file/folder only once" => "En modo burn, el usuario solo puede acceder al archivo una vez",
+ "Edit this file" => "",
+ "No file in your personal folder" => "Ningún archivo en tu carpeta personal",
+ "Move files" => "Mover archivos",
+ "Root" => "Raíz",
+ "Manage users" => "Gestionar los usuarios",
+ "Users status" => "estatus des los usuarios",
+ "Type to filter the list" => "Filtrar la lista",
+ "List" => "Lista",
+ "Icons" => "Íconos",
+ "Change theme" => "Cambiar el aspecto",
+ "Connect" => "Conectarse",
+ "Error, forbidden file format!" => "¡ Error, formato prohibido !",
+ "Delete this file?" => "¿ Borrar este archivo ?",
+ "Files list" => "Lista de archivos",
+ "tiny file sharing app, coded with love and php by " => "Mini utilidad para compartir archivos, creada con amor y php por ",
+ "user" => "usuario",
+ "guest" => "invitado",
+ "admin" => "administrador",
+ "add user" => "Añadir usuario",
+ "upload" => "Subir archivos",
+ "delete user" => "Borrar usuario",
+ "change user status" => "cambiar el estatus del usuario",
+ "change folder size" => "cambiar el tamaño de la carpeta",
+ "change status rights" => "cambiar los derechos de los estatuses",
+ "change passes" => "cambiar las contraseñas",
+ "markdown editor" => "Editor Markdown",
+ "regen ID base" => "regenerar la base",
+ "acces logfile" => "log de accesos",
+ "users page" => "página de usuario",
+ "Move a file by clicking on it and choosing the destination folder in the list" => "Mueve un archivo haciendo clic en él y escogiendo el destino en la lista",
+ "Move a folder by clicking on the move icon and choosing the destination folder in the list" => "Mueve una carpeta pinchando en 'Mover' y escogiendo el destino en la lista",
+ "Renew the share link of the file/folder (in case of a stolen link for example)" => "Cambia el enlace de un archivo con solo un clic",
+ "If you want to remove the password, just click on Renew button" => "Si quiere quitarle la contraseña, solo tiene que pinchar en el botón Renovar el enlace",
+
+);
+?>
\ No newline at end of file
diff --git a/sources/locale/fr.php b/sources/locale/fr.php
new file mode 100644
index 0000000..e31a06c
--- /dev/null
+++ b/sources/locale/fr.php
@@ -0,0 +1,343 @@
+ "Glisser les fichiers ici ou cliquer pour sélectionner un fichier local",
+ "Error, max filelength:" => "Erreur, taille max par fichier :",
+# ": Error, forbidden file format !" => "",
+# "The file to big for the server\'s config" => "",
+# "The file to big for this page" => "",
+# "There was a problem during upload (file was truncated)" => "",
+# "No file upload" => "",
+# "No temp folder" => "",
+# "Write error on server" => "",
+ "The file doesn\'t fit" => "Pas assez d'espace libre",
+ "Upload error" => "Erreur lors de l'envoi",
+
+##################################################
+# ./core/auto_restrict.php
+##################################################
+ "Account created:" => "Compte créé :",
+ "New password saved for " => "Nouveau mot de passe sauvé pour ",
+ "Error saving new password for " => "Erreur en sauvant le mot de passe pour ",
+
+##################################################
+# ./core/commands_GET_vars.php
+##################################################
+ "Rss feed of stats" => "RSS des stats",
+
+##################################################
+# ./core/core.php
+##################################################
+ "Private folder is not writable" => "Le dossier private/ est verrouillé en écriture",
+ "Private folder is not readable" => "Le dossier private/ est verrouillé en lecture",
+ "Temp folder is not writable" => "Le dossier private/temp est verrouillé en écriture",
+ "Temp folder is not readable" => "Le dossier private/temp est verrouillé en lecture",
+# "Problem accessing tree folder: not readable" => "",
+# "Problem accessing tree/folder file: not writable" => "",
+ "Problem accessing " => "Problème lors de l'accès à ",
+ ": folder not readable" => ": dossier verrouillé en lecture",
+ ": folder not writable" => ": dossier verrouillé en écriture",
+ "is not installed on this server" => "n'est pas installé sur ce serveur",
+ "More info" => "En savoir plus",
+ "Problem accessing ID file: not readable" => "Erreur d'accès en lecture au fichier ID.",
+ "Problem accessing ID file: not writable" => "Erreur d'accès en écriture au fichier ID.",
+ "Problem accessing stats file: not readable" => "Fichier de stats verrouillé en lecture",
+ "Problem accessing stats file: not writable" => "Fichier de stats verrouillé en écriture",
+ "Logout" => "Déconnexion",
+ "Connection" => "Connexion",
+ "See as icon" => "Voir sous forme d'icônes",
+ "See as file list" => "Voir sous forme de liste",
+ "Manage files" => "Gérer les fichiers",
+ "Manage links" => "Gérer les liens",
+ "Deleted" => "Supprimé",
+ "used" => "utilisé",
+ "free" => "libre",
+
+##################################################
+# ./core/GET_POST_admin_data.php
+##################################################
+ "is not writable" => "est verrouillé en écriture",
+ "created" => "créé",
+ "Problem accessing remote file." => "Problème d'acces au fichier distant",
+ "moved to" => "déplacé vers",
+ "Changes saved" => "Changements sauvegardés",
+
+##################################################
+# ./core/listfiles.php
+##################################################
+ "The user can access this only one time" => "L'utilisateur ne pourra y accéder qu'une fois",
+ "The user can access this only with the password" => "L'utilisateur ne pourra y accéder qu'avec un mot de passe.",
+ "View this share" => "Voir ce partage",
+ "View this file" => "Voir ce fichier",
+ "Edit this file" => "Editer ce fichier",
+ "Share this folder with another user" => "Partager ce dossier avec un autre utilisateur",
+ "Convert this zip file to folder" => "Convertir ce fichier Zip en dossier",
+ "Check all" => "Tout cocher",
+ "Filename" => "Nom de fichier",
+ "Filesize" => "Taille de fichier",
+ "Foldersize" => "Taille du dossier",
+ "Load" => "Charger",
+ "more" => "de plus",
+ "No file or folder" => "Aucun fichier ou dossier",
+
+##################################################
+# ./core/share.php
+##################################################
+ "This share is protected, please type the correct password:" => "Ce lien est protégé: veuillez taper le mot de passe.",
+ "This page in" => "Cette page au format ",
+ "Download a zip from this folder" => "Télécharger un zip à partir de ce dossier",
+ "This link is no longer available, sorry." => "Ce lien n'est plus valable, désolé.",
+ "Rss feed of " => "Flux RSS de ",
+
+##################################################
+# ./core/templates.php
+##################################################
+ "Delete this file" => "Supprimer ce fichier",
+ "Get the share link" => "Obtenir le lien de partage",
+ "Get the qrcode of this link" => "Voir le qrcode de ce lien",
+ "Rename this file (share link will not change)" => "Renommer ce fichier (le lien de partage ne changera pas)",
+ "Put a password on this share" => "Protéger l'accès par mot de passe",
+ "Turn this share into a burn after access share" => "Passer ce partage en mode accès unique",
+ "Regen the share link" => "Régénérer le lien de partage",
+ "Move file or folder" => "Dépl. fichier/dossier",
+ "Move to" => "Déplacer vers",
+ "Move" => "Déplacer",
+ "To" => "Vers",
+ "Lock access" => "Verrouiller l'accès",
+ "Please give a password to lock access to this file" => "Saisir un mot de passe pour verrouiller cette ressource",
+ "Rename this file?" => "Renommer ce fichier ?",
+ "Rename this item?" => "Renommer cet élément ?",
+ "Rename" => "Renommer",
+ "Delete this item?" => "Supprimer cet élément ?",
+ "Delete" => "Supprimer",
+ "Share folder" => "Partager dossier.",
+ "Share link" => "Lien de partage",
+ "Select the users you want to share with" => "Sélectionnez les utilisateurs avec qui partager ce dossier",
+ "Copy this share link" => "Copiez ce lien de partage",
+ "Yes" => "Oui",
+ "Move this file to another directory" => "Déplacer ce fichier vers un autre dossier",
+ "Create a subfolder" => "Créer un nouveau dossier",
+ "Create a subfolder in this folder" => "Créer un sous-dossier dans ce dossier",
+ "New folder" => "Nouveau dossier",
+ "Paste a file\'s URL" => "Coller l'URL d'un fichier",
+ "Paste a file\'s URL to get it on this server" => "Coller l'URL d'un fichier pour le récupérer sur ce serveur",
+# "Read m3u playlist" => "",
+ "Force local filename (leave empty=no change)" => "Changer le nom du fichier (vide = nom original)",
+ "filename (optionnal)" => "Nom de fichier (facultatif)",
+
+##################################################
+# ./index.php
+##################################################
+ "Click to remove" => "Cliquer pour retirer",
+
+##################################################
+# ./templates/default/admin.php
+##################################################
+ "Choose a folder" => "Choisissez un dossier",
+ "Root:" => "Racine :",
+ "Filter:" => "Filtre :",
+ "Paste a file\'s URL to get it on this server" => "Coller l'url d'un fichier pour le récupérer sur ce serveur",
+ "Delete selected items" => "Supprimer les items sélectionnés",
+ "Zip and download selected items" => "Zipper et télécharger les items sélectionnés",
+
+##################################################
+# ./templates/default/editor.php
+##################################################
+ "Path:" => "Chemin:",
+ "Write" => "Écrire",
+ "See" => "Voir",
+ "Help" => "Aide",
+ "Save" => "Sauvegarder",
+ "markdown_help" => "# Titre 1
+ ## Titre 2
+ ### Titre 3
+ #### Titre 4
+ ##### Titre 5
+ ###### Titre 6
+
+ *italique* ou _italique_
+ **gras** ou __gras__
+ **_gras italique_**
+ ~~barré~~
+
+ 1. liste ordonnée
+ 2. deuxième item
+ ⋅⋅* sous-item non ordonné.
+ 1. Les nombres ne sont pas importants
+ ⋅⋅1. sous-item ordonné
+
+ + liste non ordonnée
+ - liste non ordonnée
+ * liste non ordonnée
+
+ [Texte du lien](https://adresse.com)
+ ![Alt de l\'image](http://adressede/image.jpg)
+
+ par référence (permet de répéter un lien/une image sans retaper l\'adresse):
+ [Texte lien][ref1]
+ [ref1]: http://adresse.fr
+
+ ![alt text][logo]
+ [logo]: http://adresse/image.jpg
+
+
+ ```javascript
+ var s = 'JavaScript syntax highlighting';
+ alert(s);
+ ```
+
+ | Tableaux | sont | Cools |
+ | -------------- |:-----------------:| -----:|
+ | col 3 est | alignée à droite | $1600 |
+ | col 2 est | centrée | $12 |
+
+ > pour les citations
+ > ce signe en début de ligne
+
+ --- ou *** ou ___ = ligne",
+
+##################################################
+# ./templates/default/edit_profiles.php
+##################################################
+ "New profile" => "Nouveau profil",
+
+##################################################
+# ./templates/default/footer.php
+##################################################
+ "Fork me on github" => "Forkez-moi sur github",
+
+##################################################
+# ./templates/default/header.php
+##################################################
+ "Drag, drop, share." => "Glisser, déposer, partager.",
+ "Home" => "Accueil",
+ "Edit profiles rights" => "Éditer les droits d'accès des profils",
+ "Users list" => "Liste des utilisateurs",
+ "New user" => "Nouvel utilisateur",
+ "Access log file" => "Voir le fichier d'accès",
+ "Change password" => "Changer le mot de passe",
+ "Rebuild base" => "Régénérer la base",
+ "Text editor" => "Editeur de texte",
+ "Click or dragover to reveal dropzone" => "Cliquez ou glisser un fichier pour révéler la zone d'upload",
+ "Upload" => "Envoyer",
+ "Search in the uploaded files" => "Rechercher dans les fichiers envoyés",
+ "Filter" => "Mot-clé",
+ "Markdown editor" => "Editeur markdown",
+ "Access log" => "Journal des accès",
+ "Create an account" => "Créer un compte",
+ "Please, login" => "Se connecter",
+ "Users profiles" => "Profils utilisateurs",
+ "Configure profiles rights" => "Configurer les droits d'accès",
+
+##################################################
+# ./templates/default/header_markdown.php
+##################################################
+
+##################################################
+# ./templates/default/home.php
+##################################################
+ "BoZoN is a simple filesharing app." => "BoZoN est une application simplifiée de stockage et de partage de fichiers.",
+ "Easy to install, free and opensource" => "Simple à installer, libre et opensource",
+ "Just copy BoZoN\'s files on your server. That\'s it." => "Copiez simplement les fichiers de BoZoN sur votre serveur. C'est tout.",
+ "You can freely fork BoZoN and use it as specified in the AGPL licence" => "Vous pouvez librement forker et utiliser BoZoN comme spécifié dans la licence AGPL",
+ "Easy to use!" => "Simple à utiliser",
+ "Drag the file you want to share to upload it on the server" => "Glisser le fichier à partager pour l'envoyer sur le serveur",
+ "Share the link with your friends" => "Partager un lien avec vos amis...",
+ "BoZoN can do more!" => "Ce n'est pas tout !",
+ "No database: easy to backup or move to a new server." => "Pas de base de données: backup et migration faciles.",
+ "Lock the access to the file/folder with a password." => "Verrouillez l'accès au fichier/dossier à l'aide d'un mot de passe.",
+ "Share a file or a folder with a unique acces link with the «burn mode»:" => "Partagez un fichier ou un dossier pour un accès unique avec le mode «burn».",
+ "Renew a share link with a single clic" => "Renouvelez un lien de partage en un clic.",
+ "Download a folder content into a zip" => "Téléchargez tout un dossier sous la forme d'un fichier zip.",
+ "Acces to BoZoN on smartphone without any specific app: your browser is enougth" => "Accédez à votre BoZoN depuis votre smartphone sans application spécifique.",
+ "Use a qrcode to share your link with smartphone users." => "Utilisez un QRcode pour partager un lien avec un smartphone",
+ "Add, remove users and manage their rights" => "Ajoutez, retirez des utilisateurs et gérez leurs droits",
+ "To upload a folder, just zip and upload it: with one clic it will be turned into a folder on the server." => "Envoyez un dossier complet en le zippant puis en dézippant sur le serveur en un clic.",
+ "Modify the templates & style to make your own BoZoN" => "Modifiez le thème par défaut pour créer votre propre style.",
+
+##################################################
+# ./templates/default/login.php
+##################################################
+ "Login" => "Identifiant",
+ "New account" => "Nouveau compte",
+ "This login is not available, please try another one" => "Ce nom est déjà utilisé, veuillez en choisir un autre.",
+ "Wrong combination login/pass" => "Identifiant ou mot de passe incorrect",
+ "The passwords doesn\'t match." => "Les mots de passe ne correspondent pas.",
+ "Problem with admin password." => "Le mot de passe de l'admin est incorrect.",
+ "Password changed" => "Mot de passe changé",
+ "User:" => "Utilisateur :",
+ "Old password" => "Ancien mot de passe",
+ "Password" => "Mot de passe",
+ "Repeat password" => "Resaisir le mot de passe",
+ "Stay connected" => "Rester connecté",
+
+##################################################
+# ./templates/default/stats.php
+##################################################
+ "No stats" => "Aucune statistique",
+ "Date" => "Date",
+ "File" => "Fichier",
+ "Owner" => "Propriétaire",
+# "IP" => "",
+ "Origin" => "Page d'origine",
+ "Host" => "Hôte",
+ "Delete all stat data" => "Supprimer les données statistiques",
+ "Export log:" => "Exporter le journal :",
+
+##################################################
+# ./templates/default/users.php
+##################################################
+ "Status" => "Statut",
+ "Space" => "Espace",
+ "Check users to delete account and files" => "Selectionnez les utilisateurs pour supprimer leur compte et leurs fichiers.",
+ "Select new status for the users" => "Sélectionnez un nouveau statut pour les utilisateurs",
+ "User" => "Utilisateur",
+ "Admin" => "Administrateur",
+ "Configure folders max size" => "Fixer la taille maximum des dossiers",
+ "Change users\'passwords" => "Changer les mots de passe des utilisateurs",
+ "Double-clic to generate a password" => "Double-cliquez pour générer un mot de passe",
+
+##################################################
+# Orphans
+##################################################
+ "When burn is on, the user can access the file/folder only once" => "Quand l'item est en mode burn, l'utilisateur ne pourra accéder à la ressource qu'une seule fois",
+ "Move files" => "Déplacer des fichiers",
+ "Root" => "Racine",
+ "Manage users" => "Gérer les utilisateurs",
+ "Users status" => "Statut des utilisateurs",
+ "Type to filter the list" => "Filtrer la liste",
+ "List" => "Liste",
+ "Icons" => "Icônes",
+ "Change theme" => "Changer le thème",
+ "Connect" => "Se connecter",
+ "Error, forbidden file format!" => "Erreur, format de fichier interdit !",
+ "Delete this file?" => "Supprimer ce fichier ?",
+ "Files list" => "Liste de fichiers",
+ "tiny file sharing app, coded with love and php by " => "mini app de partage de fichier, codée avec amour et php par ",
+ "guest" => "invité",
+ "user" => "utilisateur",
+ "admin" => "administrateur",
+ "add user" => "ajouter utilisateur",
+ "delete user" => "supprimer utilisateur",
+ "change user status" => "modifier statut",
+ "change folder size" => "modifier espace alloué",
+ "change status rights" => "modifier droits d'accès",
+ "change passes" => "modifier les passes",
+ "markdown editor" => "éditeur markdown",
+ "regen ID base" => "régénérer la base",
+ "acces logfile" => "accéder au log",
+ "users page" => "page utilisateurs",
+ "Move a file by clicking on it and choosing the destination folder in the list" => "Déplacer un fichier en cliquant dessus puis en sélectionnant la destination dans la liste",
+ "Move a folder by clicking on the move icon and choosing the destination folder in the list" => "Déplacer un dossier en cliquant sur 'Déplacer' puis en sélectionnant la destination dans la liste",
+ "Renew the share link of the file/folder (in case of a stolen link for example)" => "Renouveler le lien de partage d'un fichier/dossier quand celui-ci a fuité par exemple",
+ "If you want to remove the password, just click on Renew button" => "Si vous voulez retirer le mot de passe, cliquez sur le bouton Régénérer le lien",
+
+);
+?>
\ No newline at end of file
diff --git a/sources/readme.md b/sources/readme.md
new file mode 100644
index 0000000..8c34876
--- /dev/null
+++ b/sources/readme.md
@@ -0,0 +1,60 @@
+# BoZoN
+
+
+
+## Minimalist Drag & drop file sharing app
+( http://bozon.warriordudimanche.net/ )
+- Install: just unzip on your server; no database/ php 5.2. Then go to index.php?p=admin page and create your login/pass.
+- Config: just change config.php file.
+- Upload a file: go to index.php?p=admin page, connect and then drop files in the dashed area... that's it !
+- Organize files & folders, share them, manage the shared access etc.
+
+The share link is the file link in the admin's view (you can also access it by the button link on the file or the folder.)
+
+## Required
+Php 5 min, php5-gd, ZipArchive
+
+
+## used libraries
+I used a few libs I made
+- auto_restrict : to easily lock access to a page and handle basic security features
+- auto_thumbs : a function to generate all the thumbnails
+- auto_dropzone : a lib that handle the drag and drop function only by including it in a script
+- Array2feed.php : a function used to convert an array into a RSS feed without commiting suicide XD
+- "On-the-fly CSS Compression" (a personal modified version of https://gist.github.com/manastungare/2625128)
+
+and
+
+- sorttables.js (http://www.kryogenix.org/code/browser/sorttable)
+- b-lazy (http://dinbror.dk/blazy)
+- qr-js (http://hg.mearie.org/qrjs)
+- m3uStreamPlayer.js (https://github.com/opi/m3uStreamPlayer)
+- audiojs (http://kolber.github.io/audiojs)
+- scrolltotop : (https://github.com/jerrywham-pluxml5-2/scrollToTop/)
+- marked.js : (https://github.com/chjj/marked)
+- vanillajs : (my own lib, very tiny)
+
+
+## Licence
+All Bozon code and all the personal libs used in it are distributed under AGPL: feel free to fork, adapt, distribute, comment etc but please, keep your fork free too ;-)
+
+## FAQ
+- _I want to add a user_ : There's a [New user] link in the admin's page top menu, click on it and put a login/pass
+- _I want to remove a user_ : Click on the [Users list] link in the admin's page top menu, check the user(s) you want to remove and click on ok.
+- _I've changed some config variables and nothing appends !_ : that's not an issue; all variables are in the Session, so you need to restart chromium/firefox/opera etc to see the changes
+- _can't see icons / problems uploading / list refresh problem_ : take a look to access rights (folders / files)
+- _I want to change my password_ : Use the change password function (top menu)
+- _I forgot my password !_ : just use your FTP client and delete «private/auto_restrict*.php» files, then try to login again and create a new login/pass.
+- _I want to change the default language !_ : see in config.php file you can set fr/en/es but you can also make your own traduction (see in lang.php)
+- _I don't want a stolen link works anymore (but I don't want to delete the file/folder) !_ : in links mode, click on the regen button (recycle icon) and the share link for this item will automatically change.
+- _How to lock a share link with a password ?_ : click on the left menu, use the manage links button; then click on the lock icon on the file/folder and give an password. The file/folder will turn blue with a small lock meaning nobody can now use the share link without the password.
+- _Yes, ok, but how to remove the password ?_ : just click on regen button, the id will be regenerated and the password will be destroyed (the share link will change)
+- _What if I upload, create a folder or move an item with a name conflict ?_ : Don't worry, BoZoN will just rename the file to avoid overwriting.
+- _How to create my own skin ?_ : just copy the default folder in templates/ and make the changes you want, then change the config.php ($default_theme='default';)
+- _How to upload a complete folder with subfolders in one time ?_ : make a zip, upload it and use the convert icon (a folder) The uploaded zip will be unzipped on the server and all files and directory structure will be restored.
+
+## Special thanks
+To Cyrille Borne [ https://github.com/cborne & http://www.cyrille-borne.com ]: without your comments, issues reporting and enhancement ideas this app would never have been so complete ;-)
+To Eauland for his great job on my poor css/html code (a pain in the ass it seems ! ^^)
+
+
diff --git a/sources/templates/default/admin.php b/sources/templates/default/admin.php
new file mode 100644
index 0000000..3f30074
--- /dev/null
+++ b/sources/templates/default/admin.php
@@ -0,0 +1,266 @@
+
+
+ TOKEN
+ );
+ echo template('dialog_password',$array);
+}
+if ($mode=='view'){
+ # Add shares from others users
+ $shared_with=load_folder_share();
+ if (!empty($shared_with[$_SESSION['login']])){
+ $shared_folders.= '';
+ $saveshare=false;
+ foreach($shared_with[$_SESSION['login']] as $id=>$data){
+ if (is_dir($data['folder'])&&!empty($ids[$id])){
+ $folder=_basename($data['folder']);
+ $array=array(
+ '#CLASS' => 'shared_folder',
+ '#ID' => $id,
+ '#FICHIER' => $folder,
+ '#TOKEN' => TOKEN,
+ '#NAME' => $folder,
+ '#FROM' => $data['from'],
+ );
+ $shared_folders.= template($mode.'_shared_folder_'.$layout,$array);
+ }else{
+ # remove obsolete shared IDs
+ unset($shared_with[$_SESSION['login']][$id]);
+ $saveshare=true;
+ }
+ }
+ $shared_folders.= '
';
+ save_folder_share($shared_with);
+ }
+
+ # Prepare folder tree for move dialog box
+ $select_folder=''.e('Choose a folder',false).' ';
+ $folders_list=user_folder_tree();
+ if (isset($folders_list[0])){$folders_list[0].='/';}
+
+ foreach($folders_list as $folder){
+ $folder=substr($folder,$upload_path_size);
+ $select_folder.=''.$folder.' ';
+ }
+
+ $select_folder.=' ';
+ # Add move dialogbox to the page
+ $array=array(
+ '#LIST_FILES_SELECT' => $select_folder,
+ '#TOKEN' => TOKEN,
+ );
+
+ $dia=str_replace('#LIST_FILES_SELECT',$select_folder,$templates['dialog_move']);
+ $dia=str_replace('#TOKEN',TOKEN,$dia);
+ echo $dia;
+}
+
+?>
+
+
+
+
+
+
+
/
+
+ 1){unset($previous_path[$nb_folders-1]);$previous_path = implode('/',$previous_path);}
+ elseif($nb_folders=1&&!empty($previous_path[0])){$previous_path='/';}
+ else{$previous_path='';}
+
+
+ $chemin='';
+ foreach($ariane as $nb=>$folder){
+ if (!empty($folder)){
+ $chemin.=$folder;
+ echo '
'.$folder.' ';
+ $chemin.='/';
+ }
+ }
+
+ if (!empty($previous_path)&&$show_back_button){
+ $back_button='
';
+ $back_link='
+
.
+
..
+ ';
+ echo $back_button;
+ }
+ ?>
+
+
+ '.e('Filter:',false).' '.$_SESSION['filter'].'';
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sources/templates/default/css/admin.css b/sources/templates/default/css/admin.css
new file mode 100644
index 0000000..b9ee7d7
--- /dev/null
+++ b/sources/templates/default/css/admin.css
@@ -0,0 +1,139 @@
+/* Admin */
+#admin {
+ width: calc(100% - 8px);
+ margin: 0 auto;
+ color: #333;
+}
+
+/* menu */
+#admin #menu{display:block;}
+#admin #menu a.active{box-shadow:inset 0 0 10px #basic_color_superdark!important;}
+#admin #menu a {
+ display: block;
+ padding: 5px;
+ width: 22px;
+ height: 22px;
+ float: left;
+ margin-bottom: 10px;
+ border-top: 1px solid #888;
+ border-bottom: 1px solid #888;
+}
+#admin #menu a:hover {background-color: #hover_color_dark!important}
+
+#admin #menu a:first-of-type {
+ border-left: 1px solid #888;
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+#admin #menu a:last-of-type {
+ border-right: 1px solid #888;
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+
+#admin #menu #delete_selection
+{background:#e20;}
+#admin #menu #delete_selection.show
+{opacity:100;max-width:200px;transition:all 300ms;margin-left:2px;}
+#admin #menu #delete_selection:hover
+{background-color:#f30!important;transition:all 300ms;}
+#admin #menu #delete_selection,#admin #menu #zip_selection
+{
+ font-size:18px;
+ color:rgba(255,255,255,0.7);
+ text-align:center;
+ line-height:30px;
+ cursor:pointer;transition:all 300ms;
+ opacity:0;max-width:0;
+ overflow:hidden;
+ display: inline-block;
+ padding: 0;
+ width: 34px;
+ height: 34px;
+ border-radius: 3px;
+ margin-left:0;
+}
+#admin #menu #zip_selection.show
+{opacity:100;max-width:200px;transition:all 300ms;margin-left:2px;}
+#admin #menu #zip_selection:hover
+{background-color:#03F!important;transition:all 300ms;}
+#admin #menu #zip_selection{background: #02e;}
+
+#admin #menu a:hover{color:white;}
+#admin #menu a{
+ text-align:center;
+ vertical-align:middle;
+ color:rgba(255,255,255,0.8);
+ font-size:18px;
+ background: #basic_color_neutral
+}
+
+
+/* fil ariane */
+#admin #fil_ariane{
+ clear: both;
+ width: 100%;
+ height: 32px;
+ line-height: 32px;
+ vertical-align: middle;
+ border-bottom: 1px solid #888;
+ font-size: 1.2em;
+ margin-bottom:10px;
+}
+
+#admin #fil_ariane .ariane_home {
+ display: inline-block;
+ width: 25px;
+ height: inherit;
+ font-size:20px;
+ line-height:15px;
+}
+#admin #fil_ariane .back {
+ display: inline-block;
+ width: 32px;
+ height: inherit;
+ font-size:20px;
+ line-height:15px;
+}
+#admin #fil_ariane a:hover{color:#hover_color_neutral;}
+#admin #fil_ariane a.ariane_item{margin-left:5px;}
+#admin #fil_ariane a.ariane_item:after{
+ content:"/";
+ margin-left:5px;
+ margin-right:5px;
+ height:38px;
+ display:inline-block;
+ line-height: 30px;
+ color:rgba(0,0,0,0.5);
+
+ text-decoration: none;
+ font-size:1em;
+}
+
+#folder_size{
+ color:rgba(0,0,0,0.5);
+}
+
+/* filtre */
+#admin #filter {
+ margin: 15px 0;
+ font-size: 0.9em;
+}
+
+
+#ID_folder{text-align:center;color:rgba(0,0,0,0.8);font-size:1.2em;}
+
+#toplink a{color:rgba(0,0,0,0.5)}
+#toplink{
+ font-size:2em;
+ padding:5px;
+ background-color:rgba(0,0,0,0.2);
+ border-radius:3px;
+ width:48px;height: 48px;
+ text-align:center;
+ position:fixed;
+ bottom:5px;right:5px;
+}
+
+.info{text-align: center;padding:10px;border-radius: 3px;background-color: rgba(100,100,100,0.5);margin:5px;color:white;text-shadow:0 1px 1px rgba(0,0,0,0.2);}
\ No newline at end of file
diff --git a/sources/templates/default/css/dialog.css b/sources/templates/default/css/dialog.css
new file mode 100644
index 0000000..7febe80
--- /dev/null
+++ b/sources/templates/default/css/dialog.css
@@ -0,0 +1,154 @@
+/* Dialog boxes */
+.dialog {
+ display: none;
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1;
+}
+
+.dialog:target {
+ display: table;
+}
+
+.dialog figure {
+ display: table-cell;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ vertical-align: middle;
+}
+
+.dialog figure figcaption {
+ display: block;
+ margin: auto;
+ padding: 0;
+ background: linear-gradient(#ddd,#eee);
+ position: relative;
+ overflow: hidden;
+ border: 1px #888 solid;
+ border-top: 1px #basic_color_light solid;
+ border-bottom: 1px #777 solid;
+ border-radius: 3px;
+ box-shadow: 0 1px 2px rgba(0,0,0,0.4);
+ text-align: justify;
+ font-size: 14px;
+}
+
+.dialog figure figcaption p{margin:10px;}
+
+.dialog figure .closemsg {
+ display: block;
+ margin: auto;
+ height: 0;
+ overflow: visible;
+ text-align: right;
+ z-index: 2;
+ cursor: default;
+}
+
+.dialog figure .closemsg,
+.dialog figure figcaption {
+ width: 400px;
+}
+
+.dialog figure .closemsg::after {
+ content: "\00D7";
+ font-size: 20px;
+ display: inline-block;
+ position: relative;
+ right: 8px;
+ top: 11px;
+ z-index: 3;
+ color: rgba(255,255,255,0.8);
+ width: 20px;
+ height: 20px;
+ line-height: 18px;
+ text-align: center;
+ margin: 0;
+
+ font-weight: bold;
+ cursor: pointer;
+}
+
+.dialog figure .closemsg::before {
+ content: "";
+ display: block;
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,0.8);
+}
+
+.dialog select {
+ display: block;
+ width: 100%;
+ height: 32px;
+ color: rgba(0,0,0,0.7);
+ box-shadow: 0 1px 2px rgba(0,0,0,0.2);
+}
+
+.dialog h1 {
+ background: linear-gradient(#basic_color_dark,#basic_color_neutral);
+ margin: 0;
+ padding: 10px;
+ font-weight: bold;
+ border-bottom: 1px rgba(0,0,0,0.1) solid;
+ font-size: 18px;
+ color: #fff;
+
+ text-shadow: 0 0px 1px rgba(0,0,0,0.9);
+ margin-bottom: 0;
+}
+
+.dialog form{
+ padding: 15px;
+}
+
+.dialog label{
+ color: rgba(0,0,0,0.7);
+ padding-bottom: 7px;
+ display: inline-block;
+}
+
+.dialog input[type=text],
+.dialog textarea,
+.dialog select {
+ display: block;
+ background: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.2));
+ border: 1px solid rgba(0,0,0,0.3);
+ border-bottom: 1px rgba(255,255,255,0.3) solid;
+ font-size: 14px;
+ color: rgba(0,0,0,0.5);
+ text-shadow: 0 1px 1px rgba(255,255,255,0.5);
+ margin:20px 0 20px 0;
+ width:340px;
+ border-radius: 3px;
+ box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
+ padding: 6px;
+}
+
+.dialog input[type=submit]{
+ display: block;
+ margin: 0 auto;
+ margin-top: 25px;
+ margin-bottom:15px;
+ width: 100px;
+}
+
+#link_box textarea {
+ resize:none;
+}
+
+
+#qrcode_img {
+ display: block;
+ margin: 5px auto;
+ width: 256px;
+ height: 256px;
+}
diff --git a/sources/templates/default/css/edit_profiles.css b/sources/templates/default/css/edit_profiles.css
new file mode 100644
index 0000000..a381500
--- /dev/null
+++ b/sources/templates/default/css/edit_profiles.css
@@ -0,0 +1,13 @@
+#edit_profiles {text-align: center;}
+#edit_profiles input[type=checkbox]:checked+.btn{background-color:#0a0;color:white;}
+#edit_profiles input[type=checkbox]{display:none;}
+#edit_profiles input[type=submit]{display:block;width:200px;margin:auto;}
+#edit_profiles .btn{font-size:0.9em;background-color:#a00;color:rgba(255,255,255,0.5);}
+#edit_profiles .npt{width:100%;max-width:200px;}
+#edit_profiles table{ text-align: left; border-collapse: collapse;display:inline-block;}
+#edit_profiles td:first-of-type{}
+#edit_profiles td{vertical-align: middle;padding:10px;}
+#edit_profiles tr{}
+#edit_profiles .add .btn{background:#basic_color_light;}
+#edit_profiles input[type=checkbox]:disabled+.btn{opacity:0.2;}
+
diff --git a/sources/templates/default/css/editor.css b/sources/templates/default/css/editor.css
new file mode 100644
index 0000000..3d8996a
--- /dev/null
+++ b/sources/templates/default/css/editor.css
@@ -0,0 +1,34 @@
+#editor{
+ width:100%;
+ min-height: 500px;
+ text-indent: 7px;
+ margin-bottom: 7px;
+ color: #85888b;
+ border: 1px solid #d6ecfc;
+ border-radius: 5px;
+ background-color:white;
+ padding:10px;
+}
+#editor_page textarea{padding:15px;min-height:500px;resize:vertical;}
+#editor_page {max-width:1200px;padding:20px;margin:auto}
+#editor_page .npt{width:100%;font-size:1.3em;}
+#editor_page .btn{width:200px;font-size:1.4em;display:block;margin:auto;}
+#editor_page .dialog figcaption{
+ padding:15px;
+ max-width:1200px;width:100%;
+}
+#editor_page .tab_space{
+ width:100%;
+ margin:5px auto;
+ max-width:1200px;
+}
+#editor_page #visu{
+ min-height: 500px;
+ margin:0;
+ max-width:100%;
+}
+#editor_page .tabs>li{
+ display: inline-block;
+}
+#editor_page .help_tab{padding:30px;font-size: 1.2em;font-family: monospace;}
+#editor_page .npt{margin:0;margin-bottom:15px;width:calc(100% - 30px);}
\ No newline at end of file
diff --git a/sources/templates/default/css/font/bozon.eot b/sources/templates/default/css/font/bozon.eot
new file mode 100644
index 0000000..2fa8ea7
Binary files /dev/null and b/sources/templates/default/css/font/bozon.eot differ
diff --git a/sources/templates/default/css/font/bozon.svg b/sources/templates/default/css/font/bozon.svg
new file mode 100644
index 0000000..0912909
--- /dev/null
+++ b/sources/templates/default/css/font/bozon.svg
@@ -0,0 +1,108 @@
+
+
+
+Copyright (C) 2016 by original authors @ fontello.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sources/templates/default/css/font/bozon.ttf b/sources/templates/default/css/font/bozon.ttf
new file mode 100644
index 0000000..e6c88e2
Binary files /dev/null and b/sources/templates/default/css/font/bozon.ttf differ
diff --git a/sources/templates/default/css/font/bozon.woff b/sources/templates/default/css/font/bozon.woff
new file mode 100644
index 0000000..305f732
Binary files /dev/null and b/sources/templates/default/css/font/bozon.woff differ
diff --git a/sources/templates/default/css/font/bozon.woff2 b/sources/templates/default/css/font/bozon.woff2
new file mode 100644
index 0000000..b294698
Binary files /dev/null and b/sources/templates/default/css/font/bozon.woff2 differ
diff --git a/sources/templates/default/css/font/fontello.eot b/sources/templates/default/css/font/fontello.eot
new file mode 100644
index 0000000..17393e8
Binary files /dev/null and b/sources/templates/default/css/font/fontello.eot differ
diff --git a/sources/templates/default/css/font/fontello.svg b/sources/templates/default/css/font/fontello.svg
new file mode 100644
index 0000000..279847f
--- /dev/null
+++ b/sources/templates/default/css/font/fontello.svg
@@ -0,0 +1,36 @@
+
+
+
+Copyright (C) 2012 by original authors @ fontello.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sources/templates/default/css/font/fontello.ttf b/sources/templates/default/css/font/fontello.ttf
new file mode 100644
index 0000000..6a6bb58
Binary files /dev/null and b/sources/templates/default/css/font/fontello.ttf differ
diff --git a/sources/templates/default/css/font/fontello.woff b/sources/templates/default/css/font/fontello.woff
new file mode 100644
index 0000000..8f19a93
Binary files /dev/null and b/sources/templates/default/css/font/fontello.woff differ
diff --git a/sources/templates/default/css/footer.css b/sources/templates/default/css/footer.css
new file mode 100644
index 0000000..b2e54e5
--- /dev/null
+++ b/sources/templates/default/css/footer.css
@@ -0,0 +1,26 @@
+/* Footer */
+body footer {
+ padding: 25px 0 15px 0;
+ clear: both;
+}
+
+footer a#github {
+ display: block;
+ margin: 0 auto;
+ width: 32px;
+ height: 32px;
+ opacity: 0.5;
+ font-size:32px;
+ color:rgba(0,0,0,0.8);
+}
+
+footer a#github:hover {
+ opacity: 0.7;
+}
+
+footer #version {
+ font-size: 0.8em;
+ color: rgba(0,0,0,0.4);
+ margin-top: 10px;
+ text-align: center;
+}
diff --git a/sources/templates/default/css/gallery.css b/sources/templates/default/css/gallery.css
new file mode 100644
index 0000000..2d58a9a
--- /dev/null
+++ b/sources/templates/default/css/gallery.css
@@ -0,0 +1,33 @@
+/* gallery */
+.gallery{padding:10px;text-align:center;}
+body .gallery h1{text-align:center;font-size:48px;}
+.image,.blank{
+ display:inline-block;
+ vertical-align: bottom;
+ overflow: hidden;
+ height: 256px;
+ width:256px;
+ vertical-align: bottom;
+}
+.image img{border-radius: 3px;}
+.image .info{
+ background-color:rgba(0,0,0,0.4);
+ color:rgba(255,255,255,0.6);
+ text-shadow: 0 1px 1px black;
+ padding:10px;
+ padding-top:20px;
+ position: relative;
+ top: 0px;
+ left: 0px;
+ word-wrap: break-word;
+ width: 256px;
+ height:256px;
+ display: block;
+ margin:0;
+ border-radius:3px;
+ opacity:0;
+
+}
+.image:hover .info{top:-259px;opacity:100;}
+.image .info em{display:block;color:white;margin-bottom:5px;}
+.video{/*background:url(img/video.png) no-repeat;*/}
diff --git a/sources/templates/default/css/header.css b/sources/templates/default/css/header.css
new file mode 100644
index 0000000..dc5be80
--- /dev/null
+++ b/sources/templates/default/css/header.css
@@ -0,0 +1,282 @@
+/* Header */
+body>header {
+ min-height: 80px;
+ background: #basic_color_neutral;/* change this color in style.php*/
+ text-align: center;
+ padding-bottom: 10px;
+ border-bottom: 1px solid rgba(0,0,0,0.2);
+ margin-bottom:20px;
+}
+#title_page{
+ text-align:left;
+ font-size:1.7em;
+ color:rgba(255,255,255,0.9);
+ padding-left:10px;
+ display:block;
+ margin:0;
+ text-shadow: 0 1px 1px rgba(0,0,0,0.5)
+}
+#top_bar {
+ background: rgba(0,0,0,0.4);
+ margin-bottom: 5px;
+ border-bottom: 1px solid rgba(0,0,0,0.2);
+}
+
+#top_bar a {line-height: 23px;}
+#top_bar a:hover {
+ color: #hover_color_light;
+ background-color: #hover_color_superdark!important;
+}
+
+#top_bar #icons a {
+ min-width: 22px;
+ height: 22px;
+ display: block;
+ float: left;
+}
+
+
+#top_bar #icons {
+ float: left;
+}
+
+#top_bar #icons a:hover {color:white;}
+#top_bar #icons a {
+ display: inline-block;
+ padding: 5px;
+}
+
+#top_bar #icons a,
+#top_bar #lang a {
+ color: rgba(255,255,255,0.6);
+ border: 1px solid rgba(0,0,0,0.2);
+ border-left:none;
+}
+
+#top_bar #lang {
+ float: right;
+}
+
+#top_bar #lang a {
+ display: inline-block;
+ padding: 5px;
+ min-width: 22px;height: 22px;
+ width: auto;
+ border-left: 1px solid rgba(0,0,0,0.2);
+}
+
+#top_bar #lang a.active {
+ color: #fff;
+}
+#top_bar .profile_rights .icon-crown:before{vertical-align: sub;}
+#search {
+ float: right;
+ display: block;
+ margin-right: 2px;
+}
+
+#search input[type=text]{
+ margin-top: 3px;
+ height: 28px;
+ width: 5px;
+ padding-left: 26px;
+ background: #e9e9e9 url('../img/header/search.png') 8px center no-repeat;
+ border: 1px solid #d9d9d9;
+ border-radius: 3px;
+}
+
+#search input[type=text]:hover,
+#search input[type=text]:focus {
+ width: 200px;
+ background-color: #eee;
+}
+
+#connect {
+ clear: both;
+ display: block;
+ vertical-align: middle;
+}
+
+#connect #admin_button {
+ height: 22px;
+ line-height: 22px;
+ vertical-align: middle;
+ min-width: 22px;
+ padding-left:20px;margin-right:5px;
+ text-align: center;
+ background: rgba(0,0,0,0.2) url('../img/header/user.png') 5px center no-repeat;
+ color: rgba(255,255,255,0.7);
+ float: right;
+ }
+#connect #admin_button.superadmin{padding-left:5px;background-image:none;color:white;text-shadow:0 0 2px rgba(255,255,255,0.5);}
+#connect #admin_button.admin{padding-left:5px;background-image:none;}
+#connect #admin_button.user{padding-left:5px;background-image:none;}
+
+#connect #logout_button,
+#connect #login_button {
+ height: 22px;
+ width: 22px;line-height: 25px;
+ float: right;
+}
+#connect a:hover{
+ background-color: #hover_color_dark!important;
+ color:#hover_color_light!important;
+}
+
+#connect #login_button{
+ color:rgba(255,255,255,0.8);
+ font-size:18px;line-height: 16px;
+}
+
+#connect #logout_button:hover{color:white!important}
+#connect #logout_button {
+ font-size: 20px;
+ line-height: 18px;
+ color:rgba(255,255,255,0.8);
+}
+
+body.login #connect #login_button {
+ display: none;
+}
+
+#logo {
+ clear: both;
+ width: 100%;
+ /*height: 150px;*/
+ padding-top: 118px;
+ background: transparent url('../img/header/logo.png') center top no-repeat;
+ color: #fff;
+ display: block;
+}
+
+
+/* Slogan seulement sur l'accueil */
+.slogan {
+ display:none;
+}
+
+body.home .slogan {
+ display: block;
+ font-size: 24px;
+ text-align: center;
+ color: #fff;
+}
+
+/* Dropzone */
+#upload.hidden, .info.hidden{
+ max-height:0;
+ opacity:0;
+ transition: all 300ms;
+
+}
+#upload{
+ max-height:300px;
+ opacity:100;
+ overflow:hidden;
+ transition: all 300ms;
+}
+
+.DD_dropzone {
+ clear: both;
+ font-size: 1em;
+ cursor: pointer;
+ text-align: center;
+ margin: auto;
+ width: 100%;
+ padding: 15px;
+ padding-top: 118px;
+ min-height: 100px;
+ min-width: 300px;
+ background: transparent url('../img/header/logo.png') center top no-repeat;
+}
+
+.DD_uploading {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,5,0.8);
+}
+
+.DD_uploading .DD_text {
+ display: none;
+}
+
+.DD_hover {
+ background-color: #hover_color_neutral;
+}
+
+.DD_text {
+ color: #fff;
+ font-size: 16px;
+ margin-top: 15px;
+ font-weight: bold;
+ min-width: 300px;
+ max-width: 500px;
+ margin: auto;
+ text-shadow: 0 1px 1px rgba(0,0,0,0.4);
+ border:none;
+}
+
+.DD_text em {
+ font-size: 0.8em;
+ font-style: italic;
+}
+
+.DD_file,.DD_error {
+ padding: 10px;
+ border-radius: 3px;
+ display: block;
+ margin-bottom: 5px;
+}
+
+ li.DD_success {
+ background-color: rgba(0,255,0,0.8);
+}
+
+li.DD_error {
+ font-weight: bold;
+ background-color: rgba(255,0,0,0.8);
+ color: #fff;
+ text-shadow: 0 1px 1px rgba(155,0,0,0.8)
+}
+
+li.DD_warning {
+ font-weight: bold;
+ background-color: rgba(255,150,0,0.8);
+ color: #fff;
+ line-height: 20px;
+ text-shadow: 0 1px 1px rgba(155,80,0,0.8)
+}
+
+.DD_info {
+ text-align: left;
+}
+
+.DD_info li.DD_file {
+ list-style: none;
+}
+
+#DD_progressbar {
+ overflow: hidden;
+ font-size: 0.8em;
+ border-radius: 3px;
+ padding: 3px 0;
+ text-align: center;
+ background: #bAd3ed;
+ box-shadow: 0 0 3px #405bff;
+ color: #000;
+ height: 20px;
+ width: 0%
+}
+
+.DD_hidden{
+ opacity: 0;
+ width: 0;
+ height: 0;
+ border: 0;
+ position: absolute;
+ top: -10000px;
+ left: -10000px;
+}
diff --git a/sources/templates/default/css/home.css b/sources/templates/default/css/home.css
new file mode 100644
index 0000000..a95864e
--- /dev/null
+++ b/sources/templates/default/css/home.css
@@ -0,0 +1,82 @@
+/* Home */
+#home {
+ max-width: 1000px;
+ margin: 0 auto;
+}
+
+#home a {
+ color: #3e58f7;
+}
+
+#home a:hover {
+ text-decoration: underline;
+}
+
+#home #center {
+ text-align: center;
+ margin: 0 4px;
+}
+
+#home #logos,
+#home .img {
+ margin-top: 4px;
+}
+
+#home #agpl {
+ margin-top: 10px;
+}
+
+#home #easy {
+ margin-top: 25px;
+}
+
+#home #easy #notes div {
+ width: 46%;
+ margin: 0 2%;
+ text-align: center;
+ float: left;
+}
+
+#home #easy #notes img {
+ width: 128px;
+ display: inline;
+}
+
+#home #easy h2,
+#home #more h2 {
+ font-size: 1.5em;
+ text-align: center;
+ padding: 20px 0;
+ text-decoration: underline;
+}
+
+#home #more {
+ clear: both;
+ padding-top: 25px;
+}
+
+#home #more ul li {
+ display: block;
+ margin: 0 4px 6px 4px;
+}
+
+#home #more ul li:hover {
+ background-color: #bAd3ed;
+ box-shadow: 0px 0px 2px rgba(0, 126, 255, 0.5);
+}
+
+#home #more ul li span {
+ display: table-cell;
+ vertical-align: middle;
+}
+
+#home #more ul li span.img {
+ width: 64px;
+ height: 64px;
+}
+
+#home #more ul li span.img img {
+ height: inherit;
+ display: inline;
+}
+.home header #title_page{display:none;}
\ No newline at end of file
diff --git a/sources/templates/default/css/icons.css b/sources/templates/default/css/icons.css
new file mode 100644
index 0000000..7762486
--- /dev/null
+++ b/sources/templates/default/css/icons.css
@@ -0,0 +1,99 @@
+@font-face {
+ font-family: 'bozon';
+ src: url('font/bozon.eot?8687479');
+ src: url('font/bozon.eot?8687479#iefix') format('embedded-opentype'),
+ url('font/bozon.woff?8687479') format('woff'),
+ url('font/bozon.ttf?8687479') format('truetype'),
+ url('font/bozon.svg?8687479#bozon') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
+/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
+/*
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+ @font-face {
+ font-family: 'bozon';
+ src: url('../font/bozon.svg?8687479#bozon') format('svg');
+ }
+}
+*/
+
+ [class^="icon-"]:before, [class*=" icon-"]:before {
+ font-family: "bozon";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+ vertical-align: middle;
+ display: inline-block;
+ text-decoration: inherit;
+ text-align: center;
+ /* opacity: .8; */
+
+ /* For safety - reset parent styles, that can break glyph codes*/
+ font-variant: normal;
+ text-transform: none;
+ /* you can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+
+ /* Font smoothing. That was taken from TWBS */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ /* Uncomment for 3D effect */
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
+}
+
+#admin .icon .icon-file:before { content: '\e808';color:rgba(0,0,0,0.8); font-size:64px;} /* '' */
+
+
+
+.icon-search:before { content: '\e800'; } /* '' */
+.icon-video:before { content: '\e801'; } /* '' */
+.icon-th-large:before,.icon-icon:before { content: '\e802'; } /* '' */
+.icon-th-list:before,.icon-list:before { content: '\e803'; } /* '' */
+.icon-cancel-circled:before { content: '\e804'; } /* '' */
+.icon-info-circled:before { content: '\e805'; } /* '' */
+.icon-download-cloud:before { content: '\e806'; } /* '' */
+.icon-upload-cloud:before { content: '\e807'; } /* '' */
+.icon-doc-inv:before,.icon-view:before,.icon-file:before { content: '\e808'; } /* '' */
+.icon-doc-text-inv:before { content: '\e809'; } /* '' */
+.icon-rss-squared:before { content: '\e80a'; } /* '' */
+.icon-cog-alt:before { content: '\e80b'; } /* '' */
+.icon-logout:before { content: '\e80c'; } /* '' */
+.icon-angle-circled-left:before { content: '\e80d'; } /* '' */
+.icon-play:before { content: '\e80e'; } /* '' */
+.icon-stop:before { content: '\e80f'; } /* '' */
+.icon-pause:before { content: '\e810'; } /* '' */
+.icon-globe:before { content: '\e811'; } /* '' */
+.icon-align-left:before { content: '\e812'; } /* '' */
+.icon-qrcode:before { content: '\e813'; } /* '' */
+.icon-github-circled:before { content: '\e814'; } /* '' */
+.icon-users:before { content: '\e815'; } /* '' */
+.icon-user-add:before,.icon-admin:before { content: '\e816'; } /* '' */
+.icon-eye:before { content: '\e817'; } /* '' */
+.icon-folder-1:before { content: '\e818'; } /* '' */
+.icon-flow-tree:before { content: '\e819'; } /* '' */
+.icon-home:before { content: '\e81a'; } /* '' */
+.icon-folder-add:before { content: '\e829'; } /* '' */
+.icon-cancel-circled2:before { content: '\e81c'; } /* '' */
+.icon-pencil:before { content: '\e81d'; } /* '' */
+.icon-edit:before { content: '\e81e'; } /* '' */
+.icon-fire:before { content: '\e81f'; } /* '' */
+.icon-cancel-circle:before { content: '\e820'; } /* '' */
+.icon-left-circle:before { content: '\e821'; } /* '' */
+.icon-right-circle:before { content: '\e822'; } /* '' */
+.icon-trash:before { content: '\e823'; } /* '' */
+.icon-shuffle:before { content: '\e824'; } /* '' */
+.icon-link:before,.icon-links:before { content: '\e825'; } /* '' */
+.icon-lock:before { content: '\e826'; } /* '' */
+.icon-renew:before { content: '\e827'; } /* '' */
+.icon-userfolder:before { content: '\e828'; } /* '' */
+.icon-addfolder:before { content: '\e829'; } /* '' */
+.icon-newpass:before { content: '\e82a'; } /* '' */
+.icon-crown:before,.icon-superadmin:before { content: '\e82B'; } /* '' */
+.icon-bat2:before { content: '\e82c'; } /* '' */
+.icon-user:before { content: '\e82d'; } /* '' */
+.icon-block:before { content: '\e82e'; } /* '' */
+.icon-home_folder:before { content: '\e82f'; } /* '' */
+.icon-help-circled:before { content: '\e830'; } /* '' */
\ No newline at end of file
diff --git a/sources/templates/default/css/ini.css b/sources/templates/default/css/ini.css
new file mode 100644
index 0000000..ae41b85
--- /dev/null
+++ b/sources/templates/default/css/ini.css
@@ -0,0 +1,149 @@
+/* Initialisation */
+html {
+ box-sizing: border-box;
+}
+*, *:before, *:after {
+ box-sizing: inherit;
+}
+
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+
+ol, ul {
+ list-style: none;
+}
+
+a {
+ color: rgba(0,0,0,0.7);
+ text-decoration: none;
+}
+
+a:hover {
+ color:#hover_color_light;
+}
+
+a:visited {
+ color:rgba(0,0,0,0.9);
+}
+
+a:active{
+ color:#333;
+}
+
+h1 {
+ color: #basic_color_neutral;
+ text-shadow:0 1px 1px #basic_color_superdark;
+ font-size: 2em;
+ margin: 20px auto;
+ text-align: center;
+ width: calc(100% - 8px);
+}
+body input[required].npt{
+ padding-left:23px;
+ background:url(../img/dialog/required.png) no-repeat 5px center rgba(255,255,255,0.8);
+
+}
+
+.clear {
+ clear: both;
+}
+
+body{
+ min-width: 320px;
+ background: #e9e9e9;
+ font-family: verdana, sans-serif;
+}
+
+.checked,.checked .table_buttons{
+ background-color:#basic_color_dark!important;
+ color:white!important;
+}
+.checked a{ color:white}
+.checked a:hover{ color:white!important;}
+.error{padding:20px;background-color:rgba(255,0,0,0.6);color:white;border-radius: 3px;}
+.error a{color:pink;}
+.error a:hover{color:white;}
+.npt{
+ width: 400px;
+ height: 35px;
+ text-indent: 7px;
+ margin-bottom: 7px;
+ color: #85888b;
+ border: 1px solid #d6ecfc;
+ border-radius: 5px;
+ }
+
+.btn {
+ cursor: pointer;
+ border-radius: 3px;
+ display: inline-block;
+ padding: 5px;
+ border: 1px solid rgba(0,0,0,0.2);
+ background-color: #basic_color_neutral;
+ color: rgba(255,255,255,0.8);
+ margin: 2px;
+}
+
+.btn:hover {
+ background-color: #hover_color_neutral;
+
+}
+.home .link_error{
+ text-align: center;
+ padding:10px;
+ border-radius: 3px;
+ background:url(../img/home/error_link.png) no-repeat top center;
+ margin:5px;
+ color:rgba(0,0,0,0.7);
+ font-size:1.5em;
+ padding-top:100px;
+}
+#submit {
+ width: 200px;
+ height: 35px;
+ text-indent: 0;
+ background: #basic_color_neutral;
+ box-shadow: inset 0 0 15px #basic_color_dark;
+ color: #fff;
+ cursor: pointer;
+}
+
+.feeds{text-align:center;}
+/*.hidden{display:none;}*/
+
+img, a, input, li, .DD_dropzone, .DD_dropzone *,
+label, .lang, #menu, #menu_icon, select,
+#search input, .image .info {
+ transition: all 300ms;
+}
+
+img:hover, a:hover, input:hover, li:hover,
+form:hover , .lang:hover, #menu_icon:hover,
+select:hover, #search input:hover,
+.image:hover .info {
+ transition: all 300ms;
+}
diff --git a/sources/templates/default/css/lightbox.css b/sources/templates/default/css/lightbox.css
new file mode 100644
index 0000000..e813ce1
--- /dev/null
+++ b/sources/templates/default/css/lightbox.css
@@ -0,0 +1,85 @@
+#lb_overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 0;
+ opacity:0;
+ background: #000; /* IE 8 not support rgba */
+ filter: alpha(opacity = 90); /* IE 8 not support opacity */
+ background: rgba(0, 0, 0, 0.9);
+ z-index: 9999;
+ overflow:hidden;
+ transition: all 300ms;
+}
+
+#lb_overlay iframe{
+ height: 100%;
+ width: 100%;
+ border:none;
+ background:white;
+}
+#lb_nav{
+ /*background:rgba(0,0,0,0.4);*/
+ position:fixed;
+ bottom:0;
+ left:0;
+ width:100%;
+ height:0;
+ opacity:0;
+ z-index: 1;
+
+}
+#lb_content-info {
+ background:rgba(0,0,0,0.4);
+ line-height: 1.8em;
+ font-size: 1.2em;
+ display: block;
+ width:auto;
+ height: 40px;
+ margin:auto;
+ color:white;
+ text-shadow:0 0 2px black;
+ text-align:center;
+}
+#lb_close{
+ background:url(../img/lightbox/close_white.png) no-repeat center center;
+ width:32px;height:32px;
+ z-index: 10000;
+ float:right;
+ cursor:pointer;
+ margin-top: 3px;
+}
+#lb_next,#lb_prev{
+ width:32px;height:32px; margin-top: 3px;
+ z-index: 10000;
+ float:left;
+ cursor:pointer;
+}
+#lb_next:hover,#lb_prev:hover{background-color:rgba(0,0,0,0.7);}
+#lb_next{
+ background:url(../img/lightbox/next.png) no-repeat center center;
+}
+#lb_prev{
+ background:url(../img/lightbox/prev.png) no-repeat center center;
+}
+#lb_content {
+ max-height: 100%; transition: all 300ms; height:100%;
+}
+
+#lb_content img {
+ transition: all 300ms;
+ /* Keeps image from going outside the screen */
+ max-height: 100%;
+ max-width: 100%;
+ /* Keeps image from beeing distorted */
+ height: auto;
+ width: auto;
+ /* centering horizontally AND vertically */
+ /* 50% of container */
+ position: relative;
+ top: 50%;
+ left: 50%;
+ /* 50% of image */
+ transform: translate(-50%,-50%);
+}
\ No newline at end of file
diff --git a/sources/templates/default/css/list.css b/sources/templates/default/css/list.css
new file mode 100644
index 0000000..0704a1e
--- /dev/null
+++ b/sources/templates/default/css/list.css
@@ -0,0 +1,322 @@
+/* List */
+/*
+Aucun fichier:
+.icon et .list ayant un min-height à 200px, on fixe ici la hauteur pour center le message verticalement
+*/
+#nofile {
+ height: 200px;
+ line-height: 200px;
+ text-align: center;
+ vertical-align: middle;
+}
+.free_space_text{padding:10px;}
+#admin #more_button{
+ display:block;
+ max-width:200px;
+ margin:20px auto;
+ text-align:center;
+transition: all 400ms;
+}
+#admin .loading{background-color:#0F3; color:#050;transition: all 400ms;}
+#async_loading{transition: all 400ms;}
+#nb_items{display:inline-block;}
+/*
+ * Vue en listes
+ */
+
+/* afficher les actions au survol d'un fichier ou dossier de la liste */
+#admin .list table {
+ width:100%; border-collapse: collapse
+}
+ #admin .list table thead th{
+ padding-top:10px;
+ font-size: 1.3em;text-align: left;
+ }
+ #admin .list table thead th.sorttable_sorted{
+ font-weight:bold;
+ }
+ #admin .list td.table_check {
+ width:10px;vertical-align: middle
+ }
+ #admin .list td.table_image {
+ width:20px;
+ text-align: center;
+ }
+ #admin .list td.table_filename {
+
+ }
+ #admin .list td.table_filesize {
+
+ }
+ #admin .list td.table_buttons {
+ background-color:#basic_color_light;
+ }
+ #admin .list td.table_buttons:empty {
+ background-color:transparent;
+ }
+ #admin .list td{padding: 3px;}
+ #admin .list td a.back,#admin .list td a.root{display:block;font-size:1.4em;width:100%;font-weight: bolder}
+
+
+/* les listes */
+#admin .list tr, #admin #Users_list li{
+ min-height: 26px;
+ overflow: hidden;
+ font-size: 12px;
+ border-radius: 3px;
+ cursor: pointer;
+ word-spacing: word-wrap;
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+ z-index: 1;
+ border-top:1px solid rgba(0,0,0,0.1);
+}
+#admin #Users_list li label{display:inline-block;width:90%;cursor:pointer;}
+#admin #Users_list li:hover{background:transparent}
+#admin #Users_list li{
+ cursor:default;
+ text-align:left;
+ height:26px;
+ display:block;
+ width:auto;
+ padding:0;
+}
+
+#admin .list tr a:hover{color:#hover_color_dark;}
+#admin .list tr a {
+ max-height: 30px;
+ width: 100%;
+ font-style: normal;
+ display: inline-block;
+ word-wrap: break-word;
+ word-break: break-all;
+ text-decoration: none;
+}
+
+#admin .list tr a img {
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ margin: auto;
+ border-radius: 2px;
+ vertical-align: middle;
+}
+
+/*
+ * Vue en listes et en icones
+ */
+
+#admin .icon #folder_size{text-align:center;margin-top:20px;}
+
+#admin .list,
+#admin .icon {
+ padding: 0;
+ min-height: 200px;
+ text-align: left;
+}
+
+#admin .list .folder,
+#admin .icon .folder {
+ background: rgba(0,50,100,0.1);
+}
+#admin .list .folder .table_image{
+ font-size:18px;
+
+}
+
+#admin .list .folder .over,
+#admin .icon .folder .over {
+ color: rgba(0,0,0,0.5);
+ text-align: center;
+}
+
+#admin .list tr:hover{background-color:#hover_color_light;}
+#admin .icon li:hover {
+ background-color:#hover_color_neutral;
+}
+
+#admin .list tr.burn .table_buttons{background-color: rgba(200,10,0,0.5)}
+#admin .list tr.burn,
+#admin .icon li.burn {
+ background-color: rgba(255,10,0,0.5) ;
+}
+
+#admin .list tr.burn:hover,
+#admin .icon li.burn:hover {
+ background-color: rgba(255,10,0,0.2) !important;
+ box-shadow: 0 0 2px rgba(255,10,0,0.5);
+}
+
+#admin .list tr.locked .table_buttons{background-color: rgba(0,126,200,0.5)}
+#admin .list tr.locked,
+#admin .icon li.locked {
+ background-color: rgba(0,126,255,0.5);
+}
+
+#admin .list tr.locked:hover,
+#admin .icon li.locked:hover {
+ background-color: rgba(0,126,255,0.2) !important;
+ box-shadow: 0 0 2px rgba(0,100,255,0.5);
+}
+
+
+.links .list tr:hover{background-color: #hover_color_light;}
+.links .icon li:hover {
+ background-color: #hover_color_neutral !important;
+}
+
+.shared_folder a{color:rgba(0,0,0,0.5)!important;}
+.shared_folder a:hover{color:rgba(0,0,0,0.8)!important;}
+.shared_folder .owner{color:rgba(0,50,100,0.5)!important;}
+.shared_folder,.shared_folder .table_buttons{
+ background: rgba(0,50,100,0.2)!important;
+
+}
+
+
+
+#admin .list tr .table_buttons a:hover,#admin .icon li .buttons a:hover{color:rgba(255,255,255,1);}
+#admin .list tr .table_buttons a{
+ display:inline-block;
+ line-height: 100%;
+ width: 20px;
+ height: 20px;
+ border-radius: 3px;
+ font-size: 18px;
+ color:rgba(255,255,255,0.6);
+ }
+#admin .icon li .buttons a {
+ display: none;
+ line-height: 100%;
+ width: 18px;
+ height: 18px;
+ border-radius: 3px;
+ font-size: 14px;
+ margin: 1px;
+ color:rgba(255,255,255,0.6);
+}
+
+#admin .icon li:hover .buttons {
+ background-color: #hover_color_dark;
+ padding:3px;
+ border-radius: 3px;
+}
+
+#admin .list tr:hover .buttons *,
+#admin .icon li:hover .buttons * {
+ display: inline-block;
+}
+#admin .blue{color:rgba(0,100,255,0.7);}
+#admin .blue:hover{color:rgba(0,100,255,1);}
+
+
+#admin .icon .folder span{display:block;font-size:64px;}
+#admin .icon .folder span.owner{font-size:1em;}
+
+#admin .icon .folder .buttons span{font-size:14px;}
+#admin .table_image{font-size:18px;}
+#admin .ext{overflow:hidden;}
+#admin .table_image .ext em{
+ font-size:7px;
+ color:white;
+ position:absolute;
+ margin-left: -16px;
+ margin-top: 10px;
+ width: 17px;
+ overflow: hidden;
+ height: 10px;
+}
+#admin .icon .ext em{
+ font-size:18px;
+ color:white;
+ position:absolute;
+ margin-left: 42px;
+ margin-top: -30px;
+ width: 45px;
+ overflow: hidden;
+ height: 23px;
+ text-align: left;
+}
+td.burn {background-image: url('../img/list/burn.png') !important;
+ background-position: center center !important;
+ background-repeat: no-repeat !important;
+ }
+td.locked,li.locked {background-image: url('../img/list/locked.png') !important;
+ background-position: center center !important;
+ background-repeat: no-repeat !important;
+ }
+
+/* extensions */
+
+.zip:before,.rar:before,.gz:before,.tgz:before {color:rgba(255,180,0,0.9)!important;}
+.zip em,.rar em,.gz em,.tgz em {color:rgba(0,0,0,0.5)!important;}
+
+.txt:before,.ini:before,.nfo:before, .css:before, .md:before {color:rgba(100,100,100,0.9)!important;}
+
+.doc:before,.odt:before,.odg:before,.xdoc:before {color:rgba(0,0,255,0.8)!important;}
+.pdf:before{color:rgba(200,0,0,0.8)!important;}
+.xls:before{color:rgba(130,130,130,0.8)!important;}
+.css:before{color:rgba(0,200,0,0.7)!important;}
+.js:before {color:rgba(0,100,250,0.5)!important;}
+.swf:before{color:rgba(100,0,100,0.5)!important;}
+.mp3:before{color:rgba(0,100,200,0.9)!important;}
+.ogg:before{color:rgba(0,150,200,0.9)!important;}
+.mp4:before,.flv:before, .avi:before, .mkv:before {color:rgba(150,0,20,0.9)!important;}
+.php:before, .sphp:before {color:rgba(150,0,150,0.9)!important;}
+.html:before,.htm:before,.shtml:before,.shtm:before {color:rgba(0,200,100,0.9)!important;}
+.exe:before,.bat:before,.iso:before,.bin:before{color:rgba(50,50,100,0.6)!important;}
+
+/*
+ * Vue en icones
+ */
+
+#admin .icon li {
+ width: 132px;
+ height: 132px;
+ overflow: hidden;
+ display: inline-block;
+ list-style: none;
+ font-size: 12px;
+ border-radius: 3px;
+ padding: 10px;
+ margin: 10px;
+ cursor: pointer;
+ word-spacing: word-wrap;
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+ z-index: 1;
+ text-align: center;
+ vertical-align: bottom;
+
+}
+
+#admin .icon li .buttons {
+ position: absolute;
+}
+
+#admin .icon li a {
+ display: block;
+ text-decoration: none;
+}
+
+#admin .icon li>em {
+ font-style: italic;
+ display: block;
+ margin-bottom: 5px;
+ margin-top: 5px;
+}
+
+#admin .icon li a em {
+ max-height: 30px;
+ font-style: normal;
+ margin-bottom: 3px;
+ display: block;
+}
+
+#admin .icon li a img {
+ width: 64px;
+ height: 64px;
+ display: block;
+ margin: auto;
+ border-radius: 2px;
+}
diff --git a/sources/templates/default/css/lock.css b/sources/templates/default/css/lock.css
new file mode 100644
index 0000000..a69967b
--- /dev/null
+++ b/sources/templates/default/css/lock.css
@@ -0,0 +1,27 @@
+/* Lock */
+#lock #message {
+ margin: 20px auto;
+ text-align: center;
+ width: calc(100% - 8px);
+}
+#lock #message img {display:block;margin:auto;}
+#lock form {
+ width: 400px;
+ margin: 0 auto;
+}
+
+#lock form input:not(#submit) {
+ width: 400px;
+ height: 35px;
+ text-indent: 7px;
+ margin-bottom: 7px;
+ color: #85888b;
+ border: 1px solid #d6ecfc;
+ border-radius: 5px;
+}
+
+#lock form #submit {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
\ No newline at end of file
diff --git a/sources/templates/default/css/login.css b/sources/templates/default/css/login.css
new file mode 100644
index 0000000..bf48222
--- /dev/null
+++ b/sources/templates/default/css/login.css
@@ -0,0 +1,53 @@
+/* Login */
+#login #form {
+ width: 400px;
+ margin: 0 auto;
+}
+
+#login #form .error,
+#login #form .success {
+ font-size: 0.8em;
+ margin-bottom: 2px;
+ word-wrap: break-word;
+}
+/*
+#login #form .error {
+ color: #e82110;
+}
+
+#login #form .success {
+ color: #87c540;
+}*/
+
+#login #form #user {
+ margin: 5px 0;
+}
+
+#login #form input:not(#submit) {
+ width: 400px;
+ height: 35px;
+ text-indent: 7px;
+ margin-bottom: 7px;
+ color: #85888b;
+ border: 1px solid #d6ecfc;
+ border-radius: 5px;
+}
+
+#login #form #cookie {
+ width: 20px !important; /* force, mauvaise interprétation de firefox avec :not(#submit) ci-dessus */
+ float: left;
+}
+
+#login #form label {
+ display: block;
+ width: 160px;
+ height: 42px;
+ line-height: 42px;
+ vertical-align: bottom;
+ font-size: 0.8em;
+ float: left;
+}
+
+#login #form #submit {
+ float: right;
+}
diff --git a/sources/templates/default/css/markdown.css b/sources/templates/default/css/markdown.css
new file mode 100644
index 0000000..4ae3f82
--- /dev/null
+++ b/sources/templates/default/css/markdown.css
@@ -0,0 +1,425 @@
+/*
+This document has been created with Marked.app , Copyright 2013 Brett Terpstra
+Content is property of the document author
+Please leave this notice in place, along with any additional credits below.
+---------------------------------------------------------------
+Title: GitHub
+Author: Brett Terpstra
+Description: Github README style. Includes theme for Pygmentized code blocks.
+*/
+html, .markdown {
+ color: black; }
+.markdown {padding:20px;margin:20px auto;max-width:1024px;border:1px solid #ddd;background:url(img/noise.png);}
+.markdown *:not('#mkdbuttons') {
+ margin: 0;
+ padding: 0; }
+
+.markdown #wrapper {
+ font: 15px helvetica,arial,freesans,clean,sans-serif;
+ -webkit-font-smoothing: antialiased;
+ line-height: 1.7;
+ padding: 3px;
+ background: #fff;
+ border-radius: 3px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px; }
+
+.markdown p {
+ margin: 1em 0; }
+
+.markdown a {
+ color: #4183c4;
+ text-decoration: none; }
+
+.markdown #wrapper {
+ background-color: #fff;
+ padding: 30px;
+ margin: 15px;
+ font-size: 15px;
+ line-height: 1.6; }
+ .markdown #wrapper > *:first-child {
+ margin-top: 0 !important; }
+ .markdown #wrapper > *:last-child {
+ margin-bottom: 0 !important; }
+
+@media screen {
+ .markdown #wrapper {
+ box-shadow: 0 0 0 1px #cacaca, 0 0 0 4px #eee; } }
+.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 {
+ font-weight: 700;
+ line-height: 1.7;
+ cursor: text;
+ position: relative;
+ margin: 1em 0 15px;
+ padding: 0; }
+.markdown i{font-style:italic;}
+.markdown b{font-weight:bold;}
+.markdown h1 {
+ font-size: 2.5em;
+ border-bottom: 1px solid #ddd; }
+
+.markdown h2 {
+ font-size: 2em;
+ border-bottom: 1px solid #eee; }
+
+.markdown h3 {
+ font-size: 1.5em; }
+
+.markdown h4 {
+ font-size: 1.2em; }
+
+.markdown h5 {
+ font-size: 1em; }
+
+.markdown h6 {
+ color: #777;
+ font-size: 1em; }
+
+.markdown p, .markdown blockquote, .markdown table, .markdown pre {
+ margin: 15px 0; }
+
+.markdown ul {
+ padding-left: 30px; }
+.markdown ul li {
+ list-style-type: disc!important; }
+
+.markdown ol {
+ padding-left: 30px; }
+ .markdown ol li ul:first-of-type {
+ margin-top: 0px; }
+
+.markdown hr {
+ background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENDRjNBN0E2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENDRjNBN0I2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0NGM0E3ODY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;
+ border: 0 none;
+ color: #ccc;
+ height: 4px;
+ margin: 15px 0;
+ padding: 0; }
+
+.markdown #wrapper > h2:first-child {
+ margin-top: 0;
+ padding-top: 0; }
+.markdown #wrapper > h1:first-child {
+ margin-top: 0;
+ padding-top: 0; }
+ #wrapper > h1:first-child + h2 {
+ margin-top: 0;
+ padding-top: 0; }
+.markdown #wrapper > h3:first-child, #wrapper > h4:first-child, #wrapper > h5:first-child, #wrapper > h6:first-child {
+ margin-top: 0;
+ padding-top: 0; }
+
+.markdown a:first-child h1, .markdown a:first-child h2, .markdown a:first-child h3, .markdown a:first-child h4, .markdown a:first-child h5, .markdown a:first-child h6 {
+ margin-top: 0;
+ padding-top: 0; }
+
+.markdown h1 + p, .markdown h2 + p, .markdown h3 + p, .markdown h4 + p, .markdown h5 + p, .markdown h6 + p, .markdown ul li > :first-child, .markdown ol li > :first-child {
+ margin-top: 0; }
+
+.markdown dl {
+ padding: 0; }
+ .markdown dl dt {
+ font-size: 14px;
+ font-weight: bold;
+ font-style: italic;
+ padding: 0;
+ margin: 15px 0 5px; }
+ .markdown dl dt:first-child {
+ padding: 0; }
+ .markdown dl dt > :first-child {
+ margin-top: 0; }
+ .markdown dl dt > :last-child {
+ margin-bottom: 0; }
+ .markdown dl dd {
+ margin: 0 0 15px;
+ padding: 0 15px; }
+ .markdown dl dd > :first-child {
+ margin-top: 0; }
+ .markdown dl dd > :last-child {
+ margin-bottom: 0; }
+
+.markdown blockquote {
+ border-left: 4px solid #DDD;
+ padding: 0 15px;
+ color: #777; }
+ .markdown blockquote > :first-child {
+ margin-top: 0; }
+ .markdown blockquote > :last-child {
+ margin-bottom: 0; }
+
+.markdown table {
+ border-collapse: collapse;
+ border-spacing: 0;
+ font-size: 100%;
+ font: inherit; }
+ .markdown table th {
+ font-weight: bold;
+ border: 1px solid #ccc;
+ padding: 6px 13px; }
+ .markdown table td {
+ border: 1px solid #ccc;
+ padding: 6px 13px; }
+ .markdown table tr {
+ border-top: 1px solid #ccc;
+ background-color: #fff; }
+ .markdown table tr:nth-child(2n) {
+ background-color: #f8f8f8; }
+
+.markdown img {
+ max-width: 100%; }
+
+.markdown code, .markdown tt {
+ margin: 0 2px;
+ padding: 0 5px;
+ white-space: nowrap;
+ border: 1px solid #eaeaea;
+ background-color: #f8f8f8;
+ border-radius: 3px;
+ font-family: Consolas, 'Liberation Mono', Courier, monospace;
+ font-size: 12px;
+ color: #333333; }
+
+.markdown pre > code {
+ margin: 0;
+ padding: 0;
+ white-space: pre;
+ border: none;
+ background: transparent; }
+
+.markdown .highlight pre {
+ background-color: #f8f8f8;
+ border: 1px solid #ccc;
+ font-size: 13px;
+ line-height: 19px;
+ overflow: auto;
+ padding: 6px 10px;
+ border-radius: 3px; }
+
+.markdown pre {
+ background-color: #f8f8f8;
+ border: 1px solid #ccc;
+ font-size: 14px;
+ line-height: 19px;
+ overflow: auto;
+ padding: 6px 10px;
+ border-radius: 3px;
+ margin: 26px 0; }
+ .markdown pre code, .markdown pre tt {
+ background-color: transparent;
+ border: none; }
+
+.markdown .poetry pre {
+ font-family: Georgia, Garamond, serif !important;
+ font-style: italic;
+ font-size: 110% !important;
+ line-height: 1.6em;
+ display: block;
+ margin-left: 1em; }
+ .markdown .poetry pre code {
+ font-family: Georgia, Garamond, serif !important;
+ word-break: break-all;
+ word-break: break-word;
+ /* Non standard for webkit */
+ -webkit-hyphens: auto;
+ -moz-hyphens: auto;
+ hyphens: auto;
+ white-space: pre-wrap; }
+
+.markdown sup, .markdown sub, .markdown a.footnote {
+ font-size: 1.4ex;
+ height: 0;
+ line-height: 1;
+ vertical-align: super;
+ position: relative; }
+
+.markdown sub {
+ vertical-align: sub;
+ top: -1px; }
+
+@media print {
+ .markdown {
+ background: #fff; }
+
+ .markdown img, .markdown pre, .markdown blockquote, .markdown table, .markdown figure {
+ page-break-inside: avoid; }
+
+ .markdown #wrapper {
+ background: #fff;
+ border: none; }
+
+ .markdown pre code {
+ overflow: visible; } }
+@media screen {
+ body.inverted {
+ color: #eee !important;
+ border-color: #555;
+ box-shadow: none; }
+
+ .inverted #wrapper, .inverted hr, .inverted p, .inverted td, .inverted li, .inverted h1, .inverted h2, .inverted h3, .inverted h4, .inverted h5, .inverted h6, .inverted th, .inverted .math, .inverted caption, .inverted dd, .inverted dt, .inverted blockquote {
+ color: #eee !important;
+ border-color: #555;
+ box-shadow: none; }
+ .inverted td, .inverted th {
+ background: #333; }
+ .inverted pre, .inverted code, .inverted tt {
+ background: #eeeeee !important;
+ color: #111; }
+ .inverted h2 {
+ border-color: #555555; }
+ .inverted hr {
+ border-color: #777;
+ border-width: 1px !important; }
+
+ .markdown ::selection {
+ background: rgba(157, 193, 200, 0.5); }
+
+ .markdown h1::selection {
+ background-color: rgba(45, 156, 208, 0.3); }
+
+ .markdown h2::selection {
+ background-color: rgba(90, 182, 224, 0.3); }
+
+ .markdown h3::selection, .markdown h4::selection, .markdown h5::selection, .markdown h6::selection, .markdown li::selection, .markdown ol::selection {
+ background-color: rgba(133, 201, 232, 0.3); }
+
+ .markdown code::selection {
+ background-color: rgba(0, 0, 0, 0.7);
+ color: #eeeeee; }
+ .markdown code span::selection {
+ background-color: rgba(0, 0, 0, 0.7) !important;
+ color: #eeeeee !important; }
+
+ .markdown a::selection {
+ background-color: rgba(255, 230, 102, 0.2); }
+
+ .inverted a::selection {
+ background-color: rgba(255, 230, 102, 0.6); }
+
+ .markdown td::selection, .markdown th::selection, .markdown caption::selection {
+ background-color: rgba(180, 237, 95, 0.5); }
+
+ .inverted {
+ background: #0b2531;
+ background: #252a2a; }
+ .inverted #wrapper {
+ background: #252a2a; }
+ .inverted a {
+ color: #acd1d5; } }
+.markdown .highlight .c {
+ color: #998;
+ font-style: italic; }
+.markdown .highlight .err {
+ color: #a61717;
+ background-color: #e3d2d2; }
+.markdown .highlight .k, .highlight .o {
+ font-weight: bold; }
+.markdown .highlight .cm {
+ color: #998;
+ font-style: italic; }
+.markdown .highlight .cp {
+ color: #999;
+ font-weight: bold; }
+.markdown .highlight .c1 {
+ color: #998;
+ font-style: italic; }
+.markdown .highlight .cs {
+ color: #999;
+ font-weight: bold;
+ font-style: italic; }
+.markdown .highlight .gd {
+ color: #000;
+ background-color: #fdd; }
+ .markdown .highlight .gd .x {
+ color: #000;
+ background-color: #faa; }
+.markdown .highlight .ge {
+ font-style: italic; }
+.markdown .highlight .gr {
+ color: #a00; }
+.markdown .highlight .gh {
+ color: #999; }
+.markdown .highlight .gi {
+ color: #000;
+ background-color: #dfd; }
+ .markdown .highlight .gi .x {
+ color: #000;
+ background-color: #afa; }
+.markdown .highlight .go {
+ color: #888; }
+.markdown .highlight .gp {
+ color: #555; }
+.markdown .highlight .gs {
+ font-weight: bold; }
+.markdown .highlight .gu {
+ color: #800080;
+ font-weight: bold; }
+.markdown .highlight .gt {
+ color: #a00; }
+.markdown .highlight .kc, .markdown .highlight .kd, .markdown .highlight .kn, .markdown .highlight .kp, .markdown .highlight .kr {
+ font-weight: bold; }
+.markdown .highlight .kt {
+ color: #458;
+ font-weight: bold; }
+.markdown .highlight .m {
+ color: #099; }
+.markdown .highlight .s {
+ color: #d14; }
+.markdown .highlight .na {
+ color: #008080; }
+.markdown .highlight .nb {
+ color: #0086B3; }
+.markdown .highlight .nc {
+ color: #458;
+ font-weight: bold; }
+.markdown .highlight .no {
+ color: #008080; }
+.markdown .highlight .ni {
+ color: #800080; }
+.markdown .highlight .ne, .highlight .nf {
+ color: #900;
+ font-weight: bold; }
+.markdown .highlight .nn {
+ color: #555; }
+.markdown .highlight .nt {
+ color: #000080; }
+.markdown .highlight .nv {
+ color: #008080; }
+.markdown .highlight .ow {
+ font-weight: bold; }
+.markdown .highlight .w {
+ color: #bbb; }
+.markdown .highlight .mf, .markdown .highlight .mh, .markdown .highlight .mi, .markdown .highlight .mo {
+ color: #099; }
+.markdown .highlight .sb, .markdown .highlight .sc, .markdown .highlight .sd, .markdown .highlight .s2, .markdown .highlight .se, .markdown .highlight .sh, .markdown .highlight .si, .markdown .highlight .sx {
+ color: #d14; }
+.markdown .highlight .sr {
+ color: #009926; }
+.markdown .highlight .s1 {
+ color: #d14; }
+.markdown .highlight .ss {
+ color: #990073; }
+.markdown .highlight .bp {
+ color: #999; }
+.markdown .highlight .vc, .highlight .vg, .highlight .vi {
+ color: #008080; }
+.markdown .highlight .il {
+ color: #099; }
+.markdown .highlight .gc {
+ color: #999;
+ background-color: #EAF2F5; }
+
+.markdown .type-csharp .highlight .k, .markdown .type-csharp .highlight .kt {
+ color: #00F; }
+.markdown .type-csharp .highlight .nf {
+ color: #000;
+ font-weight: normal; }
+.markdown .type-csharp .highlight .nc {
+ color: #2B91AF; }
+.markdown .type-csharp .highlight .nn {
+ color: #000; }
+.markdown .type-csharp .highlight .s, .type-csharp .highlight .sc {
+ color: #A31515; }
+
+body.dark #wrapper {
+ background: transparent !important;
+ box-shadow: none !important; }
diff --git a/sources/templates/default/css/mobile.css b/sources/templates/default/css/mobile.css
new file mode 100644
index 0000000..74da945
--- /dev/null
+++ b/sources/templates/default/css/mobile.css
@@ -0,0 +1,55 @@
+/* Mobile */
+@media screen and (max-width:480px) {
+ /* Ini */
+ #submit {
+ width: 130px;
+ }
+
+ /* Header */
+ #search {
+ float: left;
+ margin-left: 2px;
+ }
+
+ #search input[type=text]:hover,
+ #search input[type=text]:focus {
+ width: 150px;
+ }
+
+ /* Login */
+ #login #form {
+ width: 300px;
+ }
+
+ #login #form input:not(#submit) {
+ width: 300px;
+ }
+
+ #login #form label {
+ width: 130px;
+ }
+
+ #login #form #cookie {
+ margin-top: 12px;
+ display: inline-block !important;
+ width: 20px !important;
+ height: 20px;
+ height: 20px !important;
+ }
+
+ /* Stats */
+ #stats table th.ip,
+ #stats table td.ip,
+ #stats table th.origin,
+ #stats table td.origin,
+ #stats table th.host,
+ #stats table td.host {
+ display: none;
+ }
+
+ /* Dialog */
+ div.dialog figure .closemsg,
+ div.dialog figure figcaption {
+ width: 280px;
+ }
+}
diff --git a/sources/templates/default/css/music_player.css b/sources/templates/default/css/music_player.css
new file mode 100644
index 0000000..db95768
--- /dev/null
+++ b/sources/templates/default/css/music_player.css
@@ -0,0 +1,205 @@
+/* music player */
+ .audiojs audio {
+ position: absolute;
+ left: -1px;
+ }
+ .audiojs {
+ cursor:default;
+ width: 100%;
+ height: 36px;
+ /*background-color:#405bff;border-color:#05E;box-shadow: 0 1px 1px #04d;*/
+ overflow: hidden;
+ border-top:1px solid rgba(0,0,0,0.2);
+ border-bottom:1px solid rgba(0,0,0,0.2);
+ font-family: monospace;
+ font-size: 12px;
+ margin-bottom:20px;
+ display: inline-flex;
+ x-justify-content: space-around;
+ x-align-items: stretch;
+ }
+ .audiojs .play-pause:hover {background-color:rgba(0,100,255,0.2);}
+ .audiojs .play-pause {
+ flex: 0 0 40px;
+ width: 40px;
+ height: 40px;
+ padding: 4px 6px;
+ margin: 0px;
+
+ overflow: hidden;
+ cursor:pointer;
+ background-color:rgba(0,0,0,0.1);
+ }
+ .audiojs p {
+ display: none;
+ width: 25px;
+ height: 40px;
+ margin: 0px;
+ cursor: pointer;
+ }
+ .audiojs .play {
+ display: block;
+ }
+ .audiojs .scrubber {
+ cursor:pointer;
+ position: relative;
+ width:100%;
+ background: rgba(0,0,0,0.1);
+ height: 14px;
+ margin: 10px;
+ border-top: 1px solid rgba(0,0,0,0.3);
+ border-left: 0px;
+ border-bottom: 0px;
+ overflow: hidden;
+ border-radius:3px;
+ }
+ .audiojs .progress {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ height: 13px;
+ width: 0px;
+ background: rgba(0,0,0,0.1);
+ border-radius: 0 4px 4px 0;
+ box-shadow:inset 0 0 2px 2px rgba(255,255,255,0.1);
+ z-index: 1;
+
+ }
+ .audiojs .loaded {
+ position: absolute;border-radius: 0 4px 4px 0;
+ top: 0px;
+ left: 0px;
+ height: 13px;
+ width: 0px;
+ background: rgba(0,0,0,0.1);box-shadow:inset 0 0 2px 2px rgba(255,255,255,0.1);
+
+ }
+ .audiojs .time {
+ text-shadow:0 1px 1px rgba(255,255,255,0.5);
+ width:100px;
+ flex: 0 0 100px;
+ height: 36px;
+ line-height: 36px;
+ margin: 0px 0px 0px 6px;
+ padding: 0px 6px 0px 12px;
+ color: #333;
+ }
+ .audiojs .time em {
+ padding: 0px 2px 0px 0px;
+ color: #444;
+ font-style: normal;
+ }
+ .audiojs .time strong {
+ padding: 0px 0px 0px 2px;
+ font-weight: normal;
+ }
+ .audiojs .error-message {
+ float: left;
+ display: none;
+ margin: 0px 10px;
+ height: 36px;
+ width: 400px;
+ overflow: hidden;
+ line-height: 36px;
+ white-space: nowrap;
+ color: #fff;
+ text-overflow: ellipsis;
+ -o-text-overflow: ellipsis;
+ -icab-text-overflow: ellipsis;
+ -khtml-text-overflow: ellipsis;
+ -moz-text-overflow: ellipsis;
+ -webkit-text-overflow: ellipsis;
+ }
+ .audiojs .error-message a {
+ color: #eee;
+ text-decoration: none;
+ padding-bottom: 1px;
+ border-bottom: 1px solid #999;
+ white-space: wrap;
+ }
+ .audiojs .play {
+ background: url("../img/player-graphics.png") -2px -1px no-repeat ;
+ }
+ .audiojs .loading {
+ background: url("../img/player-graphics.png") -2px -31px no-repeat;
+ }
+ .audiojs .error {
+ background: url("../img/player-graphics.png") -2px -61px no-repeat;
+ }
+ .audiojs .pause {
+ background: url("../img/player-graphics.png") -2px -91px no-repeat;
+ }
+ .playing .play,
+ .playing .loading,
+ .playing .error {
+ display: none;
+ background-color:rgba(0,0,0,0.1);
+ }
+ .playing .pause {
+ display: block;
+ }
+ .loading .play,
+ .loading .pause,
+ .loading .error {
+ display: none;
+ }
+ .loading .loading {
+ display: block;
+ }
+ .error .time,
+ .error .play,
+ .error .pause,
+ .error .scrubber,
+ .error .loading {
+ display: none;
+ }
+ .error .error {
+ display: block;
+ }
+ .error .play-pause p {
+ cursor: auto;
+ }
+ .error .error-message {
+ display: block;
+ }
+#share section.music_player{padding:10px;display:block;}
+.music_player a {
+ display:block;
+ padding:5px;
+ margin-bottom:5px;
+ margin-top:5px;
+ border-bottom:1px solid rgba(0,0,0,0.1);
+ text-shadow:0 1px 1px rgba(255,255,255,0.5);
+}
+.music_player .audiojs {}
+
+.music_player .audiojs p{margin:0;}
+
+.music_player a.playing{color:white;text-shadow:0 1px 1px rgba(0,0,0,0.3);background-color:rgba(0,0,0,0.4);border-radius:3px;padding:10px;}
+.music_player a.playing:hover{color:#cef;}
+
+.music_player table {border-collapse: collapse;}
+.music_player table td:first-of-type{width:100%;vertical-align: middle;}
+.music_player table td:last-of-type{width:40px;}
+.music_player #volume{
+ padding:3px;
+
+ background:rgba(0,0,0,0.2);
+ display:inline-block;
+ text-align:center;
+ border-top:1px solid rgba(0,0,0,0.1);
+ border-bottom:1px solid rgba(0,0,0,0.1);
+}
+.music_player .volume:hover{background-image:url(../img/barw.png);}
+.music_player .volume{
+ border-radius: 1px 1px 0 0;
+ vertical-align:bottom;
+ display:inline-block;
+ width:3px;
+ height:30px;
+ background:url(../img/barb.png) no-repeat rgba(255,255,255,0.1);
+ cursor: pointer;
+
+}
+.music_player .volume.active{ background:url(../img/barw.png) no-repeat transparent;}
+.music_player a:hover{ color:rgba(0,0,0,0.5);}
diff --git a/sources/templates/default/css/pen.css b/sources/templates/default/css/pen.css
new file mode 100644
index 0000000..77a91aa
--- /dev/null
+++ b/sources/templates/default/css/pen.css
@@ -0,0 +1,175 @@
+/*! Licensed under MIT, https://github.com/sofish/pen */
+
+/* basic reset */
+.pen, .pen-menu, .pen-input, .pen textarea{font:400 1.16em/1.45 Palatino, Optima, Georgia, serif;color:#331;}
+.pen:focus{outline:none;}
+.pen fieldset, img {border: 0;}
+.pen blockquote{padding-left:10px;margin-left:-14px;border-left:4px solid #1abf89;}
+.pen a{color:#1abf89;}
+.pen del{text-decoration:line-through;}
+.pen sub, .pen sup {font-size:75%;position:relative;vertical-align:text-top;}
+:root .pen sub, :root .pen sup{vertical-align:baseline; /* for ie9 and other mordern browsers */}
+.pen sup {top:-0.5em;}
+.pen sub {bottom:-0.25em;}
+.pen hr{border:none;border-bottom:1px solid #cfcfcf;margin-bottom:25px;*color:pink;*filter:chroma(color=pink);height:10px;*margin:-7px 0 15px;}
+.pen small{font-size:0.8em;color:#888;}
+.pen em, .pen b, .pen strong{font-weight:700;}
+.pen pre{white-space:pre-wrap;padding:0.85em;background:#f8f8f8;}
+
+/* block-level element margin */
+.pen p, .pen pre, .pen ul, .pen ol, .pen dl, .pen form, .pen table, .pen blockquote{margin-bottom:16px;}
+
+/* headers */
+.pen h1, .pen h2, .pen h3, .pen h4, .pen h5, .pen h6{margin-bottom:16px;font-weight:700;line-height:1.2;}
+.pen h1{font-size:2em;}
+.pen h2{font-size:1.8em;}
+.pen h3{font-size:1.6em;}
+.pen h4{font-size:1.4em;}
+.pen h5, .pen h6{font-size:1.2em;}
+
+/* list */
+.pen ul, .pen ol{margin-left:1.2em;}
+.pen ul, .pen-ul{list-style:disc;}
+.pen ol, .pen-ol{list-style:decimal;}
+.pen li ul, .pen li ol, .pen-ul ul, .pen-ul ol, .pen-ol ul, .pen-ol ol{margin:0 2em 0 1.2em;}
+.pen li ul, .pen-ul ul, .pen-ol ul{list-style: circle;}
+
+/* pen menu */
+.pen-menu [class^="icon-"], .pen-menu [class*=" icon-"] { /* reset to avoid conflicts with Bootstrap */
+ background: transparent;
+ background-image: none;
+}
+.pen-menu { min-width: 320px; }
+.pen-menu, .pen-input{font-size:14px;line-height:1;}
+.pen-menu{white-space:nowrap;box-shadow:1px 2px 3px -2px #222;background:#333;background-image:linear-gradient(to bottom, #222, #333);opacity:0.9;position:fixed;height:36px;border:1px solid #333;border-radius:3px;display:none;z-index:1000;}
+.pen-menu:after {top:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none;}
+.pen-menu:after {border-color:rgba(51, 51, 51, 0);border-top-color:#333;border-width:6px;left:50%;margin-left:-6px;}
+.pen-menu-below:after {top: -11px; display:block; -moz-transform: rotate(180deg); -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg);}
+.pen-icon{font:normal 900 16px/40px Georgia serif;min-width:20px;display:inline-block;padding:0 10px;height:36px;overflow:hidden;color:#fff;text-align:center;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}
+.pen-icon:first-of-type{border-top-left-radius:3px;border-bottom-left-radius:3px;}
+.pen-icon:last-of-type{border-top-right-radius:3px;border-bottom-right-radius:3px;}
+.pen-icon:hover{background:#000;}
+.pen-icon.active{color:#1abf89;background:#000;box-shadow:inset 2px 2px 4px #000;}
+.pen-input{position:absolute;width:100%;left:0;top:0;height:36px;line-height:20px;background:#333;color:#fff;border:none;text-align:center;display:none;font-family:arial, sans-serif;}
+.pen-input:focus{outline:none;}
+
+.pen-textarea{display:block;background:#f8f8f8;padding:20px;}
+.pen textarea{font-size:14px;border:none;background:none;width:100%;_height:200px;min-height:200px;resize:none;}
+
+@font-face {
+ font-family: 'pen';
+ src: url('font/fontello.eot?370dad08');
+ src: url('font/fontello.eot?370dad08#iefix') format('embedded-opentype'),
+ url('font/fontello.woff?370dad08') format('woff'),
+ url('font/fontello.ttf?370dad08') format('truetype'),
+ url('font/fontello.svg?370dad08#fontello') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+
+.pen-menu [class^="icon-"]:before, .pen-menu [class*=" icon-"]:before {
+ font-family: "pen";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+ display: inline-block;
+ text-decoration: inherit;
+ width: 1em;
+ margin-right: .2em;
+ text-align: center;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1em;
+ margin-left: .2em;
+}
+.pen-menu .icon-location:before { content: '\e815'; } /* '' */
+.pen-menu .icon-fit:before { content: '\e80f'; } /* '' */
+.pen-menu .icon-bold:before { content: '\e805'; } /* '' */
+.pen-menu .icon-italic:before { content: '\e806'; } /* '' */
+.pen-menu .icon-justifyleft:before { content: '\e80a'; } /* '' */
+.pen-menu .icon-justifycenter:before { content: '\e80b'; } /* '' */
+.pen-menu .icon-justifyright:before { content: '\e80c'; } /* '' */
+.pen-menu .icon-justifyfull:before { content: '\e80d'; } /* '' */
+.pen-menu .icon-outdent:before { content: '\e800'; } /* '' */
+.pen-menu .icon-indent:before { content: '\e801'; } /* '' */
+.pen-menu .icon-mode:before { content: '\e813'; } /* '' */
+.pen-menu .icon-fullscreen:before { content: '\e80e'; } /* '' */
+.pen-menu .icon-insertunorderedlist:before { content: '\e802'; } /* '' */
+.pen-menu .icon-insertorderedlist:before { content: '\e803'; } /* '' */
+.pen-menu .icon-strikethrough:before { content: '\e807'; } /* '' */
+.pen-menu .icon-underline:before { content: '\e804'; } /* '' */
+.pen-menu .icon-blockquote:before { content: '\e814'; } /* '' */
+.pen-menu .icon-undo:before { content: '\e817'; } /* '' */
+.pen-menu .icon-code:before { content: '\e816'; } /* '' */
+.pen-menu .icon-pre:before { content: '\e816'; } /* '' */
+.pen-menu .icon-unlink:before { content: '\e811'; } /* '' */
+.pen-menu .icon-superscript:before { content: '\e808'; } /* '' */
+.pen-menu .icon-subscript:before { content: '\e809'; } /* '' */
+.pen-menu .icon-inserthorizontalrule:before { content: '\e818'; } /* '' */
+.pen-menu .icon-pin:before { content: '\e812'; } /* '' */
+.pen-menu .icon-createlink:before { content: '\e810'; } /* '' */
+.pen-menu .icon-h1:before { content: 'H1'; }
+.pen-menu .icon-h2:before { content: 'H2'; }
+.pen-menu .icon-h3:before { content: 'H3'; }
+.pen-menu .icon-h4:before { content: 'H4'; }
+.pen-menu .icon-h5:before { content: 'H5'; }
+.pen-menu .icon-h6:before { content: 'H6'; }
+.pen-menu .icon-p:before { content: 'P'; }
+.pen-menu .icon-insertimage:before { width:1.8em;margin:0;position:relative;top:-2px;content:'IMG';font-size:12px;border:1px solid #fff;padding:2px;border-radius:2px; }
+.pen {
+ position: relative;
+}
+.pen.hinted h1:before,
+.pen.hinted h2:before,
+.pen.hinted h3:before,
+.pen.hinted h4:before,
+.pen.hinted h5:before,
+.pen.hinted h6:before,
+.pen.hinted blockquote:before,
+.pen.hinted hr:before {
+ color: #eee;
+ position: absolute;
+ right: 100%;
+ white-space: nowrap;
+ padding-right: 10px;
+}
+.pen.hinted blockquote { border-left: 0; margin-left: 0; padding-left: 0; }
+.pen.hinted blockquote:before {
+ color: #1abf89;
+ content: ">";
+ font-weight: bold;
+ vertical-align: center;
+}
+.pen.hinted h1:before { content: "#";}
+.pen.hinted h2:before { content: "##";}
+.pen.hinted h3:before { content: "###";}
+.pen.hinted h4:before { content: "####";}
+.pen.hinted h5:before { content: "#####";}
+.pen.hinted h6:before { content: "######";}
+.pen.hinted hr:before { content: "﹘﹘﹘"; line-height: 1.2; vertical-align: bottom; }
+
+.pen.hinted pre:before, .pen.hinted pre:after {
+ content: "```";
+ display: block;
+ color: #ccc;
+}
+
+.pen.hinted ul { list-style: none; }
+.pen.hinted ul li:before {
+ content: "*";
+ color: #999;
+ line-height: 1;
+ vertical-align: bottom;
+ margin-left: -1.2em;
+ display: inline-block;
+ width: 1.2em;
+}
+
+.pen.hinted b:before, .pen.hinted b:after { content: "**"; color: #eee; font-weight: normal; }
+.pen.hinted i:before, .pen.hinted i:after { content: "*"; color: #eee; }
+
+.pen.hinted a { text-decoration: none; }
+.pen.hinted a:before {content: "["; color: #ddd; }
+.pen.hinted a:after { content: "](" attr(href) ")"; color: #ddd; }
+
+.pen-placeholder:after { position: absolute; top: 0; left: 0; content: attr(data-placeholder); color: #999; cursor: text; }
diff --git a/sources/templates/default/css/share.css b/sources/templates/default/css/share.css
new file mode 100644
index 0000000..98868c0
--- /dev/null
+++ b/sources/templates/default/css/share.css
@@ -0,0 +1,51 @@
+#share {text-align: center;}
+#share section.tree{margin-bottom:50px;}
+#share section{
+ font-size:1.3em;
+ display:inline-block;
+ padding:20px;
+ text-align:left;
+}
+#share section ul{margin-left:20px;}
+#share section li{
+ cursor:pointer;list-style-type: none;
+ padding-left:30px;
+ background-size: contain;
+ background-position: 2px center;
+ background-repeat: no-repeat;
+}
+#share section li a:hover{color:#hover_color_dark;}
+
+
+#share .folder:after{
+ content:"▸";
+ padding-left:5px;
+}
+#share .folder.unfolded:after{
+ content:"▾";
+
+}
+#share .folder{
+ padding-top:3px;
+ padding-bottom:3px;
+ color:rgba(0,0,0,0.5);
+ text-shadow:0 0 1px rgba(0,0,0,0.2);
+}
+#share .icon-file em{
+ font-size:8px;
+ color:white;
+ position:absolute;
+ margin-left: -15px;
+ margin-top: 10px;
+}
+#share .folder_content{
+ padding-left:5px;
+ border-left:1px solid rgba(0,0,0,0.1);
+ display: none;
+ margin-left: 40px;
+}
+#share .folder_content.show{
+
+ display:block;
+ transition:all 300ms;
+}
diff --git a/sources/templates/default/css/stats.css b/sources/templates/default/css/stats.css
new file mode 100644
index 0000000..7a242cb
--- /dev/null
+++ b/sources/templates/default/css/stats.css
@@ -0,0 +1,77 @@
+/* Stats */
+#stats a {
+ color: #3e58f7;
+}
+
+#stats a:hover {
+ text-decoration: underline;
+}
+
+#stats h1 {
+ margin-bottom: 10px;
+}
+
+#stats .pagination {
+ text-align: center;
+ padding: 10px 0;
+}
+
+#stats table {
+ border-spacing: 0;
+ border-collapse: collapse;
+ margin: 0 auto;
+ width: calc(100% - 8px);
+ table-layout: fixed;
+ background: #ddd;
+ box-shadow: inset 0 0 3px rgba(0,0,0,0.35);
+}
+
+#stats table thead th {
+ background: #bbb;
+ padding: 10px;
+ cursor: pointer;
+ border-bottom: 1px solid #aaa;
+}
+
+#stats table thead th,
+#stats table td {
+ text-align: center;
+ vertical-align: middle;
+}
+
+#stats table th.date,
+#stats table td.date,
+#stats table th.owner,
+#stats table td.owner,
+#stats table th.ip,
+#stats table td.ip,
+#stats table th.host,
+#stats table td.host {
+ width: 160px;
+}
+
+#stats table tr:nth-child(odd) {
+ background: #ccc;
+}
+
+#stats table td {
+ overflow: hidden;
+ word-wrap: break-word;
+}
+#stats .origin{padding:5px;}
+#stats #trash,
+#stats #feeds {
+ text-align: center;
+}
+
+#stats #trash a {
+ height: 25px;
+ line-height: 25px;
+ vertical-align: middle;
+ padding-left: 20px;
+}
+
+#stats #message {
+ padding: 40px 0;
+ text-align: center;
+}
diff --git a/sources/templates/default/css/style.php b/sources/templates/default/css/style.php
new file mode 100644
index 0000000..7793ede
--- /dev/null
+++ b/sources/templates/default/css/style.php
@@ -0,0 +1,90 @@
+
+ */
+
+
+
+/*
+* this version detects css files and allow very basic replacements (bronco@warriordudimanche.net)
+*/
+# replacement rules: "String to replace" => "Replacement"
+# You can change the colors here !
+$replace=array(
+ '#basic_color_neutral'=>'#456',
+ '#basic_color_dark'=>'#345',
+ '#basic_color_superdark'=>'#123',
+ '#basic_color_light'=>'#678',
+ '#hover_color_light'=>'#DEF',
+ '#hover_color_neutral'=>'#789',
+ '#hover_color_dark'=>'#234',
+ '#hover_color_superdark'=>'#123',
+
+);
+
+
+# function
+if (!function_exists('_glob')){
+ function _glob($path,$pattern='') {
+ # glob function fallback by Cyril MAGUIRE (thx bro' ;-)
+ if($path=='/'){
+ $path='';
+ }
+ $liste = array();
+ $pattern=str_replace('*','',$pattern);
+ if ($handle = opendir($path)) {
+ while (false !== ($file = readdir($handle))) {
+ if(stripos($file, $pattern)!==false || $pattern=='' && $file!='.' && $file!='..' && $file!='.htaccess') {
+ $liste[] = $path.$file;
+ }
+ }
+ closedir($handle);
+ }
+ natcasesort($liste);
+ return $liste;
+
+ }
+
+}
+$cssFiles = _glob('./','css');
+
+/**
+ * Ideally, you wouldn't need to change any code beyond this point.
+ */
+$buffer = "";
+foreach ($cssFiles as $cssFile) {
+ $buffer .= file_get_contents($cssFile);
+}
+
+$buffer=str_replace(array_keys($replace),array_values($replace),$buffer);
+// Remove unnecessary characters
+$buffer = preg_replace("|/\*[^*]*\*+([^/][^*]*\*+)*/|", "", $buffer);
+$buffer = preg_replace("/[\s]*([\:\{\}\;\,])[\s]*/", "$1", $buffer);
+
+// Remove whitespace
+$buffer = str_replace(array("\r\n", "\r", "\n"), '', $buffer);
+
+// Enable GZip encoding.
+ob_start("ob_gzhandler");
+
+// Enable caching
+header('Cache-Control: public');
+
+// Expire in one day
+header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT');
+
+// Set the correct MIME type, because Apache won't set it for us
+header("Content-type: text/css");
+
+// Write everything out
+echo($buffer);
+?>
diff --git a/sources/templates/default/css/users_page.css b/sources/templates/default/css/users_page.css
new file mode 100644
index 0000000..a6b347f
--- /dev/null
+++ b/sources/templates/default/css/users_page.css
@@ -0,0 +1,124 @@
+#users_page table{width:100%;border-collapse: collapse}
+#users_page td{vertical-align: top;width:50%;padding:10px;}
+#editor_page .dialog, #users_page .dialog{display:block;position:relative;width:100%;}
+#users_page .dialog td{width:auto;vertical-align: middle;padding-left:0;font-size:1.4em;}
+#users_page .dialog tr{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid rgba(0,0,0,0.1);vertical-align: middle;}
+#users_page .dialog figcaption{width:100%;max-width:600px;}
+#editor_page .dialog figure,#users_page .dialog figure{width:100%;display:block;}
+#editor_page .dialog h2,#users_page .dialog h2{padding:15px;}
+#editor_page .dialog label,#users_page .dialog label{cursor:pointer;word-break: break-all;padding:0;}
+#users_page .dialog .folder_size_users_list li {vertical-align: middle}
+#users_page .dialog .admin{color:rgba(100,0,0,0.8);}
+#users_page .dialog .user{color:rgba(0,0,0,0.6);}
+#users_page .dialog .guest{color:rgba(0,100,0,0.6);}
+#users_page label span{padding:3px;}
+#users_page label span em{color:rgba(0,0,0,0.5);}
+#users_page select{font-size:1em;}
+#users_page input[type=number]:focus{background-color:rgba(255,255,255,0.9);color:rgba(0,0,0,0.9);}
+#users_page input[type=number]:focus{background-color:rgba(255,255,255,0.9);color:rgba(0,0,0,0.9);}
+#users_page input[type=number]{
+
+ text-indent: 7px;
+ width:100%;
+ margin-bottom: 3px;
+ margin-top: 3px;
+ color: rgba(0,0,0,0.4);
+ font-size:1.2em;
+ background:rgba(255,255,255,0.5);
+ border: 1px solid rgba(0,0,0,0.1);
+ border-radius: 5px;
+}
+
+#editor_page .hidden, #users_page .hidden{
+ max-height:0;
+ opacity:0;
+ border:none;
+ overflow:hidden;
+ transition:all 300ms;
+}
+#editor_page .tab_space .dialog, #users_page .tab_space .dialog{
+ transition:all 300ms;
+ top: auto;
+}
+#editor_page .tabs .btn, #users_page .tabs .btn{
+ margin:0;border:0;
+ padding:10px;
+ border-radius:3px 3px 0 0;
+ box-shadow: inset 0 -1px 3px rgba(0,0,0,0.5);
+ border:1px solid rgba(0,0,0,0.1);
+ border-bottom:none;
+}
+#editor_page .btn.active, #users_page .btn.active{
+ background:rgba(0,0,0,0.1);
+ color:#basic_color_dark;
+ box-shadow:none;
+}
+#editor_page .tab_space .tabs, #users_page .tab_space .tabs{}
+#users_page .tab_space{
+ width:100%;
+ margin:5px auto;
+ max-width:600px;
+}
+#editor_page .tab_space .dialog h2, #users_page .tab_space .dialog h2{
+ color:rgba(0,0,0,0.5);
+}
+#editor_page .tab_space .tab_space .dialog h1, #users_page .tab_space .dialog h1{
+ background:transparent;
+ text-align: left;
+ font-size:16px;
+ color:#basic_color_dark;
+ font-weight: normal;
+ text-shadow: none;
+}
+#editor_page .tab_space .dialog figure figcaption, #users_page .tab_space .dialog figure figcaption{
+ background-image:none;
+ background:rgba(0,0,0,0.1);
+ box-shadow: none;
+ border:none;
+ border-radius:0 3px 3px 3px;
+ border-left:1px solid rgba(0,0,0,0.1);
+ border-right:1px solid rgba(0,0,0,0.1);
+ border-bottom:1px solid rgba(0,0,0,0.1);
+ border-top:none;
+ overflow: hidden;
+}
+
+
+/* Users List */
+#userslist p {
+ width: calc(100% - 8px);
+ text-align: center;
+}
+
+#userslist ul {
+ width: 312px;
+ margin: 15px auto 0 auto;
+}
+
+#userslist ul li {
+ display: block;
+}
+
+#userslist ul li input,
+#userslist ul li span {
+ display: block;
+ float: left;
+}
+
+#userslist ul li span {
+ width: calc(100% - 20px);
+ word-wrap: break-word;
+}
+
+#userslist .clear {
+ padding-top: 15px;
+}
+
+#userslist #submit {
+ display: block;
+ margin: 15px auto 0 auto;
+}
+
+#users_page .tab_space .users_pass_list .npt{
+ width:100%;margin:0;
+}
\ No newline at end of file
diff --git a/sources/templates/default/css/userslist.css b/sources/templates/default/css/userslist.css
new file mode 100644
index 0000000..357abec
--- /dev/null
+++ b/sources/templates/default/css/userslist.css
@@ -0,0 +1,34 @@
+/* Users List */
+#userslist p {
+ width: calc(100% - 8px);
+ text-align: center;
+}
+
+#userslist ul {
+ width: 312px;
+ margin: 15px auto 0 auto;
+}
+
+#userslist ul li {
+ display: block;
+}
+
+#userslist ul li input,
+#userslist ul li span {
+ display: block;
+ float: left;
+}
+
+#userslist ul li span {
+ width: calc(100% - 20px);
+ word-wrap: break-word;
+}
+
+#userslist .clear {
+ padding-top: 15px;
+}
+
+#userslist #submit {
+ display: block;
+ margin: 15px auto 0 auto;
+}
diff --git a/sources/templates/default/edit_profiles.php b/sources/templates/default/edit_profiles.php
new file mode 100644
index 0000000..eb91118
--- /dev/null
+++ b/sources/templates/default/edit_profiles.php
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/templates/default/editor.php b/sources/templates/default/editor.php
new file mode 100644
index 0000000..adf574f
--- /dev/null
+++ b/sources/templates/default/editor.php
@@ -0,0 +1,77 @@
+';}else{$overwrite='';}
+?>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sources/templates/default/favicon.png b/sources/templates/default/favicon.png
new file mode 100644
index 0000000..cbb1368
Binary files /dev/null and b/sources/templates/default/favicon.png differ
diff --git a/sources/templates/default/footer.php b/sources/templates/default/footer.php
new file mode 100644
index 0000000..edd4e5e
--- /dev/null
+++ b/sources/templates/default/footer.php
@@ -0,0 +1,23 @@
+
+
+
+
+
+