From 98181502a6eca56db6dc28a00ec6a1e60deffeee Mon Sep 17 00:00:00 2001 From: orynider Date: Thu, 7 Nov 2019 00:47:06 +0200 Subject: [PATCH] changing language format to urf-8; adding romanian. --- AutoIndex.conf.php | 4 +- Readme.htm | 482 +++++++++++++++++++++++++++++++++++++++++++ classes/DirItem.php | 34 ++- classes/Language.php | 11 +- description_file | 1 + hidden_files | 3 +- languages/index.htm | 10 + languages/ro.txt | 93 +++++++++ languages/ro_RO.txt | 93 +++++++++ 9 files changed, 717 insertions(+), 14 deletions(-) create mode 100644 Readme.htm create mode 100644 description_file create mode 100644 languages/index.htm create mode 100644 languages/ro.txt create mode 100644 languages/ro_RO.txt diff --git a/AutoIndex.conf.php b/AutoIndex.conf.php index c921e39..40b4003 100644 --- a/AutoIndex.conf.php +++ b/AutoIndex.conf.php @@ -6,9 +6,9 @@ base_dir ./ icon_path index_icons/winvista/ flag_path flags/language/ language en -template ./templates/SwiftBlue/ +template ./templates/default/ log_file access.log -description_file meta.inc +description_file description_file user_list .htpasswd.autoindex download_count false hidden_files hidden_files diff --git a/Readme.htm b/Readme.htm new file mode 100644 index 0000000..18bfb52 --- /dev/null +++ b/Readme.htm @@ -0,0 +1,482 @@ + + + + + + + + + +AutoIndex PHP Script: Readme + + + + + +
+ +

+ AutoIndex PHP Script (version 1.5.4) - Help File +
by Justin Hagstrom
+
AutoIndex is provided under the terms of + the GNU General Public License (GPL). +

+

+ http://autoindex.sourceforge.net/ +
Please post any questions or comments in the + forum. +

+

+ To install and run the script, simply upload the contents of this + directory to a server with PHP support (Works with all versions of + PHP4 and PHP5). + +
Then, point your browser to the index.php file in that folder. The + first time you do this, it will take you to a configuration page. + +
To use all the default values, just click the button at the bottom, + or customize it however you want. + +
Information about the use of each variable is in this file. +

+

+   +

+ +
+ +

+   +

+

+ base_dir is the folder that will be the root of the directory listing. +
This will be the starting point for the script. Nothing above this directory can be viewed, but its subfolders can. +
Make sure to use forward slashes, rather than backslashes. Also, try to use a relative path if possible. +
Examples: +

+ + + + + + + + + + + + + +
./(the folder index.php is in)
./some folder/(path relative to the php file)
/home/user/public_html/some_folder/(absolute path)
+

+ If you're using an absolute path, you'll need to set force_download to +TRUE (this is not recommended, though. It is better to use a path +relative to the php script). +

+

+   +

+

+ icon_path is the path to the icons. Don't put a slash at the end. +
Leave this blank to not show icons to the left of files and folders. +
Examples: +

+ + + + + + + + + +
index_icons/winxp(relative to the php file)
/index_icons/kde(absolute path, relative to the server root)
+

+   +

+

+ stylesheet is the path and filename of your css stylesheet. +
Just modify the one that came with this, so it will match the rest of your site.
+ Examples: +

+ + + + + + + + + +
stylesheet.css(stylesheet.css is in the same folder as the php file)
/some_folder/some_stylesheet.css(absolute path to the stylesheet)
+

+   +

+ +
+ +

+ Optional Variables : +

+

+   +

+

+ If allow_uploads is set to TRUE, people will be able to upload files to your website. (Default: FALSE) +
But if use_login_system is also set to TRUE, you must create an account for them before they can upload. +
The preset users are: +

+ username: admin +
password: admin +
  +
username: test +
password: test +

+
If you plan to use the login system, change the passwords or create different accounts and delete these! +
All registered users will be able to upload, but only admins can create/delete accounts. +
Also, if you want to allow uploads, make sure the folders you want to upload to are chmod'ed to allow PHP to write there. +

+

+   +

+

+ user_list contains the path to the text file where the usernames and encrypted passwords are stored. +
Make sure the file is chmod'ed so PHP can read and write to it. +
(This is only needed if use_login_system is set to TRUE.) +

+

+   +

+

+ If allow_file_overwrites is set to TRUE, when uploading a file that already exists, the file will be replaced. (Default: FALSE) +
In other words, this will allow people to overwrite existing files by uploading new ones. +
This variable only matters when allow_uploads is set to TRUE. +

+

+   +

+

+ If must_login_to_download is set to TRUE, users must login before they will see the list of files. (Default: FALSE) +
(They will not be able to download or browse through files without logging in first.) +
This variable only matters when use_login_system is set to TRUE. +

+

+   +

+

+ banned_list contains the path to the text file where blocked IP addresses and/or hostnames are stored. +
This list can be edited by logging in as an administrator, or you +can directly edit the text file and add IP addresses and/or hostnames, +each on a new line. +
You can use wildcards in the entries (*, ?, +). +

+

+   +

+

+ If sub_folder_access is set to FALSE, folders will not be shown. (Default: TRUE) +

+

+   +

+

+ index: Leave this blank unless you use php includes on your webpage. +
Make sure to put "ob_start();" and "session_start();" at the top of + your index file. This will make sure headers are sent correctly. +
Examples: +

+ + + + + + + +
?id=AutoIndex
/file.php?id=thisFile
+

+ The include in your index file should look something like this: +

+
$valid = array('home', 'page1', 'page2');
+if (isset($_REQUEST['id']) && in_array($_REQUEST['id'], $valid))
+//if the id parameter in the URL is set, and it is in the 'valid' list
+{
+	include($_REQUEST['id']); //include the file
+}
+
+

+   +

+

+ hidden_files contains an array of strings. +
If a file or folder matches any of them, it will not be displayed. +
They may contain wildcards (*, +, ?). For example, to hide all php +files, add '*.php' to the list, or if you want to hide all files that +begin with a period, add '.*' +

+

+   +

+

+ show_only_these_files contains an array of strings. +
If there are any items in the array, the hidden_files variable will + be disabled, and only files that are listed here will be shown. +
They may contain wildcards (*, +, ?). For example, to show only .txt files, add '*.txt' to the list. +

+

+   +

+

+ force_download should be set to TRUE or FALSE. (Default: FALSE) +
If it is set to TRUE, the file will be automatically downloaded, instead of letting the person's browser decide. +

+

+   +

+

+ bandwidth_limit is set to the max download speed (per client) in KB/s. 0 will turn it off. +
The number can contain a decimal if you want. +
NOTE: To use this feature, force_download must be set to TRUE. +

+

+   +

+

+ anti_leech should be set to TRUE or FALSE. (Default: FALSE) +
This will compare the referrer and the name of your site to make sure they clicked on a link to download a file. +
Setting this equal to TRUE will prevent "leeching" by making sure they download files directly from a link on your site. +
Since some people turn off referrer sending in their browser, this option is not recommended. +

+

+   +

+

+ enable_searching should be set to TRUE or FALSE. (Default: TRUE) +
If it is TRUE, people will be able to search for a file or folder containing a string. +
It will search the folder you are currently in, and all subfolders. +
Searching is not case sensitive. +

+

+   +

+

+ The log_file contains the full path to the file to write the access log. +
Leave it blank to turn off logging. +
The log file can be a local file, or on an FTP server. +
If it's a local file on non-windows systems, make sure the log file is chmod'ed to allow PHP to write to the file. +
Example: +

+ + + + + + + + + + + + + +
./log.txt(the folder the php file is in)
/home/user/public_html/some_folder/somefile.log(absolute path)
ftp://user:password@example.com/somefile.txt(stored on ftp server)
+

+ dont_log_these_ips contains an array of strings (which are IP addresses). +
Any access from an IP on this list will not be written to the log file. +
You can also add hostnames to the list, and use wildcards (*, +, ?). +
(i.e. put your own IP in here so you don't fill up the log file when you access your site) +

+

+   +

+

+ download_count contains a string which is the filename of the file to keep track of how many times files have been downloaded. +
The file must be chmod'ed to allow PHP to read AND write to the file. +
Leave blank to disable this feature. +
NOTE: When downloading a file from an IP addresses in the dont_log_these_ips array, the count will NOT increase. +

+

+   +

+

+ links_file contains the path to a text file with the URL of files that you want to be listed as links. +
Separate each entry with a new line. +
If you want, you can change how the links is displayed, by putting some text after a pipe ('|') +

+ http://autoindex.sourceforge.net|Main Site +
http://autoindex.sourceforge.net/forum/|Forum +

+ If no link description is present, the link itself will be displayed. +
NOTE: This isn't really meant to be done by hand - you can use the built-in editor when you log in as an admin. +

+

+   +

+

+ description_file contains the path to a text file with descriptions for files. +
The format is: [base_dir][full filename and path][a pipe, '|'][description for file] +
Here's an example: ./somefile.txt|This is a text file. +
Separate each entry with a new line. +
NOTE: This isn't really meant to be done by hand: you can login as an admin and click "edit description" next to any file. +

+

+   +

+

+ show_dir_size should be set to TRUE or FALSE. (Default: TRUE) +
If it is set to TRUE, the total size of the folder will be shown under size. +
If it is FALSE, it will display "[dir]" under size. +
NOTE: If you are trying to index many files (meaning a few thousand), you will notice a speed improvement with this turned off. +

+

+   +

+

+ folder_expansion should be set to TRUE or FALSE. (Default: FALSE) +
If it is set to TRUE, when you click on the folder icon, it will expand the folder and list its contents. +
Clicking on the folder name will take you into that folder. +
If it is set to FALSE, both clicking on the icon and name will take you into the folder. +

+

+   +

+

+ show_folder_count should be set to TRUE or FALSE. (Default: FALSE) +
If it is TRUE, the total number of files in a folder will be shown next to that folder. +
Files are counted recursively (files in subfolders are counted). +

+

+   +

+

+ header and footer are the paths to 2 files. +
The files must be text files (.html .txt .php , etc...) +
Header will be displayed at the top, and footer will be displayed at the bottom. +
Leave blank to not include a file. +

+

+   +

+

+ header_per_folder and footer_per_folder should be set to TRUE or FALSE. (Default: FALSE) +
If they are FALSE, the header/footer will be taken from the absolute or relative path in the header/footer variable. +
If they are TRUE, the current directory will be added to the +beginning of the file to be included. (don't add a path to the +header/footer variables - just the filename) +

+

+   +

+

+ days_new contains the number of days old a file can be and still have [New] written next to it. (Default: 0) +
If it is set to 0, this feature will be disabled. +
NOTE: this can contain any number, not just a 1 or 0 value, and it can contain a decimal if you want. +

+

+   +

+

+ md5_show is a feature that will let users get the md5sum of a specific file. (Default: 0) +
If set to 0 it will be disabled. +
Otherwise, the number will represent the maximum file size (in +megabytes) to allow the md5sum to be calculated (I'd recommend something + close to 10). +
The number can contain a decimal if you want. +
NOTE: PHP version 4.2.0 or higher is required for this feature to work. +

+

+   +

+

+ thumbnail_height is a feature that will show thumbnails next to images. (NOTE: GDlib 2.0.1 or higher is required) +
Setting it to 0 will disable this feature, and setting it to any other number will set the size of the thumbnail. +
(100 is a good setting to start with.) +

+

+   +

+

+ show_type_column, show_size_column, and show_date_column are set to TRUE or FALSE. +
Setting them to TRUE will show the column, and setting it to FALSE will not display the column. +

+ +
+ +

+ Language Settings: +

+

+   +

+

+ lang is the default language to display the script in. +
The choices are listed below... +
(Default: 'en') +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lang settingLanguage
alAlbanian
bgBulgarian
caCatalan
czCzech
daDanish
deGerman
eeEstonian
enEnglish
eoEsperanto
esSpanish
fiFinnish
frFrench
grGreek
heHebrew
huHungarian
isIcelandic
itItalian
jpJapanese
koKorean
ltLithuanian
lvLatvian
msMalay
nlDutch
noNorwegian
plPolish
pt_BRBrazilian Portuguese
roRomanian
ruRussian
skSlovak
sr_LASerbian (Latin)
sr_CYSerbian (Cyrillic)
svSwedish
thThai
trTurkish
viVietnamese
zh_CNChinese
zh_TWChinese Traditional
+

+   +

+

+ path_to_language_files is the path where the *.php language files are located. +
Default: ./languages/ +

+

+   +

+

+ If select_language is set to TRUE, there will be an option at the bottom of the script for +
the user to choose which language the script is displayed in. (Default: FALSE) +

+ +
+ +
+ + + + \ No newline at end of file diff --git a/classes/DirItem.php b/classes/DirItem.php index b493510..84ddaa5 100644 --- a/classes/DirItem.php +++ b/classes/DirItem.php @@ -1167,8 +1167,8 @@ class DirItem extends Item $lang_name = 'SPANISH_EL_SALVADOR'; $country_name = 'EL_SALVADOR'; break; - case 'es_US': - case 'es_us': + case 'es-US': + case 'es-us': // Spanish (United States) (es-US) $lang_name = 'SPANISH_UNITED_STATES'; $country_name = 'UNITED_STATES'; @@ -1183,7 +1183,7 @@ class DirItem extends Item case 'es_UY': case 'es_uy': //Spanish (Uruguay) (es-UY) - $lang_name = 'RIOPLATENSE_SPANISH_URUGUAY'; + $lang_name = 'SPANISH_URUGUAY'; $country_name = 'URUGUAY'; break; case 'es_ve': @@ -1826,7 +1826,7 @@ class DirItem extends Item break; case 'ke': - $lang_name = 'Kenya'; + $lang_name = 'SWAHILI'; $country_name = 'KENYA'; break; @@ -2262,10 +2262,16 @@ class DirItem extends Item break; case 'pt': - $lang_name = 'Portugal'; + case 'pt_pt': + $lang_name = 'PORTUGAL'; $country_name = 'PORTUGAL'; break; + case 'pt_br': + $lang_name = 'PORTUGAL'; + $country_name = 'BRAZIL'; //pt + break; + case 'pk': $lang_name = 'Pakistan'; $country_name = 'PAKISTAN'; @@ -2479,12 +2485,26 @@ class DirItem extends Item $country_name = 'SYRIA'; break; - //sw –Swahili, also known as Kiswahili + //ISO 639-2 swa + //ISO 639-3 swa – inclusive code + + //Individual codes: + //swc – Congo Swahili + //swh – Coastal Swahili + //ymk – Makwe + //wmw – Mwani + + //Person Mswahili + //People Waswahili + //Language Kiswahili case 'sw': + $lang_name = 'SWAHILI'; + $country_name = 'KENYA'; + break; case 'swa': $lang_name = 'SWAHILI'; $country_name = 'AFRICAN_GREAT_LAKES'; - break; + break; //swa – inclusive code // //Individual codes: diff --git a/classes/Language.php b/classes/Language.php index 83fa86c..64aa63e 100644 --- a/classes/Language.php +++ b/classes/Language.php @@ -95,10 +95,11 @@ class Language //e.g. "en-us,en;q=0.5" { $available_langs = self::get_all_langs(PATH_TO_LANGUAGES); + $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if ($available_langs !== false) { $pref = array(); //user's preferred languages - foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) + foreach ($accept_lang_ary as $lang) { $lang_array = explode(';q=', trim($lang)); $q = (isset($lang_array[1]) ? trim($lang_array[1]) : 1); //preference value @@ -107,12 +108,14 @@ class Language arsort($pref); //find the first match that is available: foreach ($pref as $lang => $q) - { - if (in_array($lang, $available_langs)) + { + //replace line string to language file downscroll + $lang = str_replace('-', '_', $lang); + if (file_exists(@realpath(PATH_TO_LANGUAGES . $lang . LANGUAGE_FILE_EXT))) { return $lang; } - elseif (file_exists(@realpath(PATH_TO_LANGUAGES . $lang . LANGUAGE_FILE_EXT))) + elseif (in_array($lang, $available_langs)) { return $lang; } diff --git a/description_file b/description_file new file mode 100644 index 0000000..c7de2c0 --- /dev/null +++ b/description_file @@ -0,0 +1 @@ +./autoindex_license.html |autoindex_license \ No newline at end of file diff --git a/hidden_files b/hidden_files index 5d7e190..02da88a 100644 --- a/hidden_files +++ b/hidden_files @@ -1,13 +1,14 @@ +cache classes flags index_icons languages templates hidden_files +description_file AutoIndex.conf.php config.php access.log -license.html meta.inc robots.txt favicon.gif diff --git a/languages/index.htm b/languages/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/languages/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/languages/ro.txt b/languages/ro.txt new file mode 100644 index 0000000..19c5c3f --- /dev/null +++ b/languages/ro.txt @@ -0,0 +1,93 @@ +// Romanian language file by FlorinCB + +index of Indice la +parent directory Director Superior +thumbnail of Thumbnail director +continue Continuă + +file Fisier +files Fisiere +folder Folder +folders Foldere +size Marime +total size Dimensiune totala +total files Fisiere totale +total downloads Descărcări totale +total Total + +date Modificat +description Descripţie +downloads Descărcări +type Tip +sort by Ordinat după + +search Caută +both Ambele +search results Rezultatele cautari +no results CAUTARE FARA REZULTATE + +account Count utilizator +login Autentificare +logout Logout +username Nume utilizator +password Parolă +select user to remove Selectează utilizatorul pentru ştergere +are you sure you want to remove the user Eşti sigur că doreşti ştergerea utilizatorului +delete this user Şterge acest utilizator +add user Adaugă Utilizator + +guest Vizitator +user Utilizator +mod Moderator +admin Admin +level Nivel utilizator + +rename redenumeşte/mută +renaming Redenumire +new filename Noul nume de fişier +you can also move the file by specifying a path poţi totodată sămuţi fişierul specificând o cale +delete şterge +are you sure you want to delete the file Sigur doreşti ştergerea fişierului +edit description Modifică descripţie +yes, delete Da, şterge + +upload Încarcă +files to this folder fişier(e) pt acest folder +uploaded files Fişiere urcate +failed files Fişiere neurcate +none Niciuna +file already exists fişier dej&a; există +filename is listed as a hidden file Il nome di file è in lista come file nascosto + +reconfigure script Riconfigura lo script +create new directory in this folder Crea una nuova directory in questa cartella +edit list of hidden files Modfica la lista dei file nascosti +add new user Aggiungi un nuovo utente +delete user Cancella utente +copy url Copy a remote file (to this folder) +upload to ftp upload file to FTP server + +enter the new description for the file Inserisci la nuova descrizione per il file +change Cambia +enter the new name Inserisci il nuovo nome +create Crea + +add Aggiungi +remove Rimuovi +remove a hidden file Rimuovi un file nascosto +add a new hidden file Aggiungi un nuovo file nascosto + +edit ban list Modifica la lista degli IP e degli hostname bloccati +remove a ban Rimuovi un blocco +add a new ban Aggiungi un nuovo blocco (indirizzo IP o l'hostname, puoi usare anche i wildcards) +the administrator has blocked your ip address or hostname Sorry, the administrator has blocked your IP address or hostname + +view entries from log file Guarda le entries dal fiel di log +view statistics from log file Guarda le statistiche dal file di log +how many entries would you like to view Quante entries vuoi vedere +view Guarda +page Page +of of + +calculate md5sum calcola md5sum +download directory as tar.gz archive Scarica la directory come un archivio tar.gz diff --git a/languages/ro_RO.txt b/languages/ro_RO.txt new file mode 100644 index 0000000..19c5c3f --- /dev/null +++ b/languages/ro_RO.txt @@ -0,0 +1,93 @@ +// Romanian language file by FlorinCB + +index of Indice la +parent directory Director Superior +thumbnail of Thumbnail director +continue Continuă + +file Fisier +files Fisiere +folder Folder +folders Foldere +size Marime +total size Dimensiune totala +total files Fisiere totale +total downloads Descărcări totale +total Total + +date Modificat +description Descripţie +downloads Descărcări +type Tip +sort by Ordinat după + +search Caută +both Ambele +search results Rezultatele cautari +no results CAUTARE FARA REZULTATE + +account Count utilizator +login Autentificare +logout Logout +username Nume utilizator +password Parolă +select user to remove Selectează utilizatorul pentru ştergere +are you sure you want to remove the user Eşti sigur că doreşti ştergerea utilizatorului +delete this user Şterge acest utilizator +add user Adaugă Utilizator + +guest Vizitator +user Utilizator +mod Moderator +admin Admin +level Nivel utilizator + +rename redenumeşte/mută +renaming Redenumire +new filename Noul nume de fişier +you can also move the file by specifying a path poţi totodată sămuţi fişierul specificând o cale +delete şterge +are you sure you want to delete the file Sigur doreşti ştergerea fişierului +edit description Modifică descripţie +yes, delete Da, şterge + +upload Încarcă +files to this folder fişier(e) pt acest folder +uploaded files Fişiere urcate +failed files Fişiere neurcate +none Niciuna +file already exists fişier dej&a; există +filename is listed as a hidden file Il nome di file è in lista come file nascosto + +reconfigure script Riconfigura lo script +create new directory in this folder Crea una nuova directory in questa cartella +edit list of hidden files Modfica la lista dei file nascosti +add new user Aggiungi un nuovo utente +delete user Cancella utente +copy url Copy a remote file (to this folder) +upload to ftp upload file to FTP server + +enter the new description for the file Inserisci la nuova descrizione per il file +change Cambia +enter the new name Inserisci il nuovo nome +create Crea + +add Aggiungi +remove Rimuovi +remove a hidden file Rimuovi un file nascosto +add a new hidden file Aggiungi un nuovo file nascosto + +edit ban list Modifica la lista degli IP e degli hostname bloccati +remove a ban Rimuovi un blocco +add a new ban Aggiungi un nuovo blocco (indirizzo IP o l'hostname, puoi usare anche i wildcards) +the administrator has blocked your ip address or hostname Sorry, the administrator has blocked your IP address or hostname + +view entries from log file Guarda le entries dal fiel di log +view statistics from log file Guarda le statistiche dal file di log +how many entries would you like to view Quante entries vuoi vedere +view Guarda +page Page +of of + +calculate md5sum calcola md5sum +download directory as tar.gz archive Scarica la directory come un archivio tar.gz