openupload-svn-update Mailing List for Open Upload (Page 11)
Status: Beta
Brought to you by:
tsdogs
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(100) |
Nov
(72) |
Dec
(44) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(7) |
Feb
(47) |
Mar
(30) |
Apr
(11) |
May
(10) |
Jun
(8) |
Jul
(1) |
Aug
(22) |
Sep
|
Oct
|
Nov
(13) |
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(1) |
| 2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ts...@us...> - 2008-11-14 19:12:22
|
Revision: 146
http://openupload.svn.sourceforge.net/openupload/?rev=146&view=rev
Author: tsdogs
Date: 2008-11-14 19:12:18 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Add french translation (by BatMat)
Added Paths:
-----------
trunk/locale/fr/LC_MESSAGES/openupload.mo
trunk/locale/fr/LC_MESSAGES/openupload.po
trunk/locale/fr.inc.php
Added: trunk/locale/fr/LC_MESSAGES/openupload.mo
===================================================================
(Binary files differ)
Property changes on: trunk/locale/fr/LC_MESSAGES/openupload.mo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/locale/fr/LC_MESSAGES/openupload.po
===================================================================
--- trunk/locale/fr/LC_MESSAGES/openupload.po (rev 0)
+++ trunk/locale/fr/LC_MESSAGES/openupload.po 2008-11-14 19:12:18 UTC (rev 146)
@@ -0,0 +1,300 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenUpload\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-11-14 16:29+0100\n"
+"PO-Revision-Date: 2008-11-14 19:30+0100\n"
+"Last-Translator: Robin-Vinet Mathieu <mat...@ho...>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: tr\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-Language: French\n"
+"X-Poedit-SearchPath-0: ../../../lib\n"
+"X-Poedit-SearchPath-1: ../../../plugins\n"
+
+#: ../../../lib/user.inc.php:87
+msgid "Login incorrect!"
+msgstr "Authentification incorrecte!"
+
+#: ../../../lib/main.inc.php:194
+msgid "plugin include file not found: %1"
+msgstr "Fichier de module introuvable: %1"
+
+#: ../../../lib/main.inc.php:373
+msgid "IP Banned"
+msgstr "IP Bannie"
+
+#: ../../../lib/main.inc.php:398
+msgid "THERE HAS BEEN A PERMISSION ERROR. PLEASE TRY ONE OF THE ALLOWED OPTIONS!"
+msgstr "PROBLEME DE PERMISSION. ACCES INTERDIT!"
+
+#: ../../../lib/modules/db/txt.inc.php:114
+msgid "ERROR: database folder not found!"
+msgstr "ERREUR: répertoire de base de donnée introuvable!"
+
+#: ../../../lib/modules/db/txt.inc.php:120
+msgid "ERROR: Could not create folder for %1 table!"
+msgstr "ERREUR: Impossible de créer le répertoire %1 pour la table!"
+
+#: ../../../lib/modules/db/txt.inc.php:131
+msgid "ERROR: Could not create file for %1 table!"
+msgstr "ERREUR: Impossible de créer le fichier pour la table %1!"
+
+#: ../../../lib/modules/db/mysql.inc.php:15
+msgid "ERROR: connection to database failed!"
+msgstr "ERREUR: La connexion à la base de données a échouée!"
+
+#: ../../../lib/modules/default/auth.inc.php:27
+#: ../../../lib/modules/default/auth.inc.php:40
+msgid "Login"
+msgstr "Authentification"
+
+#: ../../../lib/modules/default/auth.inc.php:30
+msgid "User registration"
+msgstr "Inscription"
+
+#: ../../../lib/modules/default/auth.inc.php:33
+msgid "User options"
+msgstr "Options utilisateur"
+
+#: ../../../lib/modules/default/auth.inc.php:43
+msgid "Preferences"
+msgstr "Préférences"
+
+#: ../../../lib/modules/default/auth.inc.php:44
+msgid "Logout"
+msgstr "Déconnexion"
+
+#: ../../../lib/modules/default/auth.inc.php:92
+#: ../../../lib/modules/default/auth.inc.php:115
+#: ../../../lib/modules/default/auth.inc.php:200
+msgid "Registration is not supported by Auth Module"
+msgstr "L'inscription n'est pas permise par le module d'authentification (Auth)"
+
+#: ../../../lib/modules/default/auth.inc.php:123
+msgid "Username already taken, choose a new value"
+msgstr "Ce nom d'utilisateur n'est pas disponible, merci d'en choisir un autre"
+
+#: ../../../lib/modules/default/auth.inc.php:127
+msgid "Login name must be at least 5 characters long!"
+msgstr "Le login doit comporter au moins 5 caractères!"
+
+#: ../../../lib/modules/default/auth.inc.php:131
+msgid "Login name contains an invalid character. Valid vharacters are %1"
+msgstr "Le login contient des caractères invalides. Les caractères valides sont %1"
+
+#: ../../../lib/modules/default/auth.inc.php:135
+msgid "Please insert Full Name"
+msgstr "Merci de saisir le nom complet"
+
+#: ../../../lib/modules/default/auth.inc.php:139
+msgid "Please insert a valid e-mail!"
+msgstr "Merci de saisir une adresse de courriel valide!"
+
+#: ../../../lib/modules/default/auth.inc.php:143
+msgid "Password must be at least 5 characters long!"
+msgstr "Le mot de passe doit comporter au moins 5 caractères!"
+
+#: ../../../lib/modules/default/auth.inc.php:147
+msgid "Passwords do not match! please retype."
+msgstr "Les mots de passe ne correspondent pas! Recommencez."
+
+#: ../../../lib/modules/default/auth.inc.php:169
+msgid "[%1] User registration confirmation e-mail"
+msgstr "[%1] courriel de confirmation d'inscription"
+
+#: ../../../lib/modules/default/auth.inc.php:183
+msgid "Registration completed successfully. Have fun!"
+msgstr "Inscription achevée avec succès. Bon divertissement!"
+
+#: ../../../lib/modules/default/auth.inc.php:219
+#: ../../../lib/modules/default/auth.inc.php:231
+msgid "User profile change not supported by Auth Module"
+msgstr "La modification du profil utilisateur n'est pas permise par le module d'authentification (Auth)"
+
+#: ../../../lib/modules/default/auth.inc.php:238
+msgid "Full Name cannot be empty!"
+msgstr "Le nom complet ne peut-être vide!"
+
+#: ../../../lib/modules/default/auth.inc.php:243
+msgid "Please enter a valid e-mail address!"
+msgstr "Merci de saisir une adresse de courriel valide!"
+
+#: ../../../lib/modules/default/auth.inc.php:251
+msgid "Password must be at least 5 charaters long!"
+msgstr "Le mot de passe doit comporter au moins 5 caractères!"
+
+#: ../../../lib/modules/default/auth.inc.php:254
+msgid "Old password is wrong!"
+msgstr "L'ancien mot de passe est erroné!"
+
+#: ../../../lib/modules/default/auth.inc.php:257
+msgid "New passwords do not match!"
+msgstr "Les mots de passe ne correspondent pas! Recommencez."
+
+#: ../../../lib/modules/default/auth.inc.php:260
+msgid "Password has been changed!"
+msgstr "Mot de passe modifié avec succès!"
+
+#: ../../../lib/modules/default/files.inc.php:31
+msgid "File upload"
+msgstr "Envoi de fichiers"
+
+#: ../../../lib/modules/default/files.inc.php:34
+msgid "File download"
+msgstr "Téléchargement de fichiers"
+
+#: ../../../lib/modules/default/files.inc.php:37
+msgid "File Removal"
+msgstr "Suppresion de fichiers"
+
+#: ../../../lib/modules/default/files.inc.php:41
+msgid "File Upload"
+msgstr "Envoi de fichiers"
+
+#: ../../../lib/modules/default/files.inc.php:69
+msgid "Maximum upload size for site wide configuration reached"
+msgstr "La taille maximum d'hébergement de fichier est atteinte"
+
+#: ../../../lib/modules/default/files.inc.php:70
+#: ../../../lib/modules/default/files.inc.php:81
+msgid "Maximum file size exceeded!"
+msgstr "Le fichier dépasse la taille maximum!"
+
+#: ../../../lib/modules/default/files.inc.php:71
+msgid "Partial file transfer error!"
+msgstr "ERREUR, le fichier a été transféré partiellement!"
+
+#: ../../../lib/modules/default/files.inc.php:72
+msgid "No file was uploaded!"
+msgstr "Aucun fichier n'a été envoyé!"
+
+#: ../../../lib/modules/default/files.inc.php:73
+msgid "Missing temporary directory"
+msgstr "Le répertoire temporaire est introuvable"
+
+#: ../../../lib/modules/default/files.inc.php:74
+msgid "Can't write to temporary diretory!"
+msgstr "Impossible d'écrire dans le répertoire temporaire!"
+
+#: ../../../lib/modules/default/files.inc.php:75
+msgid "Upload blocked by extension!"
+msgstr "Cette extension de fichier n'est pas supportée!"
+
+#: ../../../lib/modules/default/files.inc.php:77
+msgid "Upload failed for Unknonw error code: %1"
+msgstr "L'envoi de fichier a échoué pour une raison inconnue. ERREUR: %1"
+
+#: ../../../lib/modules/default/files.inc.php:194
+msgid "Requested file does not exsist!"
+msgstr "Le fichier demandé n'existe pas!"
+
+#: ../../../lib/modules/default/files.inc.php:280
+#: ../../../lib/modules/default/files.inc.php:283
+#: ../../../lib/modules/default/files.inc.php:294
+msgid "Wrong file id!"
+msgstr "L'identifiant du fichier est erronné!"
+
+#: ../../../lib/modules/default/admin.inc.php:59
+#: ../../../lib/modules/default/admin.inc.php:62
+msgid "Administration"
+msgstr "Administration"
+
+#: ../../../lib/modules/default/admin.inc.php:80
+msgid "User administration not supported by Auth Module"
+msgstr "L'administration des utilisateurs n'est pas permise par le module d'authentification (Auth)"
+
+#: ../../../lib/modules/default/admin.inc.php:197
+msgid "Group administration not supported by Auth Module"
+msgstr "L'administration des groupes n'est pas permise par le module d'authentification (Auth)"
+
+#: ../../../lib/modules/default/admin.inc.php:211
+msgid "Please provide a valid group name!"
+msgstr "Merci de saisir un nom de groupe valide!"
+
+#: ../../../lib/modules/default/admin.inc.php:259
+#: ../../../lib/modules/default/admin.inc.php:290
+#: ../../../lib/modules/default/admin.inc.php:474
+#: ../../../lib/modules/default/admin.inc.php:501
+msgid "Allow"
+msgstr "Permettre"
+
+#: ../../../lib/modules/default/admin.inc.php:260
+#: ../../../lib/modules/default/admin.inc.php:291
+#: ../../../lib/modules/default/admin.inc.php:474
+#: ../../../lib/modules/default/admin.inc.php:501
+msgid "Deny"
+msgstr "Interdire"
+
+#: ../../../lib/modules/default/admin.inc.php:364
+#: ../../../lib/modules/default/admin.inc.php:389
+msgid "Enable"
+msgstr "Activer"
+
+#: ../../../lib/modules/default/admin.inc.php:365
+#: ../../../lib/modules/default/admin.inc.php:390
+msgid "Disable"
+msgstr "Désactiver"
+
+#: ../../../lib/modules/default/admin.inc.php:449
+msgid "IP %1 has been banned!"
+msgstr "L'adresse IP %1 a été bannie!"
+
+#: ../../../lib/modules/default/admin.inc.php:453
+#: ../../../lib/modules/default/admin.inc.php:469
+msgid "IP %1 was already in state: %2!"
+msgstr "IP %1 était déjà dans l'état: %1"
+
+#: ../../../lib/modules/auth/ldap.inc.php:24
+msgid "LDAP connection failed!"
+msgstr "ERREUR: La connexion à l'annuaire LDAP a échouée!"
+
+#: ../../../plugins/mimetypes.inc.php:6
+msgid "Limit the mimetypes a user can upload"
+msgstr "Limite les types MIME des fichiers envoyés"
+
+#: ../../../plugins/mimetypes.inc.php:12
+#: ../../../plugins/mimetypes.inc.php:23
+msgid "WARNING: no mime types defined. Plugin has been disabled!"
+msgstr "ATTENTION: pas de type MIME définit. Le module a été désactivé!"
+
+#: ../../../plugins/mimetypes.inc.php:25
+msgid "This file type (%1) is not allowed on this site!"
+msgstr "L'envoi de ce type de fichiers (%1) n'est pas permis sur ce site!"
+
+#: ../../../plugins/captcha.inc.php:7
+msgid "Add captcha protection to file download and user registration"
+msgstr "Ajoute une protection Captcha au téléchargement de fichiers et à l'inscription des utilisateurs"
+
+#: ../../../plugins/captcha.inc.php:40
+#: ../../../plugins/captcha.inc.php:58
+msgid "Wrong captcha code! please try again."
+msgstr "Le code Captcha saisi est erroné! Merci de recommencer."
+
+#: ../../../plugins/email.inc.php:30
+msgid "Your e-mail address isn't valid!"
+msgstr "Votre adresse de courriel est invalide!"
+
+#: ../../../plugins/email.inc.php:40
+msgid "Destination e-mail address isn't valid!"
+msgstr "L'adresse courriel de destination n'est pas valide!"
+
+#: ../../../plugins/email.inc.php:56
+msgid "Information about your uploaded file: %1"
+msgstr "Information relative au fichier envoyé: %1"
+
+#: ../../../plugins/email.inc.php:60
+msgid "An upload was delivered to you"
+msgstr "Un fichier a été mis à votre disposition"
+
+#: ../../../plugins/password.inc.php:7
+msgid "Option to add password protection for file download"
+msgstr "Permet d'ajouter une protection par mot de passe aux fichier en téléchargement"
+
+#: ../../../plugins/password.inc.php:42
+msgid "Wrong password!"
+msgstr "Mot de passe erroné!"
+
Added: trunk/locale/fr.inc.php
===================================================================
--- trunk/locale/fr.inc.php (rev 0)
+++ trunk/locale/fr.inc.php 2008-11-14 19:12:18 UTC (rev 146)
@@ -0,0 +1,68 @@
+<?php
+$tr["Login incorrect!"] = "Authentification incorrecte!";
+$tr["plugin include file not found: %1"] = "Fichier de module introuvable: %1";
+$tr["IP Banned"] = "IP Bannie";
+$tr["THERE HAS BEEN A PERMISSION ERROR. PLEASE TRY ONE OF THE ALLOWED OPTIONS!"] = "PROBLEME DE PERMISSION. ACCES INTERDIT!";
+$tr["ERROR: database folder not found!"] = "ERREUR: répertoire de base de donnée introuvable!";
+$tr["ERROR: Could not create folder for %1 table!"] = "ERREUR: Impossible de créer le répertoire %1 pour la table!";
+$tr["ERROR: Could not create file for %1 table!"] = "ERREUR: Impossible de créer le fichier pour la table %1!";
+$tr["ERROR: connection to database failed!"] = "ERREUR: La connexion à la base de données a échouée!";
+$tr["Login"] = "Authentification";
+$tr["User registration"] = "Inscription";
+$tr["User options"] = "Options utilisateur";
+$tr["Preferences"] = "Préférences";
+$tr["Logout"] = "Déconnexion";
+$tr["Registration is not supported by Auth Module"] = "L'inscription n'est pas permise par le module d'authentification (Auth)";
+$tr["Username already taken, choose a new value"] = "Ce nom d'utilisateur n'est pas disponible, merci d'en choisir un autre";
+$tr["Login name must be at least 5 characters long!"] = "Le login doit comporter au moins 5 caractères!";
+$tr["Login name contains an invalid character. Valid vharacters are %1"] = "Le login contient des caractères invalides. Les caractères valides sont %1";
+$tr["Please insert Full Name"] = "Merci de saisir le nom complet";
+$tr["Please insert a valid e-mail!"] = "Merci de saisir une adresse de courriel valide!";
+$tr["Password must be at least 5 characters long!"] = "Le mot de passe doit comporter au moins 5 caractères!";
+$tr["Passwords do not match! please retype."] = "Les mots de passe ne correspondent pas! Recommencez.";
+$tr["[%1] User registration confirmation e-mail"] = "[%1] courriel de confirmation d'inscription";
+$tr["Registration completed successfully. Have fun!"] = "Inscription achevée avec succès. Bon divertissement!";
+$tr["User profile change not supported by Auth Module"] = "La modification du profil utilisateur n'est pas permise par le module d'authentification (Auth)";
+$tr["Full Name cannot be empty!"] = "Le nom complet ne peut-être vide!";
+$tr["Please enter a valid e-mail address!"] = "Merci de saisir une adresse de courriel valide!";
+$tr["Password must be at least 5 charaters long!"] = "Le mot de passe doit comporter au moins 5 caractères!";
+$tr["Old password is wrong!"] = "L'ancien mot de passe est erroné!";
+$tr["New passwords do not match!"] = "Les mots de passe ne correspondent pas! Recommencez.";
+$tr["Password has been changed!"] = "Mot de passe modifié avec succès!";
+$tr["File upload"] = "Envoi de fichiers";
+$tr["File download"] = "Téléchargement de fichiers";
+$tr["File Removal"] = "Suppresion de fichiers";
+$tr["File Upload"] = "Envoi de fichiers";
+$tr["Maximum upload size for site wide configuration reached"] = "La taille maximum d'hébergement de fichier est atteinte";
+$tr["Maximum file size exceeded!"] = "Le fichier dépasse la taille maximum!";
+$tr["Partial file transfer error!"] = "ERREUR, le fichier a été transféré partiellement!";
+$tr["No file was uploaded!"] = "Aucun fichier n'a été envoyé!";
+$tr["Missing temporary directory"] = "Le répertoire temporaire est introuvable";
+$tr["Can't write to temporary diretory!"] = "Impossible d'écrire dans le répertoire temporaire!";
+$tr["Upload blocked by extension!"] = "Cette extension de fichier n'est pas supportée!";
+$tr["Upload failed for Unknonw error code: %1"] = "L'envoi de fichier a échoué pour une raison inconnue. ERREUR: %1";
+$tr["Requested file does not exsist!"] = "Le fichier demandé n'existe pas!";
+$tr["Wrong file id!"] = "L'identifiant du fichier est erronné!";
+$tr["Administration"] = "Administration";
+$tr["User administration not supported by Auth Module"] = "L'administration des utilisateurs n'est pas permise par le module d'authentification (Auth)";
+$tr["Group administration not supported by Auth Module"] = "L'administration des groupes n'est pas permise par le module d'authentification (Auth)";
+$tr["Please provide a valid group name!"] = "Merci de saisir un nom de groupe valide!";
+$tr["Allow"] = "Permettre";
+$tr["Deny"] = "Interdire";
+$tr["Enable"] = "Activer";
+$tr["Disable"] = "Désactiver";
+$tr["IP %1 has been banned!"] = "L'adresse IP %1 a été bannie!";
+$tr["IP %1 was already in state: %2!"] = "IP %1 était déjà dans l'état: %1";
+$tr["LDAP connection failed!"] = "ERREUR: La connexion à l'annuaire LDAP a échouée!";
+$tr["Limit the mimetypes a user can upload"] = "Limite les types MIME des fichiers envoyés";
+$tr["WARNING: no mime types defined. Plugin has been disabled!"] = "ATTENTION: pas de type MIME définit. Le module a été désactivé!";
+$tr["This file type (%1) is not allowed on this site!"] = "L'envoi de ce type de fichiers (%1) n'est pas permis sur ce site!";
+$tr["Add captcha protection to file download and user registration"] = "Ajoute une protection Captcha au téléchargement de fichiers et à l'inscription des utilisateurs";
+$tr["Wrong captcha code! please try again."] = "Le code Captcha saisi est erroné! Merci de recommencer.";
+$tr["Your e-mail address isn't valid!"] = "Votre adresse de courriel est invalide!";
+$tr["Destination e-mail address isn't valid!"] = "L'adresse courriel de destination n'est pas valide!";
+$tr["Information about your uploaded file: %1"] = "Information relative au fichier envoyé: %1";
+$tr["An upload was delivered to you"] = "Un fichier a été mis à votre disposition";
+$tr["Option to add password protection for file download"] = "Permet d'ajouter une protection par mot de passe aux fichier en téléchargement";
+$tr["Wrong password!"] = "Mot de passe erroné!";
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-14 19:11:54
|
Revision: 145
http://openupload.svn.sourceforge.net/openupload/?rev=145&view=rev
Author: tsdogs
Date: 2008-11-14 19:11:50 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Add french translation (by BatMat)
Added Paths:
-----------
trunk/locale/fr/
trunk/locale/fr/LC_MESSAGES/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-14 19:11:15
|
Revision: 144
http://openupload.svn.sourceforge.net/openupload/?rev=144&view=rev
Author: tsdogs
Date: 2008-11-14 19:11:10 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Add french translation (by BatMat)
Added Paths:
-----------
trunk/templates/default/locale/fr/LC_MESSAGES/
trunk/templates/default/locale/fr/LC_MESSAGES/template.mo
trunk/templates/default/locale/fr/LC_MESSAGES/template.po
Added: trunk/templates/default/locale/fr/LC_MESSAGES/template.mo
===================================================================
(Binary files differ)
Property changes on: trunk/templates/default/locale/fr/LC_MESSAGES/template.mo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/templates/default/locale/fr/LC_MESSAGES/template.po
===================================================================
--- trunk/templates/default/locale/fr/LC_MESSAGES/template.po (rev 0)
+++ trunk/templates/default/locale/fr/LC_MESSAGES/template.po 2008-11-14 19:11:10 UTC (rev 144)
@@ -0,0 +1,479 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenUpload default template\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-11-14 17:29+0100\n"
+"PO-Revision-Date: 2008-11-14 18:29+0100\n"
+"Last-Translator: Mathieu Robin-Vinet <mat...@ho...>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: French\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../default.c:2
+msgid "Your IP has been blocked!"
+msgstr "Votre adresse IP a été bloquée!"
+
+#: ../../../default.c:5
+msgid "You cannot use this site."
+msgstr "Vous ne pouvez utiliser ce site."
+
+#: ../../../default.c:8
+msgid "If you think this is a misconfiguration please send an email to the site owner"
+msgstr "Si vous pensez que c'est une erreur, merci d'envoyer un courriel au propriétaire du site"
+
+#: ../../../default.c:11
+msgid "Captcha code"
+msgstr "Code Captcha"
+
+#: ../../../default.c:14
+#: ../../../default.c:20
+msgid "Reload Image"
+msgstr "Recharger l'image"
+
+#: ../../../default.c:17
+msgid "Please enter the following captcha to proceed for the download"
+msgstr "Merci de saisir le code Captcha pour accéder au téléchargement"
+
+#: ../../../default.c:23
+msgid "Use Captcha"
+msgstr "Protéger par code Captcha"
+
+#: ../../../default.c:26
+msgid "The download is password protected."
+msgstr "Le fichier est protégé par un mot de passe."
+
+#: ../../../default.c:29
+#: ../../../default.c:50
+#: ../../../default.c:80
+#: ../../../default.c:161
+#: ../../../default.c:287
+#: ../../../default.c:416
+#: ../../../default.c:467
+msgid "Password"
+msgstr "Mot de passe"
+
+#: ../../../default.c:32
+msgid "Password protect"
+msgstr "Protéger avec un mot de passe"
+
+#: ../../../default.c:35
+#: ../../../default.c:65
+msgid "You are receiving this message because someone uploaded a file on our OpenUpload server for you."
+msgstr "Vous recevez ce message car quelqu'un a mis un fichier à votre disposition sur notre serveur OpenUpload."
+
+#: ../../../default.c:38
+#: ../../../default.c:68
+msgid "File ID"
+msgstr "Identifiant"
+
+#: ../../../default.c:41
+#: ../../../default.c:71
+#: ../../../default.c:326
+#: ../../../default.c:374
+#: ../../../default.c:386
+#: ../../../default.c:404
+msgid "File name"
+msgstr "Nom"
+
+#: ../../../default.c:44
+#: ../../../default.c:74
+#: ../../../default.c:329
+#: ../../../default.c:377
+#: ../../../default.c:389
+#: ../../../default.c:407
+msgid "File size"
+msgstr "Taille"
+
+#: ../../../default.c:47
+#: ../../../default.c:77
+#: ../../../default.c:146
+#: ../../../default.c:314
+#: ../../../default.c:392
+msgid "Description"
+msgstr "Description"
+
+#: ../../../default.c:53
+#: ../../../default.c:83
+msgid "User message"
+msgstr "Message"
+
+#: ../../../default.c:56
+#: ../../../default.c:86
+msgid "To download the file open the following link in a browser"
+msgstr "Pour télécharger le fichier, copier le lien suivant dans un navigateur internet"
+
+#: ../../../default.c:59
+#: ../../../default.c:89
+msgid "To remove the file from our server open the following link in a browser"
+msgstr "Pour supprimer le fichier de notre serveur, copier le lient suivant dans un navigateur internet"
+
+#: ../../../default.c:62
+#: ../../../default.c:92
+#: ../../../default.c:443
+#: ../../../default.c:458
+msgid "For complains please send an email to"
+msgstr "En cas d'abus, merci d'envoyer un email à "
+
+#: ../../../default.c:95
+#: ../../../default.c:101
+msgid "Send me an e-mail"
+msgstr "M'envoyer une copie du courriel"
+
+#: ../../../default.c:98
+msgid "Your e-mail address"
+msgstr "Votre adresse courriel"
+
+#: ../../../default.c:104
+msgid "Send e-mail to"
+msgstr "Envoyer un courriel à"
+
+#: ../../../default.c:107
+msgid "Send remove link"
+msgstr "Envoyer un lien de suppression"
+
+#: ../../../default.c:110
+msgid "e-mail Subject"
+msgstr "Sujet du courriel"
+
+#: ../../../default.c:113
+msgid "e-mail Message"
+msgstr "Message du courriel"
+
+#: ../../../default.c:116
+msgid "Only the following mime types are allowed"
+msgstr "Seul les types MIME suivants sont autorisés"
+
+#: ../../../default.c:119
+#: ../../../default.c:233
+msgid "Plugin"
+msgstr "Module"
+
+#: ../../../default.c:122
+#: ../../../default.c:173
+#: ../../../default.c:185
+#: ../../../default.c:236
+#: ../../../default.c:269
+#: ../../../default.c:299
+msgid "Group"
+msgstr "Groupe"
+
+#: ../../../default.c:125
+#: ../../../default.c:134
+#: ../../../default.c:194
+#: ../../../default.c:224
+#: ../../../default.c:239
+#: ../../../default.c:278
+msgid "Access"
+msgstr "Accès"
+
+#: ../../../default.c:128
+#: ../../../default.c:197
+#: ../../../default.c:230
+#: ../../../default.c:308
+#: ../../../default.c:317
+msgid "Add"
+msgstr "Ajouter"
+
+#: ../../../default.c:131
+#: ../../../default.c:221
+msgid "IP"
+msgstr "Adresse IP"
+
+#: ../../../default.c:137
+#: ../../../default.c:227
+msgid "Priority"
+msgstr "Priorité"
+
+#: ../../../default.c:140
+#: ../../../default.c:149
+#: ../../../default.c:182
+#: ../../../default.c:242
+#: ../../../default.c:281
+#: ../../../default.c:536
+msgid "Confirm"
+msgstr "Confirmer"
+
+#: ../../../default.c:143
+#: ../../../default.c:311
+msgid "Name"
+msgstr "Nom complet"
+
+#: ../../../default.c:152
+msgid "Plugins ACL"
+msgstr "Modules contrôle d'accès"
+
+#: ../../../default.c:155
+msgid "Plugins Options"
+msgstr "Options des modules"
+
+#: ../../../default.c:158
+#: ../../../default.c:284
+#: ../../../default.c:413
+#: ../../../default.c:485
+#: ../../../default.c:512
+msgid "Login name"
+msgstr "Nom utilisateur"
+
+#: ../../../default.c:164
+#: ../../../default.c:290
+#: ../../../default.c:419
+msgid "Retype Password"
+msgstr "Re-saisir le mot de passe"
+
+#: ../../../default.c:167
+#: ../../../default.c:293
+#: ../../../default.c:422
+#: ../../../default.c:488
+#: ../../../default.c:515
+msgid "Full Name"
+msgstr "Nom complet"
+
+#: ../../../default.c:170
+#: ../../../default.c:296
+#: ../../../default.c:425
+#: ../../../default.c:491
+#: ../../../default.c:518
+msgid "e-mail"
+msgstr "Courriel"
+
+#: ../../../default.c:176
+#: ../../../default.c:302
+#: ../../../default.c:428
+#: ../../../default.c:521
+msgid "Preferred language"
+msgstr "Langue préférée"
+
+#: ../../../default.c:179
+#: ../../../default.c:305
+msgid "Active"
+msgstr "Actif"
+
+#: ../../../default.c:188
+#: ../../../default.c:272
+msgid "Module"
+msgstr "Module"
+
+#: ../../../default.c:191
+#: ../../../default.c:275
+msgid "Action"
+msgstr "Action"
+
+#: ../../../default.c:200
+#: ../../../default.c:248
+msgid "Settings"
+msgstr "Paramètres"
+
+#: ../../../default.c:203
+#: ../../../default.c:251
+msgid "Plugins"
+msgstr "Modules"
+
+#: ../../../default.c:206
+#: ../../../default.c:254
+msgid "Files"
+msgstr "Fichiers"
+
+#: ../../../default.c:209
+#: ../../../default.c:257
+msgid "Users"
+msgstr "Utilisateurs"
+
+#: ../../../default.c:212
+#: ../../../default.c:260
+msgid "Groups"
+msgstr "Groupes"
+
+#: ../../../default.c:215
+#: ../../../default.c:263
+msgid "Rights"
+msgstr "Droits"
+
+#: ../../../default.c:218
+msgid "Banned"
+msgstr "Bannis"
+
+#: ../../../default.c:245
+msgid "Here you can administer"
+msgstr "Outils d'administration"
+
+#: ../../../default.c:266
+msgid "Banned IPs"
+msgstr "Adresse IP bloquées"
+
+#: ../../../default.c:320
+msgid "You requested to remove the following file"
+msgstr "Vous avez demandé la suppression du fichier"
+
+#: ../../../default.c:323
+#: ../../../default.c:371
+#: ../../../default.c:401
+msgid "File description"
+msgstr "Description du fichier"
+
+#: ../../../default.c:332
+#: ../../../default.c:380
+#: ../../../default.c:410
+msgid "Uploaded on"
+msgstr "Envoyé le"
+
+#: ../../../default.c:335
+msgid "Confirm removal"
+msgstr "Confirmer la suppression"
+
+#: ../../../default.c:338
+msgid "Download link"
+msgstr "Lien de téléchargement"
+
+#: ../../../default.c:341
+msgid "Remove link"
+msgstr "Lien de suppression"
+
+#: ../../../default.c:344
+msgid "Upload a new file"
+msgstr "Envoyer un nouveau fichier"
+
+#: ../../../default.c:347
+msgid "Please enter the File Information requested"
+msgstr "Merci de saisir les informations requises pour le fichier"
+
+#: ../../../default.c:350
+msgid "File code"
+msgstr "Code fichier"
+
+#: ../../../default.c:353
+#: ../../../default.c:365
+msgid "Proceed"
+msgstr "Accepter"
+
+#: ../../../default.c:356
+msgid "Select the file to be uploaded"
+msgstr "Choisir le fichier à envoyer"
+
+#: ../../../default.c:359
+msgid "Maximum allowed upload size"
+msgstr "Taille maximale d'envoi"
+
+#: ../../../default.c:362
+msgid "Upload"
+msgstr "Envoyer"
+
+#: ../../../default.c:368
+msgid "You can now proceed downloading the file"
+msgstr "Vous pouvez maintenant télécharger le fichier"
+
+#: ../../../default.c:383
+msgid "Download file"
+msgstr "Télécharger"
+
+#: ../../../default.c:395
+msgid "Complete upload"
+msgstr "Envoyer"
+
+#: ../../../default.c:398
+msgid "FILE HAS BEEN SUCCESSGULLY REMOVED"
+msgstr "LE FICHIER A ETE SUPPRIME AVEC SUCCES"
+
+#: ../../../default.c:431
+#: ../../../default.c:446
+msgid "Dear "
+msgstr "Cher"
+
+#: ../../../default.c:434
+#: ../../../default.c:449
+msgid "This e-mail message is sent to you to confirm your account registration has a valid e-mail address."
+msgstr "Ce message vous est envoyé pour confirmer que votre compte utilise une adresse de courriel valide"
+
+#: ../../../default.c:437
+#: ../../../default.c:452
+msgid "Open the following link in a browser to confirm your account."
+msgstr "Cliquez sur le lient suivant pour confirmer votre inscription."
+
+#: ../../../default.c:440
+#: ../../../default.c:455
+msgid "Best regards"
+msgstr "Salutation"
+
+#: ../../../default.c:461
+msgid "User login"
+msgstr "Authentification"
+
+#: ../../../default.c:464
+msgid "User name"
+msgstr "Nom complet"
+
+#: ../../../default.c:470
+msgid "Login"
+msgstr "Envoyer"
+
+#: ../../../default.c:473
+msgid "You don't have an account?"
+msgstr "Vous ne possédez pas de compte?"
+
+#: ../../../default.c:476
+msgid "Register here"
+msgstr "Inscrivez vous ici"
+
+#: ../../../default.c:479
+msgid "or you can"
+msgstr "sinon, vous pouvez"
+
+#: ../../../default.c:482
+msgid "Login here"
+msgstr "vous Authentifier ici"
+
+#: ../../../default.c:494
+msgid "Language"
+msgstr "Langue"
+
+#: ../../../default.c:497
+msgid "Change"
+msgstr "Changer"
+
+#: ../../../default.c:500
+msgid "Registration succeded"
+msgstr "Inscription effectuée avec succès"
+
+#: ../../../default.c:503
+msgid "An e-mail has been sent for the accout activation"
+msgstr "Un courriel de confirmation a été envoyé"
+
+#: ../../../default.c:506
+msgid "Please follow the e-mail instructions to activate your account."
+msgstr "Merci de suivre les instructions contenues dans le courriel pour activer votre compte."
+
+#: ../../../default.c:509
+msgid "back to home"
+msgstr "Retour à l'accueil"
+
+#: ../../../default.c:524
+msgid "Old password"
+msgstr "Ancien mot de passe"
+
+#: ../../../default.c:527
+msgid "New password"
+msgstr "Nouveau mot de passe"
+
+#: ../../../default.c:530
+msgid "Retype password"
+msgstr "Re-saisir le mot de passe"
+
+#: ../../../default.c:533
+msgid "Cancel"
+msgstr "Annuler"
+
+#: ../../../default.c:539
+msgid "Your account registration has been confirmed."
+msgstr "Votre inscription a été confirmée."
+
+#: ../../../default.c:542
+msgid "You can now proceed with the login"
+msgstr "Vous pouvez maintenant vous authentifier"
+
+#: ../../../default.c:545
+msgid "here"
+msgstr "ici"
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-14 19:09:58
|
Revision: 143
http://openupload.svn.sourceforge.net/openupload/?rev=143&view=rev
Author: tsdogs
Date: 2008-11-14 19:09:54 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Add french translation
Added Paths:
-----------
trunk/templates/default/locale/fr/
trunk/templates/default/locale/fr.inc.php
Added: trunk/templates/default/locale/fr.inc.php
===================================================================
--- trunk/templates/default/locale/fr.inc.php (rev 0)
+++ trunk/templates/default/locale/fr.inc.php 2008-11-14 19:09:54 UTC (rev 143)
@@ -0,0 +1,96 @@
+<?php
+$tr["Your IP has been blocked!"] = "Votre adresse IP a été bloquée!";
+$tr["You cannot use this site."] = "Vous ne pouvez utiliser ce site.";
+$tr["If you think this is a misconfiguration please send an email to the site owner"] = "Si vous pensez que c'est une erreur, merci d'envoyer un courriel au propriétaire du site";
+$tr["Captcha code"] = "Code Captcha";
+$tr["Reload Image"] = "Recharger l'image";
+$tr["Please enter the following captcha to proceed for the download"] = "Merci de saisir le code Captcha pour accéder au téléchargement";
+$tr["Use Captcha"] = "Protéger par code Captcha";
+$tr["The download is password protected."] = "Le fichier est protégé par un mot de passe.";
+$tr["Password"] = "Mot de passe";
+$tr["Password protect"] = "Protéger avec un mot de passe";
+$tr["You are receiving this message because someone uploaded a file on our OpenUpload server for you."] = "Vous recevez ce message car quelqu'un a mis un fichier à votre disposition sur notre serveur OpenUpload.";
+$tr["File ID"] = "Identifiant";
+$tr["File name"] = "Nom";
+$tr["File size"] = "Taille";
+$tr["Description"] = "Description";
+$tr["User message"] = "Message";
+$tr["To download the file open the following link in a browser"] = "Pour télécharger le fichier, copier le lien suivant dans un navigateur internet";
+$tr["To remove the file from our server open the following link in a browser"] = "Pour supprimer le fichier de notre serveur, copier le lient suivant dans un navigateur internet";
+$tr["For complains please send an email to"] = "En cas d'abus, merci d'envoyer un email à ";
+$tr["Send me an e-mail"] = "M'envoyer une copie du courriel";
+$tr["Your e-mail address"] = "Votre adresse courriel";
+$tr["Send e-mail to"] = "Envoyer un courriel à";
+$tr["Send remove link"] = "Envoyer un lien de suppression";
+$tr["e-mail Subject"] = "Sujet du courriel";
+$tr["e-mail Message"] = "Message du courriel";
+$tr["Only the following mime types are allowed"] = "Seul les types MIME suivants sont autorisés";
+$tr["Plugin"] = "Module";
+$tr["Group"] = "Groupe";
+$tr["Access"] = "Accès";
+$tr["Add"] = "Ajouter";
+$tr["IP"] = "Adresse IP";
+$tr["Priority"] = "Priorité";
+$tr["Confirm"] = "Confirmer";
+$tr["Name"] = "Nom complet";
+$tr["Plugins ACL"] = "Modules contrôle d'accès";
+$tr["Plugins Options"] = "Options des modules";
+$tr["Login name"] = "Nom utilisateur";
+$tr["Retype Password"] = "Re-saisir le mot de passe";
+$tr["Full Name"] = "Nom complet";
+$tr["e-mail"] = "Courriel";
+$tr["Preferred language"] = "Langue préférée";
+$tr["Active"] = "Actif";
+$tr["Module"] = "Module";
+$tr["Action"] = "Action";
+$tr["Settings"] = "Paramètres";
+$tr["Plugins"] = "Modules";
+$tr["Files"] = "Fichiers";
+$tr["Users"] = "Utilisateurs";
+$tr["Groups"] = "Groupes";
+$tr["Rights"] = "Droits";
+$tr["Banned"] = "Bannis";
+$tr["Here you can administer"] = "Outils d'administration";
+$tr["Banned IPs"] = "Adresse IP bloquées";
+$tr["You requested to remove the following file"] = "Vous avez demandé la suppression du fichier";
+$tr["File description"] = "Description du fichier";
+$tr["Uploaded on"] = "Envoyé le";
+$tr["Confirm removal"] = "Confirmer la suppression";
+$tr["Download link"] = "Lien de téléchargement";
+$tr["Remove link"] = "Lien de suppression";
+$tr["Upload a new file"] = "Envoyer un nouveau fichier";
+$tr["Please enter the File Information requested"] = "Merci de saisir les informations requises pour le fichier";
+$tr["File code"] = "Code fichier";
+$tr["Proceed"] = "Accepter";
+$tr["Select the file to be uploaded"] = "Choisir le fichier à envoyer";
+$tr["Maximum allowed upload size"] = "Taille maximale d'envoi";
+$tr["Upload"] = "Envoyer";
+$tr["You can now proceed downloading the file"] = "Vous pouvez maintenant télécharger le fichier";
+$tr["Download file"] = "Télécharger";
+$tr["Complete upload"] = "Envoyer";
+$tr["FILE HAS BEEN SUCCESSGULLY REMOVED"] = "LE FICHIER A ETE SUPPRIME AVEC SUCCES";
+$tr["Dear "] = "Cher";
+$tr["This e-mail message is sent to you to confirm your account registration has a valid e-mail address."] = "Ce message vous est envoyé pour confirmer que votre compte utilise une adresse de courriel valide";
+$tr["Open the following link in a browser to confirm your account."] = "Cliquez sur le lient suivant pour confirmer votre inscription.";
+$tr["Best regards"] = "Salutation";
+$tr["User login"] = "Authentification";
+$tr["User name"] = "Nom complet";
+$tr["Login"] = "Envoyer";
+$tr["You don't have an account?"] = "Vous ne possédez pas de compte?";
+$tr["Register here"] = "Inscrivez vous ici";
+$tr["or you can"] = "sinon, vous pouvez";
+$tr["Login here"] = "vous Authentifier ici";
+$tr["Language"] = "Langue";
+$tr["Change"] = "Changer";
+$tr["Registration succeded"] = "Inscription effectuée avec succès";
+$tr["An e-mail has been sent for the accout activation"] = "Un courriel de confirmation a été envoyé";
+$tr["Please follow the e-mail instructions to activate your account."] = "Merci de suivre les instructions contenues dans le courriel pour activer votre compte.";
+$tr["back to home"] = "Retour à l'accueil";
+$tr["Old password"] = "Ancien mot de passe";
+$tr["New password"] = "Nouveau mot de passe";
+$tr["Retype password"] = "Re-saisir le mot de passe";
+$tr["Cancel"] = "Annuler";
+$tr["Your account registration has been confirmed."] = "Votre inscription a été confirmée.";
+$tr["You can now proceed with the login"] = "Vous pouvez maintenant vous authentifier";
+$tr["here"] = "ici";
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-13 19:46:57
|
Revision: 142
http://openupload.svn.sourceforge.net/openupload/?rev=142&view=rev
Author: tsdogs
Date: 2008-11-13 19:46:51 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
fix password change problems
Modified Paths:
--------------
trunk/lib/modules/auth/default.inc.php
trunk/lib/modules/default/auth.inc.php
Modified: trunk/lib/modules/auth/default.inc.php
===================================================================
--- trunk/lib/modules/auth/default.inc.php 2008-11-12 18:56:31 UTC (rev 141)
+++ trunk/lib/modules/auth/default.inc.php 2008-11-13 19:46:51 UTC (rev 142)
@@ -47,7 +47,7 @@
$this->db->insert('users',$user,$this->userfields);
}
- function useredit($user,$pwd = false) {
+ function useredit(&$user,$pwd = false) {
if ($pwd) {
$user['password']=crypt($user['password']);
}
Modified: trunk/lib/modules/default/auth.inc.php
===================================================================
--- trunk/lib/modules/default/auth.inc.php 2008-11-12 18:56:31 UTC (rev 141)
+++ trunk/lib/modules/default/auth.inc.php 2008-11-13 19:46:51 UTC (rev 142)
@@ -247,6 +247,7 @@
$user['email']=$_POST['useremail'];
if ($_POST['newpassword']!='') {
$error = false;
+ $pwd = false;
if (strlen($_POST['newpassword'])<5) {
app()->error(tr('Password must be at least 5 charaters long!'));
$error = true;
@@ -259,10 +260,11 @@
} else {
app()->message(tr('Password has been changed!'));
$user['password']=$_POST['newpassword'];
+ $pwd = true;
}
}
if (!$error) {
- app()->auth->useredit($user,true);
+ app()->auth->useredit($user,$pwd);
app()->user->set($user);
$this->nextStep(1);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-12 18:56:35
|
Revision: 141
http://openupload.svn.sourceforge.net/openupload/?rev=141&view=rev
Author: tsdogs
Date: 2008-11-12 18:56:31 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
Add multiple file uploads at once
Modified Paths:
--------------
trunk/lib/main.inc.php
trunk/lib/modules/default/files.inc.php
trunk/plugins/mimetypes.inc.php
trunk/templates/default/modules/files/downloadConfirm.tpl
trunk/templates/default/modules/files/uploadForm.tpl
trunk/templates/default/modules/files/uploadOptions.tpl
trunk/www/setup.inc.php
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-11-12 18:54:35 UTC (rev 140)
+++ trunk/lib/main.inc.php 2008-11-12 18:56:31 UTC (rev 141)
@@ -367,6 +367,13 @@
$this->tpl->assign('script',$_SERVER['PHP_SELF']);
$this->tpl->assign('page',$this->page);
+ if (isset($this->config['multiupload'])) {
+ if ($this->config['multiupload']<=0)
+ $this->config['multiupload']=1;
+ $this->tpl->assign('multiupload',$this->config['multiupload']);
+ } else {
+ $this->config['multiupload']=1;
+ }
/* check for banned IP */
if ($this->banned() != 'allow') {
$this->page['content'] = $this->fetch('banned');
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-11-12 18:54:35 UTC (rev 140)
+++ trunk/lib/modules/default/files.inc.php 2008-11-12 18:56:31 UTC (rev 141)
@@ -62,7 +62,7 @@
global $_SESSION;
global $_FILES;
global $_SERVER;
-
+
if (isset($_FILES['upload'])) {
if ($_FILES['upload']['error']>0) {
switch ($_FILES['upload']['error']) { /* taken from here: http://it.php.net/manual/en/features.file-upload.errors.php */
@@ -78,28 +78,47 @@
}
$this->nextStep(1);
} else if ($_FILES['upload']['size']>app()->user->info('max_upload_size')) {
- app()->error(tr('Maximum file size exceeded!')); break;
+ app()->error(tr('Maximum file size exceeded!'));
+ break;
} else {
/* prepare the file */
$tmpname = app()->config['DATA_PATH'].'/tmp/'.randomName();
- move_uploaded_file($_FILES['upload']['tmp_name'],$tmpname);
- $_SESSION['user']['u']['tmp']=$tmpname;
- $_SESSION['user']['u']['mime']=$_FILES['upload']['type'];
- $_SESSION['user']['u']['name']=$_FILES['upload']['name'];
- $_SESSION['user']['u']['size']=$_FILES['upload']['size'];
- $_SESSION['user']['u']['ip']=$_SERVER['REMOTE_ADDR'];
- $_SESSION['user']['u']['user_login']=app()->user->info('login');
+ for ($i = 0; $i<app()->config['multiupload']; $i++) {
+ $u = 'upload';
+ $tmpnamex = $tmpname;
+ if ($i>0) {
+ $u = 'upload_'.$i;
+ $tmpnamex = $tmpname.'_'.$i;
+ }
+ if (isset($_FILES[$u]) and $_FILES[$u]['tmp_name']!='') {
+ move_uploaded_file($_FILES[$u]['tmp_name'],$tmpnamex);
+ $_SESSION['user']['u'][$i]['tmp']=$tmpnamex;
+ $_SESSION['user']['u'][$i]['mime']=$_FILES[$u]['type'];
+ $_SESSION['user']['u'][$i]['name']=$_FILES[$u]['name'];
+ $_SESSION['user']['u'][$i]['size']=$_FILES[$u]['size'];
+ $_SESSION['user']['u'][$i]['ip']=$_SERVER['REMOTE_ADDR'];
+ $_SESSION['user']['u'][$i]['user_login']=app()->user->info('login');
+ $result = app()->pluginAction('uploadComplete',$_SESSION['user']['u'][$i]);
+ if (!$result) { /* some plugin blocked the upload */
+ /* remove the file */
+ unset($_SESSION['user']['u']);
+ redirect();
+ }
+ }
+ }
$this->nextStep(app()->step);
}
- } else if (!isset($_SESSION['user']['u'])) {
+ } else if (!isset($_SESSION['user']['u'][0])) {
redirect();
}
- $result = app()->pluginAction('uploadOptions',$_SESSION['user']['u']);
+ $result = app()->pluginAction('uploadOptions',$_SESSION['user']['u'][0]);
if (!$result) { /* some plugin blocked the upload */
- /* remove the file */
+ /* remove the files */
+ unset($_SESSION['user']['u']);
redirect();
}
- $this->tpl->assign('finfo',$_SESSION['user']['u']);
+ $this->tpl->assign('finfo',$_SESSION['user']['u'][0]);
+ $this->tpl->assign('files',$_SESSION['user']['u']);
/* ask for information on the file */
}
@@ -112,37 +131,52 @@
/* display the information on the upload */
if (isset($_POST['description'])) {
/* move the file to the actual location */
- $finfo = $_SESSION['user']['u'];
- $finfo['description'] = $_POST['description'];
- /* now check plugins and if ok add file otherwise redirect */
- $result = app()->pluginAction('uploadConfirm',$finfo);
- if (!$result)
- $this->prevStep();
- /* everything ok then add the file */
- $finfo['id']= app()->db->newRandomId('files','id');
- $finfo['remove']= app()->db->newRandomId('files','remove');
- $finfo['upload_date'] = date('Y-m-d H:i:s');
- app()->db->insert('files',$finfo,array('id','name','mime','description','size','remove','user_login','ip','upload_date'));
- foreach (app()->plugins as $plugin) {
- if (count($plugin->fields)>0) {
- foreach ($plugin->fields as $f) {
- $pinfo['file_id'] = $finfo['id'];
- $pinfo['module'] = $plugin->name;
- $pinfo['name']=$f;
- $pinfo['value']=$finfo[$f];
- app()->db->insert('file_options',$pinfo,array('file_id','module','name','value'));
+ for ($i = 0; $i<count($_SESSION['user']['u']); $i++) {
+ $finfo = $_SESSION['user']['u'][$i];
+ $finfo['description'] = $_POST['description'];
+ /* now check plugins and if ok add file otherwise redirect */
+ if ($i==0) {
+ $result = app()->pluginAction('uploadConfirm',$finfo);
+ if (!$result)
+ $this->prevStep();
+ $finfo['id']= app()->db->newRandomId('files','id');
+ $mainid = $finfo['id'];
+ } else {
+ $finfo['id']=$mainid.'_'.$i;
+ }
+ /* everything ok then add the file */
+ $finfo['remove']= app()->db->newRandomId('files','remove');
+ $finfo['upload_date'] = date('Y-m-d H:i:s');
+ app()->db->insert('files',$finfo,array('id','name','mime','description','size','remove','user_login','ip','upload_date'));
+ if ($i==0) {
+ foreach (app()->plugins as $plugin) {
+ if (count($plugin->fields)>0) {
+ foreach ($plugin->fields as $f) {
+ $pinfo['file_id'] = $finfo['id'];
+ $pinfo['module'] = $plugin->name;
+ $pinfo['name']=$f;
+ $pinfo['value']=$finfo[$f];
+ app()->db->insert('file_options',$pinfo,array('file_id','module','name','value'));
+ }
+ }
}
+ } else {
+ $pinfo['file_id'] = $finfo['id'];
+ $pinfo['module'] = 'files';
+ $pinfo['name']='group';
+ $pinfo['value']=$mainid;
+ app()->db->insert('file_options',$pinfo,array('file_id','module','name','value'));
}
+ rename($_SESSION['user']['u'][$i]['tmp'],app()->config['DATA_PATH'].'/'.$finfo['id']);
+ $_SESSION['user']['u'][$i]=$finfo;
}
- rename($_SESSION['user']['u']['tmp'],app()->config['DATA_PATH'].'/'.$finfo['id']);
- $_SESSION['user']['u']=$finfo;
$this->nextStep();
}
}
function uploadFileInfo() {
- if (isset($_SESSION['user']['u']['id'])) {
- $finfo = $_SESSION['user']['u'];
+ if (isset($_SESSION['user']['u'][0]['id'])) {
+ $finfo = $_SESSION['user']['u'][0];
/* get the file info */
$finfo['downloadlink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?action=d&id='.$finfo['id'];
$finfo['removelink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?action=r&id='.$finfo['id'].'&removeid='.$finfo['remove'];
@@ -153,14 +187,21 @@
redirect();
}
}
-
+/**/
function loadFile($id) {
$finfo = app()->db->read('files',array('id'=>$id));
- $finfo = $finfo[0];
$pinfo = app()->db->read('file_options',array('file_id' => $id));
foreach ($pinfo as $v) {
- $finfo[$v['name']]=$v['value'];
+ $finfo[0][$v['name']]=$v['value'];
}
+ $afiles = app()->db->read('file_options',array('module' => 'files', 'name' => 'group', 'value' => $id));
+ if (count($afiles)>0) {
+ foreach ($afiles as $k => $a) {
+ $afile = app()->db->read('files',array('id'=>$a['file_id']));
+ $finfo[$k+1]=$afile[0];
+ }
+ }
+//print_r($finfo); exit();
return $finfo;
}
@@ -170,7 +211,7 @@
unset($_SESSION['user']['d']);
if (isset($_GET['id'])) {
- $_SESSION['user']['d']['id'] = $_GET['id'];
+ $_SESSION['user']['d'][0]['id'] = $_GET['id'];
$this->nextStep();
}
$finfo = array();
@@ -179,24 +220,26 @@
function downloadRequest() {
global $_GET;
+ global $_POST;
global $_SESSION;
-
+
$id = '';
if (isset($_POST['id'])) {
$id = $_POST['id'];
- } else if (isset($_SESSION['user']['d']['id'])) {
- $id = $_SESSION['user']['d']['id'];
+ } else if (isset($_SESSION['user']['d'][0]['id'])) {
+ $id = $_SESSION['user']['d'][0]['id'];
}
/* check if download exsists, and what are the properties */
if ($id != '') {
$finfo = $this->loadFile($id);
- if ($finfo['id']!=$id) {
+ if ($finfo[0]['id']!=$id) {
app()->error(tr('Requested file does not exsist!'));
$this->prevStep();
} else {
$_SESSION['user']['d']=$finfo;
- $this->tpl->assign('finfo',$finfo);
- $result = app()->pluginAction('downloadRequest',$finfo,false);
+ $this->tpl->assign('finfo',$finfo[0]);
+ $this->tpl->assign('files',$finfo);
+ $result = app()->pluginAction('downloadRequest',$finfo[0],false);
if ($result) {
$this->nextStep();
}
@@ -209,18 +252,20 @@
/* here we do the actual download of the file */
if (!isset($_SESSION['user']['d'])) {
redirect();
- } else if ($_SESSION['user']['d']['candownload']=='ok') {
+ } else if ($_SESSION['user']['d'][0]['candownload']=='ok') {
$finfo = $_SESSION['user']['d'];
- $this->tpl->assign('finfo',$finfo);
+ $this->tpl->assign('finfo',$finfo[0]);
+ $this->tpl->assign('files',$finfo);
/* download is allowed */
} else {
$finfo = $_SESSION['user']['d'];
/* check wether the plugins are ok */
- $result = app()->pluginAction('downloadConfirm',$finfo);
+ $result = app()->pluginAction('downloadConfirm',$finfo[0]);
if (!$result)
$this->prevStep();
+ for ($i = 0; $i<count($finfo); $i++)
+ $finfo[$i]['candownload']='ok';
$_SESSION['user']['d']=$finfo;
- $_SESSION['user']['d']['candownload']='ok';
/* now the user can download it */
$this->nextStep(app()->step);
}
@@ -229,21 +274,26 @@
function serveFile() {
global $_SESSION;
global $_POST;
+ global $_GET;
+ $num = 0;
+ if (isset($_GET['fid'])) {
+ $num = $_GET['fid'];
+ }
/* here we do the actual download of the file */
if (!isset($_SESSION['user']['d'])) {
redirect();
- } else if ($_SESSION['user']['d']['candownload']!='ok') {
+ } else if ($_SESSION['user']['d'][$num]['candownload']!='ok') {
$this->nextStep(2,'d');
} else {
$finfo = $_SESSION['user']['d'];
/* check wether the plugins are ok */
- $result = app()->pluginAction('serveFile',$finfo);
+ $result = app()->pluginAction('serveFile',$finfo[$num]);
if (!$result)
$this->nextStep(3,'d');
- $_SESSION['user']['d']['candownload']='ok';
+ $_SESSION['user']['d'][$num]['candownload']='ok';
/* if we got this far the download should begin serving */
- $file = app()->config['DATA_PATH'].'/'.$finfo['id'];
+ $file = app()->config['DATA_PATH'].'/'.$finfo[$num]['id'];
$filesize = filesize($file);
/* set to not timeout within default setting */
if (isset(app()->config['max_download_time'])) {
@@ -253,12 +303,12 @@
}
/* disable and clean output buffer so it won't reach memory limit */
ob_end_clean();
- header('Content-Type: '.$finfo['mime']);
+ header('Content-Type: '.$finfo[$num]['mime']);
header('Content-Length: '.$filesize);
- header('Content-Disposition: attachment; filename="'.$finfo['name'].'"');
+ header('Content-Disposition: attachment; filename="'.$finfo[$num]['name'].'"');
readfile($file);
/* file should have been sent now let's reset the download info */
- $_SESSION['user']['d']['candownload']='ko';
+ $_SESSION['user']['d'][$num]['candownload']='ko';
exit(0);
}
}
Modified: trunk/plugins/mimetypes.inc.php
===================================================================
--- trunk/plugins/mimetypes.inc.php 2008-11-12 18:54:35 UTC (rev 140)
+++ trunk/plugins/mimetypes.inc.php 2008-11-12 18:56:31 UTC (rev 141)
@@ -41,7 +41,7 @@
return true;
}
- function uploadOptions(&$finfo,$acl) {
+ function uploadComplete(&$finfo,$acl) {
if ($acl!='enable') return true;
$group = $this->getGroup();
if (count($this->config['allowed'][$group])==0) {
Modified: trunk/templates/default/modules/files/downloadConfirm.tpl
===================================================================
--- trunk/templates/default/modules/files/downloadConfirm.tpl 2008-11-12 18:54:35 UTC (rev 140)
+++ trunk/templates/default/modules/files/downloadConfirm.tpl 2008-11-12 18:56:31 UTC (rev 141)
@@ -1,14 +1,14 @@
{tr}You can now proceed downloading the file{/tr}:
<table border="0">
<tr><td>{tr}File description{/tr}:</td><td><b>{$finfo.description}</b></td></tr>
-<tr><td>{tr}File name{/tr}:</td><td><b>{$finfo.name}</b></td></tr>
-<tr><td>{tr}File size{/tr}:</td><td><b>{$finfo.size|fsize_format}</b></td></tr>
<tr><td>{tr}Uploaded on{/tr}:</td><td><b>{$finfo.upload_date}</b></td></tr>
{$plugins}
+{foreach from=$files item=f key=k}
+<tr><td>{tr}File name{/tr}:</td><td><b>{$f.name}</b></td></tr>
+<tr><td>{tr}File size{/tr}:</td><td><b>{$f.size|fsize_format}</b></td></tr>
+<td colspan="2" align="center"><a href="{$script}?action=g&fid={$k}">
+ <img src="{tpl file=/img/download.png}" border="0"><br>
+ {tr}Download file{/tr}</a></td></tr>
+{/foreach}
</table>
-<div id="downloadbutton"><br><center>
- <a href="{$script}?action=g">
- <img src="{tpl file=/img/download.png}" border="0"><br>
- {tr}Download file{/tr}</a></center>
-</div>
Modified: trunk/templates/default/modules/files/uploadForm.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadForm.tpl 2008-11-12 18:54:35 UTC (rev 140)
+++ trunk/templates/default/modules/files/uploadForm.tpl 2008-11-12 18:56:31 UTC (rev 141)
@@ -1,8 +1,12 @@
{literal}
<script>
-function unhide() {
- $obj = document.getElementById('uploadbutton');
- $obj.style.visibility = 'visible';
+function unhide(i) {
+ obj = document.getElementById('uploadbutton');
+ obj.style.visibility = 'visible';
+
+ obj = document.getElementById('upload_'+i);
+ if (obj)
+ obj.style.visibility = 'visible';
}
</script>
{/literal}
@@ -14,8 +18,18 @@
<input type="hidden" name="MAX_FILE_SIZE" value="{$user.max_upload_size}">
{/if}
{tr}Select the file to be uploaded{/tr}<br>
- <input type="file" class="file" size="60" name="upload" onchange="if (this.value!='') unhide();"><br>
+ <input type="file" class="file" size="60" name="upload" onchange="if (this.value!='') unhide(1);"><br>
+{if isset($multiupload)}
+{section name=i start=1 loop=$multiupload}
{if isset($user.max_upload_size)}
+<div id="upload_{$smarty.section.i.index}" style="visibility: hidden">
+<input type="hidden" name="MAX_FILE_SIZE" value="{$user.max_upload_size}">
+{/if}
+<input type="file" class="file" size="60" name="upload_{$smarty.section.i.index}" onchange="if (this.value!='') unhide({$smarty.section.i.index+1});"><br>
+</div>
+{/section}
+{/if}
+{if isset($user.max_upload_size)}
<div id="msg">{tr}Maximum allowed upload size{/tr}: {$user.max_upload_size|fsize_format:"MB":0}</div>
{/if}
{$plugins}
Modified: trunk/templates/default/modules/files/uploadOptions.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadOptions.tpl 2008-11-12 18:54:35 UTC (rev 140)
+++ trunk/templates/default/modules/files/uploadOptions.tpl 2008-11-12 18:56:31 UTC (rev 141)
@@ -3,8 +3,10 @@
<input type="hidden" name="action" value="{$action}">
<input type="hidden" name="step" value="{$nextstep}">
<table border="0">
-<tr><td>{tr}File name{/tr}:</td><td>{$finfo.name}</td></tr>
-<tr><td>{tr}File size{/tr}:</td><td>{$finfo.size|fsize_format}</td></tr>
+{foreach from=$files item=f}
+<tr><td>{tr}File name{/tr}:</td><td>{$f.name}</td></tr>
+<tr><td>{tr}File size{/tr}:</td><td>{$f.size|fsize_format}</td></tr>
+{/foreach}
<tr><td>{tr}Description{/tr}:</td><td><input id="description" type="text" size="30" name="description" value="{$finfo.description}"></td></tr>
{$plugins}
<tr><td colspan="2" align="right"><input class="submit" type="submit" value="{tr}Complete upload{/tr}"></td></tr>
Modified: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php 2008-11-12 18:54:35 UTC (rev 140)
+++ trunk/www/setup.inc.php 2008-11-12 18:56:31 UTC (rev 141)
@@ -205,7 +205,7 @@
'dropdb' => 'DROP DATABASE "%1"',
'createdb' => 'CREATE DATABASE "%1"',
'dropuser' => '',
- 'createuser' => 'GRANT ALL PRIVILEGES TO "%1"@"localhost" ON %2.* IDENTIFIED BY "%3"',
+ 'createuser' => '',
'grant' => '',
'droptable' => 'DROP TABLE IF EXISTS `%2`',
);
@@ -448,10 +448,12 @@
unset($CONFIG['database']['name']);
} else {
unset($CONFIG['database']['rootdir']);
- $CONFIG['database']['host'] = 'localhost';
- $CONFIG['database']['user'] = '';
- $CONFIG['database']['password'] = '';
- $CONFIG['database']['name'] = 'openupload';
+ if (!isset($CONFIG['database']['host'])) {
+ $CONFIG['database']['host'] = 'localhost';
+ $CONFIG['database']['user'] = '';
+ $CONFIG['database']['password'] = '';
+ $CONFIG['database']['name'] = 'openupload';
+ }
}
return $step+1;
}
@@ -572,6 +574,7 @@
$CONFIG['registration']['email_confirm']=isset($_POST['confirmregistration'])?$_POST['confirmregistration']:'no';
$CONFIG['max_upload_size']=$_POST['max_upload_size'];
$CONFIG['max_download_time']=$_POST['max_download_time'];
+ $CONFIG['multiupload']=$_POST['max_download_time'];
if ($CONFIG['translator']=='') {
$error = true;
@@ -597,6 +600,10 @@
$error = true;
msg('Please insert a maximum download time','fail');
}
+ if ($CONFIG['multiupload']<1) {
+ $error = true;
+ msg('Please insert a max number of uploaded files per upload','fail');
+ }
if (!$error) {
return $step+1;
}
@@ -612,6 +619,7 @@
$CONFIG['registration']['email_confirm']='yes';
$CONFIG['max_upload_size']=100;
$CONFIG['max_download_time']=120;
+ $CONFIG['multiupload']=1;
}
?>
<form method="POST" action="index.php">
@@ -654,6 +662,7 @@
<tr><td>Template Footer:</td><td><textarea name="sitefooter" cols="50" rows="5"><?php echo $CONFIG['site']['footer']; ?></textarea></td></tr>
<tr><td>Maximum upload size (in MB):</td><td><input type="text" name="max_upload_size" value="<?php echo $CONFIG['max_upload_size']; ?>"></td></tr>
<tr><td>Maximum download time (in Min)<br>0 disables it:</td><td><input type="text" name="max_download_time" value="<?php echo $CONFIG['max_download_time']; ?>"></td></tr>
+<tr><td>Max num. of file uploaded per upload:</td><td><input type="text" name="multiupload" value="<?php echo $CONFIG['multiupload']; ?>"></td></tr>
<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
</table>
</form>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-12 18:54:39
|
Revision: 140
http://openupload.svn.sourceforge.net/openupload/?rev=140&view=rev
Author: tsdogs
Date: 2008-11-12 18:54:35 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
missing images for setup script
Added Paths:
-----------
trunk/www/templates/default/img/setup/index.html
Added: trunk/www/templates/default/img/setup/index.html
===================================================================
--- trunk/www/templates/default/img/setup/index.html (rev 0)
+++ trunk/www/templates/default/img/setup/index.html 2008-11-12 18:54:35 UTC (rev 140)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>NO ACCESS</title>
+<meta http-equiv="REFRESH" content="0;url=../../../../"></HEAD>
+<BODY>
+No direct access is allowed on this folder.
+</BODY>
+</HTML>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-12 18:53:47
|
Revision: 139
http://openupload.svn.sourceforge.net/openupload/?rev=139&view=rev
Author: tsdogs
Date: 2008-11-12 18:53:42 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
missing images for setup script
Added Paths:
-----------
trunk/www/templates/default/img/setup/current.png
trunk/www/templates/default/img/setup/fail.png
trunk/www/templates/default/img/setup/ok.png
trunk/www/templates/default/img/setup/step.png
Added: trunk/www/templates/default/img/setup/current.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/setup/current.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/setup/fail.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/setup/fail.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/setup/ok.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/setup/ok.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/setup/step.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/setup/step.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-12 18:53:08
|
Revision: 138
http://openupload.svn.sourceforge.net/openupload/?rev=138&view=rev
Author: tsdogs
Date: 2008-11-12 18:53:03 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
missing images for setup script
Added Paths:
-----------
trunk/www/templates/default/img/setup/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-12 12:44:10
|
Revision: 137
http://openupload.svn.sourceforge.net/openupload/?rev=137&view=rev
Author: tsdogs
Date: 2008-11-12 12:44:00 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
Add first version of setup script (only mysql is supported)
Modified Paths:
--------------
trunk/index.php
trunk/www/index.php
Added Paths:
-----------
trunk/www/setup.inc.php
Modified: trunk/index.php
===================================================================
--- trunk/index.php 2008-11-12 12:43:04 UTC (rev 136)
+++ trunk/index.php 2008-11-12 12:44:00 UTC (rev 137)
@@ -29,6 +29,6 @@
* @package OpenUpload
* @version 0.3
*/
-
+ define('__NOT_MAIN_SCRIPT',true);
require_once('www/index.php');
?>
Modified: trunk/www/index.php
===================================================================
--- trunk/www/index.php 2008-11-12 12:43:04 UTC (rev 136)
+++ trunk/www/index.php 2008-11-12 12:44:00 UTC (rev 137)
@@ -30,13 +30,8 @@
* @version 0.3
*/
-define ('__VALID_CALLING_SCRIPT', true);
+define ('__VALID_CALLING_SCRIPT',true);
-require_once('config.inc.php');
-require_once($CONFIG['INSTALL_ROOT'].'/lib/general.inc.php');
-
-global $application;
-
/* check authentication */
if (isset($_GET['action'])) {
$action = $_GET['action'];
@@ -52,8 +47,19 @@
} else {
$step = '';
}
-
-new Application($CONFIG);
-app()->run($action,$step);
+$configfile = 'config.inc.php';
+if (defined('__NOT_MAIN_SCRIPT'))
+ $configfile = 'www/'.$configfile;
+if (file_exists($configfile)) {
+ require_once($configfile);
+ require_once($CONFIG['INSTALL_ROOT'].'/lib/general.inc.php');
+ global $application;
+ new Application($CONFIG);
+ app()->run($action,$step);
+} else {
+ require_once('setup.inc.php');
+}
+
+
?>
Added: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php (rev 0)
+++ trunk/www/setup.inc.php 2008-11-12 12:44:00 UTC (rev 137)
@@ -0,0 +1,1250 @@
+<?php
+
+if (!defined('__VALID_CALLING_SCRIPT')) die('DIRECT ACCESS IS DENIED');
+
+ob_start();
+session_start();
+
+$steps = array (
+ 1 => array (
+ 'title' => "Welcome",
+ 'function' => 'welcome',
+ ),
+ 2 => array (
+ 'title' => "PHP Setup check",
+ 'function' => 'setupcheck',
+ ),
+ 3 => array (
+ 'title' => "Paths",
+ 'function' => 'paths',
+ ),
+ 4 => array (
+ 'title' => "Database Type",
+ 'function' => 'databasetype',
+ ),
+ 5 => array (
+ 'title' => "Database Options",
+ 'function' => 'databaseoptions',
+ ),
+ 6 => array (
+ 'title' => "Application options",
+ 'function' => 'options',
+ ),
+ 7 => array (
+ 'title' => "Users",
+ 'function' => "users",
+ ),
+ 8 => array (
+ 'title' => "Plugins",
+ 'function' => "plugins",
+ ),
+ 9 => array (
+ 'title' => "Database inizialization",
+ 'function' => "createdb",
+ ),
+ 10 => array (
+ 'title' => "Save configuration",
+ 'function' => 'save',
+ ),
+);
+
+/* DATABASE INITIALIZATION QUERY */
+$MYSQL_QUERY = array (
+ 'dropdb' => 'DROP DATABASE IF EXISTS `%1`',
+ 'createdb' => 'CREATE DATABASE `%1`',
+ 'dropuser' => '',
+ 'createuser' => '',
+ 'grant' => 'GRANT ALL PRIVILEGES ON %2.* TO "%1"@"localhost" IDENTIFIED BY "%3"',
+ 'droptable' => 'DROP TABLE IF EXISTS `%1%2`',
+ 'structure' => array (
+ 'acl' => 'CREATE TABLE `%1acl` (
+ `id` int(11) NOT NULL auto_increment,
+ `module` varchar(100) NOT NULL,
+ `action` varchar(100) NOT NULL,
+ `group_name` varchar(50) NOT NULL,
+ `access` varchar(10) NOT NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
+ 'banned' => 'CREATE TABLE `%1banned` (
+ `id` int(11) NOT NULL auto_increment,
+ `ip` varchar(50) NOT NULL,
+ `access` varchar(50) NOT NULL,
+ `priority` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
+ 'files' => 'CREATE TABLE `%1files` (
+ `id` varchar(100) NOT NULL,
+ `name` varchar(200) NOT NULL,
+ `mime` varchar(200) NOT NULL,
+ `description` tinytext NOT NULL,
+ `size` int(12) NOT NULL,
+ `remove` varchar(100) NOT NULL,
+ `user_login` varchar(100) NOT NULL,
+ `ip` varchar(40) NOT NULL,
+ `upload_date` datetime NOT NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1',
+ 'file_options' => 'CREATE TABLE `%1file_options` (
+ `id` bigint(20) NOT NULL auto_increment,
+ `file_id` varchar(100) NOT NULL,
+ `module` varchar(50) NOT NULL,
+ `name` varchar(50) NOT NULL,
+ `value` varchar(200) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `file_id` (`file_id`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
+ 'groups' => 'CREATE TABLE `%1groups` (
+ `name` varchar(50) NOT NULL,
+ `description` varchar(250) default NULL,
+ PRIMARY KEY (`name`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1',
+ 'langs' => 'CREATE TABLE `%1langs` (
+ `id` varchar(10) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ `locale` varchar(10) NOT NULL,
+ `browser` varchar(200) default NULL,
+ `charset` varchar(50) NOT NULL,
+ `active` tinyint(1) NOT NULL default \'1\',
+ PRIMARY KEY (`id`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1',
+ 'plugin_acl' => 'CREATE TABLE `%1plugin_acl` (
+ `id` int(11) NOT NULL auto_increment,
+ `group_name` varchar(50) NOT NULL,
+ `plugin` varchar(100) NOT NULL,
+ `access` varchar(10) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `group_name` (`group_name`,`plugin`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
+ 'plugin_options' => 'CREATE TABLE `%1plugin_options` (
+ `id` int(11) NOT NULL auto_increment,
+ `plugin` varchar(100) NOT NULL,
+ `group_name` varchar(100) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ `value` text,
+ PRIMARY KEY (`id`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
+ 'users' => 'CREATE TABLE `%1users` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `login` varchar(100) NOT NULL,
+ `password` varchar(100) NOT NULL,
+ `name` varchar(200) NOT NULL,
+ `group_name` varchar(50) NOT NULL default \'registered\',
+ `email` varchar(250) NOT NULL,
+ `lang` varchar(10) NOT NULL default \'en\',
+ `reg_date` datetime NOT NULL,
+ `regid` varchar(50) NOT NULL default \'\',
+ `active` tinyint(3) unsigned NOT NULL default \'1\',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `login` (`login`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
+ ),
+ 'base' => array (
+ "INSERT INTO `%0banned` (`id`, `ip`, `access`, `priority`) VALUES(1, '127.0.0.1', 'allow', 1)",
+ "INSERT INTO `%0banned` (`id`, `ip`, `access`, `priority`) VALUES(2, '0.0.0.0/0', 'allow', 9999999)",
+ "INSERT INTO `%0groups` (`name`, `description`) VALUES('%3', 'Administrators group')",
+ "INSERT INTO `%0groups` (`name`, `description`) VALUES('%4', 'Registered Users')",
+ "INSERT INTO `%0groups` (`name`, `description`) VALUES('%5', 'Unregistered users')",
+ "INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('en', 'English', 'en_EN', '[en];[en-EN]', 'iso-8559-1', 1)",
+ "INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('it', 'Italiano', 'it_IT.utf8', '[it];[it-IT]', 'utf8', 1)",
+ "INSERT INTO `%0users` (`id`, `login`, `password`, `name`, `group_name`, `email`, `lang`, `reg_date`, `regid`, `active`) VALUES(1, '%1', '%2', 'Administrator', '%3', '%6', 'en', now(), '', 1)",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(1, '*', '*', '%3', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(2, 'admin', '*', '%3', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(3, 'admin', '*', '*', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(4, 'auth', 'login', '%5', 'allow')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(1, '%3', 'password', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(2, '%3', 'captcha', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(3, '%3', 'email', 'enable')",
+ "INSERT INTO `%0plugin_options` (`id`, `plugin`, `group_name`, `name`, `value`) VALUES (1, 'mimetypes', '%5', 'message', 'Pdf, JPEG')",
+ "INSERT INTO `%0plugin_options` (`id`, `plugin`, `group_name`, `name`, `value`) VALUES (2, 'mimetypes', '%5', 'allowed', 'application/pdf
+image/jpeg')",
+ ),
+ 'mode_1' => array (
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', '%5', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', '*', '%5', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', '*', '*', 'allow')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%4', 'password', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%4', 'captcha', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%4', 'email', 'enable')",
+ ),
+ 'mode_2' => array (
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', '%5', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', 'd', '%5', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', 'g', '%5', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(10, 'files', '*', '%5', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(11, 'files', '*', '*', 'allow')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%4', 'password', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%4', 'captcha', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%4', 'email', 'enable')",
+ ),
+ 'mode_3' => array (
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '%5', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', '%5', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', 'register', '*', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'auth', '*', '*', 'allow')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', '*', '*', 'allow')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%4', 'password', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%4', 'captcha', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%4', 'email', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(7, '%5', 'mimetypes', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(8, '%5', 'captcha', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(9, '%5', 'password', 'enable')",
+),
+ 'mode_4' => array (
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', '*', '*', 'deny')",
+ "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'files', '*', '*', 'allow')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%5', 'password', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%5', 'captcha', 'enable')",
+ "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%5', 'email', 'enable')",
+ ),
+);
+$PGSQL_QUERY = array (
+ 'dropdb' => 'DROP DATABASE "%1"',
+ 'createdb' => 'CREATE DATABASE "%1"',
+ 'dropuser' => '',
+ 'createuser' => 'GRANT ALL PRIVILEGES TO "%1"@"localhost" ON %2.* IDENTIFIED BY "%3"',
+ 'grant' => '',
+ 'droptable' => 'DROP TABLE IF EXISTS `%2`',
+);
+
+
+/* try to guess the appropriate settings from the $_SERVER */
+$step = (isset($_GET['step']))?$_GET['step']:1;
+$step = (isset($_POST['step']))?$_POST['step']:$step;
+
+if ($step =='') $step = 1;
+
+$path = 'templates/default';
+if (defined('__NOT_MAIN_SCRIPT')) {
+ $path = 'www/'.$path;
+}
+
+$CONFIG = $_SESSION['config'];
+
+/********************* SUPPORT FUNCTIONS *****************************/
+
+function msg($str,$type = '') {
+ global $path;
+ echo '<div id="message">';
+ if ($type != '') {
+ echo '<img src="'.$path.'/img/setup/'.$type.'.png"> ';
+ }
+ echo $str.'</div>';
+}
+
+function listModules($path,$ext = 'inc.php') {
+ /* now list the available database types */
+ $dir = opendir($path);
+ $result = array();
+ while ($d = readdir($dir)) {
+ if ($ext != '') {
+ $n = explode('.',$d,2);
+ if ($n[1]==$ext)
+ $result[] = $n[0];
+ } else {
+ $result[] = $d;
+ }
+ }
+ closedir($dir);
+ return $result;
+}
+
+/************************ SETUP FUNCTIONS ********************/
+
+function welcome($step) {
+ global $_POST;
+ if (isset($_POST['step'])) {
+ return $step+1;
+ }
+?>
+<div id="message">
+Now to get started using OpenUpload you need to enter a few setup information...
+</div>
+<div id="message">
+Click on the Next button to proceed installing OpenUpload.
+</div>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<div><input type="submit" value="Next >>"></div>
+</form>
+<?php
+ return $step;
+}
+
+function setupcheck($step) {
+ global $_POST;
+
+ $message = 'Let\'s check your php installation';
+ if (isset($_POST['check'])) {
+ /* we do some php installation checks */
+ echo '<div id="message"><b>PHP INI Settings</b></div>';
+ if (ini_get('file_uploads') == 1) {
+ msg('File Uploads are enabled','ok');
+ } else {
+ msg('File Uploads are disable','fail');
+ msg('Please check your php.ini setting: file_uploads');
+ }
+ $msg = 'upload_max_filesize value is set to ';
+ msg($msg.': '.ini_get('upload_max_filesize'));
+ $msg = 'post_max_size value is set to ';
+ msg($msg.': '.ini_get('post_max_size'));
+ if (ini_get('register_globals') == 0) {
+ msg('Register globals disabled','ok');
+ } else {
+ msg('Register globals enabled','fail');
+ msg('Though the application should work with this set please consider disabling it');
+ }
+ echo '<div id="message"><b>Optional Values</b></div>';
+ if (function_exists('mysql_connect')) {
+ msg('MYSQL Support: exsists','ok');
+ } else {
+ msg('MYSQL Support: not found','fail');
+ msg('MYSQL is needed if you plan to use mysql');
+ }
+ if (function_exists('pg_connect')) {
+ msg('POSTGRESQL Support: exsists','ok');
+ } else {
+ msg('POSTGRESQL Support: not found','fail');
+ msg('POSTGRESQL is needed if you plan to use postgresql');
+ }
+ if (function_exists('ldap_connect')) {
+ msg('LDAP Support: exsists','ok');
+ } else {
+ msg('LDAP Support: not found','fail');
+ msg('LDAP is needed for LDAP and AD support');
+ }
+ if (function_exists('imagecreate')) {
+ msg('GD Support: exsists','ok');
+ } else {
+ msg('GD Support: not found','fail');
+ msg('GD is needed for captcha plugin');
+ }
+ echo '<hr>';
+ $checked = true;
+ $message ='If everything looks good proceed!';
+ }
+
+ if (isset($_POST['proceed'])) {
+ return $step+1;
+ }
+?>
+<div id="message">
+<?php echo $message; ?>
+</div>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<?php if ($checked) { ?>
+<input type="submit" name="check" value="Check Again">
+<input type="submit" name="proceed" value="Next >>">
+<?php } else { ?>
+<input type="submit" name="check" value="Check">
+<?php } ?>
+</form>
+<?php
+}
+
+/* INSTALLATION AND WWW PATHS */
+function guessPaths($CONFIG) {
+ global $_SERVER;
+
+echo 'guessing';
+ $srvname = $_SERVER['SERVER_NAME']; /* localhost */
+ $srvport = $_SERVER['SERVER_PORT']; /* 80 or 443 */
+
+ $http = 'http://';
+ if ($srvport == '443') {
+ $http = 'https://';
+ $srvport = '';
+ }
+ if ($srvport == '80')
+ $srvport = '';
+
+ $script = $_SERVER['SCRIPT_FILENAME']; /* full path to script */
+ /* remove index.php from script */
+ if (strpos($script,'index.php')!==FALSE)
+ $script = substr($script,0,strpos($script,'index.php')-1);
+
+ if (!defined('__NOT_MAIN_SCRIPT')) {
+ if (strpos($script,'/www')==strlen($script)-4) {
+ $script = substr($script,0,strlen($script)-4);
+ }
+ }
+
+ $uri = $_SERVER['REQUEST_URI'];
+
+ if (strpos($uri,'index.php')!==FALSE)
+ $uri = substr($uri,0,strpos($uri,'index.php')-1);
+
+ if (defined('__NOT_MAIN_SCRIPT'))
+ $uri .= '/www';
+
+ $CONFIG['WWW_SERVER']=$http.$srvname.($srvport!=''?$srvport:'');
+ $CONFIG['WWW_ROOT']=$uri;
+ $CONFIG['INSTALL_ROOT']=$script;
+ $CONFIG['DATA_PATH']=$script.'/data';
+ return $CONFIG;
+}
+
+function paths($step) {
+ global $_POST;
+ global $CONFIG;
+ global $_SESSION;
+
+ if (!isset($_POST['install_root'])) {
+ if (!isset($CONFIG['INSTALL_ROOT'])) {
+ $CONFIG = guessPaths($CONFIG);
+ }
+ } else {
+ $CONFIG['WWW_SERVER']=$_POST['www_server'];
+ $CONFIG['WWW_ROOT']=$_POST['www_root'];
+ $CONFIG['INSTALL_ROOT']=$_POST['install_root'];
+ $CONFIG['DATA_PATH']=$_POST['data_path'];
+
+ /* now check for correctness of the settings */
+ /* if ok go to next step */
+ return $step+1;
+ }
+
+ /* now I need to display and ask confirmation of the values */
+?>
+<div id="message">
+Here you must specify the paths of your installation.<br>
+Guessed values might be wrong on some circumstances so please make sure they are ok.
+</div>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<table border="0">
+<TR><TD>Install PATH:<br>(Where lib,templates,etc are)</TD>
+ <TD><input type="text" name="install_root" size="50" value="<?php echo $CONFIG['INSTALL_ROOT']; ?>"></TD></TR>
+<TR><TD>WWW Server URL:</TD>
+ <TD><input type="text" name="www_server" size="50" value="<?php echo $CONFIG['WWW_SERVER']; ?>"></TD></TR>
+<TR><TD>WWW Root Path <br>(where setup.php is):</TD>
+ <TD><input type="text" name="www_root" size="50" value="<?php echo $CONFIG['WWW_ROOT']; ?>"></TD></TR>
+<TR><TD>DATA PATH:</TD>
+ <TD><input type="text" name="data_path" size="50" value="<?php echo $CONFIG['DATA_PATH']; ?>"></TD></TR>
+<TR><TD colspan="2"><input type="submit" value="Next >>"</TD></TR>
+</table>
+</form>
+<?php
+ return $step;
+}
+
+/* DATABASE SETUP */
+
+function databasetype($step) {
+ global $CONFIG;
+ global $_POST;
+
+ if (isset($_POST['dbtype'])) {
+ $CONFIG['database']['type']=$_POST['dbtype'];
+ if ($CONFIG['database']['type']=='txt') {
+ $CONFIG['database']['rootdir']=$CONFIG['INSTALL_ROOT'].'/txtdb';
+ unset($CONFIG['database']['host']);
+ unset($CONFIG['database']['user']);
+ unset($CONFIG['database']['password']);
+ unset($CONFIG['database']['name']);
+ } else {
+ unset($CONFIG['database']['rootdir']);
+ $CONFIG['database']['host'] = 'localhost';
+ $CONFIG['database']['user'] = '';
+ $CONFIG['database']['password'] = '';
+ $CONFIG['database']['name'] = 'openupload';
+ }
+ return $step+1;
+ }
+ $db = listModules($CONFIG['INSTALL_ROOT'].'/lib/modules/db');
+?>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<table border="0">
+<TR><TD>Database Type:</TD>
+<td><select name='dbtype'><option value="">-- Select one --</option>
+<?php foreach ($db as $d) {
+ $selected = $CONFIG['database']['type']==$d?'selected':'';
+ echo '<option value="'.$d.'" '.$selected.'>'.$d.'</option>';
+} ?>
+</select></td>
+</TR>
+<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
+</table>
+</form>
+<?php
+}
+
+
+function databaseoptions($step) {
+ global $CONFIG;
+ global $_POST;
+ global $_SESSION;
+
+ if (isset($_POST['dbhost'])) {
+ $CONFIG['database']['host']=$_POST['dbhost'];
+ $CONFIG['database']['user']=$_POST['dbusername'];
+ if ($_POST['dbpassword']!='')
+ $CONFIG['database']['password']=$_POST['dbpassword'];
+ $CONFIG['database']['name']=$_POST['dbname'];
+ $CONFIG['database']['prefix']=$_POST['dbprefix'];
+ $_SESSION['options']['rootuser']=$_POST['rootuser'];
+ if ($_POST['rootpassword']!='')
+ $_SESSION['options']['rootpassword']=$_POST['rootpassword'];
+ $_SESSION['options']['newdb']=$_POST['newdb'];
+ $_SESSION['options']['newuser']=$_POST['newuser'];
+ $_SESSION['options']['populate']=$_POST['populate'];
+ if (isset($_POST['test'])) {
+ if ($_SESSION['options']['newdb']==1) {
+ $user = $_SESSION['options']['rootuser'];
+ $pwd = $_SESSION['options']['rootpassword'];
+ if ($CONFIG['database']['type']=='mysql')
+ $dbn = 'mysql';
+ else
+ $dbn = 'postgres';
+ } else {
+ $user = $CONFIG['database']['user'];
+ $pwd = $CONFIG['database']['password'];
+ $dbn = $CONFIG['database']['name'];
+ }
+ if (dbconnect($CONFIG['database']['host'],$user,$pwd,$dbn,true)) {
+ msg('Database connection SUCCESSFULL.','ok');
+ } else {
+ msg('Database connection failed ','fail');
+ }
+ } else {
+ /* check the values */
+ return $step+1;
+ }
+ }
+ //TODO: ask the db class for parameters
+?>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<table border="0">
+<TR><TD>Database Type:</TD>
+ <td><?php echo $CONFIG['database']['type']; ?></td></tr>
+<?php if ($CONFIG['database']['type']=='txt') { ?>
+<TR><TD>DB File Path:</TD><TD><input type="text" size="50" name="dbrootdir" value="<?php echo $CONFIG['database']['rootdir']; ?>"></TD></TR>
+<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
+<?php } else { ?>
+<TR><TD>Host:</TD><TD><input type="text" size="30" name="dbhost" value="<?php echo $CONFIG['database']['host']; ?>"></TD></TR>
+<TR><TD>Username:</TD><TD><input type="text" size="30" name="dbusername" value="<?php echo $CONFIG['database']['user']; ?>"></TD></TR>
+<TR><TD>Password:</TD><TD><input type="password" size="30" name="dbpassword" value=""></TD></TR>
+<TR><TD>DB Name:</TD><TD><input type="text" size="30" name="dbname" value="<?php echo $CONFIG['database']['name']; ?>"></TD></TR>
+<TR><TD>Table prefix:</TD><TD><input type="text" size="30" name="dbprefix" value="<?php echo $CONFIG['database']['prefix']; ?>"></TD></TR>
+<TR><TD>Create the database?</TD><TD><input type="checkbox" name="newdb" value="1" <?php if ($_SESSION['options']['newdb']==1) echo 'checked'; ?>></TD></TR>
+<TR><TD>Also create user?</TD><TD><input type="checkbox" name="newuser" value="1" <?php if ($_SESSION['options']['newuser']==1) echo 'checked'; ?>></TD></TR>
+<TR><TD>DB Admin user:</TD><TD><input type="text" name="rootuser" value="<?php echo $_SESSION['options']['rootuser']; ?>"></TD></TR>
+<TR><TD>DB Admin password:</TD><TD><input type="password" name="rootpassword" value=""></TD></TR>
+<TR><TD>Populate database</TD><TD>
+<select name="populate">
+<?php $opt = array("No","Structure only","Base System data","Private mode","Restricted mode","Service mode","Public mode");
+ foreach ($opt as $k => $v) {
+ echo '<option value="'.$k.'" '.($k==$_SESSION['options']['populate']?'selected':'').'>'.$v.'</option>';
+ }
+?>
+</select>
+</TD></TR>
+<TR><TD colspan="2"><input type="submit" name="test" value="Test connection"> <input type="submit" value="Next >>"></TD></TR>
+<?php } ?>
+</table>
+</form>
+<?php
+}
+
+function options($step) {
+ global $_POST;
+ global $CONFIG;
+
+ $tr = listModules($CONFIG['INSTALL_ROOT'].'/lib/modules/tr');
+ $auth = listModules($CONFIG['INSTALL_ROOT'].'/lib/modules/auth');
+ $templates = listModules($CONFIG['INSTALL_ROOT'].'/templates','');
+
+ if (isset($_POST['translator'])) {
+ $error = false;
+ $CONFIG['translator']=$_POST['translator'];
+ $CONFIG['auth']=$_POST['auth'];
+ $CONFIG['defaultlang']=$_POST['defaultlang'];
+ $CONFIG['site']['title']=$_POST['sitetitle'];
+ $CONFIG['site']['webmaster']= $_POST['webmaster'];
+ $CONFIG['site']['email']= $_POST['email'];
+ $CONFIG['site']['footer']=str_replace('\"','"',$_POST['sitefooter']);
+ $CONFIG['registration']['email_confirm']=isset($_POST['confirmregistration'])?$_POST['confirmregistration']:'no';
+ $CONFIG['max_upload_size']=$_POST['max_upload_size'];
+ $CONFIG['max_download_time']=$_POST['max_download_time'];
+
+ if ($CONFIG['translator']=='') {
+ $error = true;
+ msg('Please select a translator','fail');
+ }
+ if ($CONFIG['auth']=='') {
+ $error = true;
+ msg('Please select an authentication module','fail');
+ }
+ if ($CONFIG['site']['webmaster']=='') {
+ $error = true;
+ msg('Please insert a webmaster e-mail address','fail');
+ }
+ if ($CONFIG['site']['email']=='') {
+ $error = true;
+ msg('Please insert a site e-mail address','fail');
+ }
+ if ($CONFIG['max_upload_size']=='') {
+ $error = true;
+ msg('Please insert a maximum default upload size','fail');
+ }
+ if ($CONFIG['max_download_time']=='') {
+ $error = true;
+ msg('Please insert a maximum download time','fail');
+ }
+ if (!$error) {
+ return $step+1;
+ }
+ } else if (!isset($CONFIG['site']['title'])) {
+ /* init default values */
+ $CONFIG['translator']='phparray';
+ $CONFIG['auth']='default';
+ $CONFIG['defaultlang']='en';
+ $CONFIG['site']['title']='Open Upload';
+ $CONFIG['site']['webmaster']= '';
+ $CONFIG['site']['email']= '';
+ $CONFIG['site']['footer']='<a href="http://openupload.sf.net">Open Upload</a> - Created by Alessandro Briosi © 2008';
+ $CONFIG['registration']['email_confirm']='yes';
+ $CONFIG['max_upload_size']=100;
+ $CONFIG['max_download_time']=120;
+ }
+?>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<table border="0">
+<tr><td>Translation module:</td><td>
+<select name="translator">
+<option value="">-- Select one --</option>
+<?php foreach ($tr as $t) {
+ $selected = $CONFIG['translator']==$t?'selected':'';
+ echo '<option value="'.$t.'" '.$selected.'>'.$t.'</option>';
+} ?>
+</select>
+</td></tr>
+<tr><td>Default language:</td><td><input type="text" name="defaultlang" value="<?php echo $CONFIG['defaultlang']; ?>"></td></tr>
+<tr><td>Authentication module:<br>(LDAP Configuration needs to be done<br> by hand for now)</td><td>
+<select name="auth">
+<option value="">-- Select one --</option>
+<?php foreach ($auth as $t) {
+ $selected = $CONFIG['auth']==$t?'selected':'';
+ echo '<option value="'.$t.'" '.$selected.'>'.$t.'</option>';
+} ?>
+</select>
+</td></tr>
+<tr><td>Site title:</td><td><input type="text" name="sitetitle" value="<?php echo $CONFIG['site']['title']; ?>"></td></tr>
+<tr><td>WebMaster E-mail:</td><td><input type="text" name="webmaster" value="<?php echo $CONFIG['site']['webmaster']; ?>"></td></tr>
+<tr><td>Site E-mail:</td><td><input type="text" name="email" value="<?php echo $CONFIG['site']['email']; ?>"></td></tr>
+<tr><td>Confirm registration with e-mail:</td><td><input type="checkbox" name="confirmregistration" value="yes" <?php if ($CONFIG['registration']['email_confirm']=='yes') echo 'checked'; ?> ></td></tr>
+<tr><td>Template:</td><td>
+<select name="template">
+<option value="">-- Select one --</option>
+<?php foreach ($templates as $t) {
+ if ($t != '..' and $t != '.' and strpos($t,'.')!==0) {
+ $selected = $CONFIG['auth']==$t?'selected':'';
+ echo '<option value="'.$t.'" '.$selected.'>'.$t.'</option>';
+ }
+} ?>
+</select>
+</td></tr>
+<tr><td>Template Footer:</td><td><textarea name="sitefooter" cols="50" rows="5"><?php echo $CONFIG['site']['footer']; ?></textarea></td></tr>
+<tr><td>Maximum upload size (in MB):</td><td><input type="text" name="max_upload_size" value="<?php echo $CONFIG['max_upload_size']; ?>"></td></tr>
+<tr><td>Maximum download time (in Min)<br>0 disables it:</td><td><input type="text" name="max_download_time" value="<?php echo $CONFIG['max_download_time']; ?>"></td></tr>
+<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
+</table>
+</form>
+<?php
+}
+
+function users($step) {
+ global $_POST;
+ global $_SESSION;
+ global $CONFIG;
+
+ if (isset($_POST['unregistered'])) {
+ $error = false;
+ $_SESSION['options']['adminuser']=$_POST['adminuser'];
+ $_SESSION['options']['adminpassword']=$_POST['adminpassword'];
+ $_SESSION['options']['admingroup']=$_POST['admingroup'];
+ $_SESSION['options']['registered']=$_POST['registered'];
+ $_SESSION['options']['unregistered']=$_POST['unregistered'];
+ $CONFIG['register']['nologingroup']=$_POST['unregistered'];
+ $CONFIG['register']['default_group']=$_POST['registered'];
+ if ($_SESSION['options']['adminuser']=='') {
+ $error = true;
+ msg('Please provide an administrator name','fail');
+ }
+ if ($_SESSION['options']['adminpassword']=='') {
+ $error = true;
+ msg('Please provide an administrator password','fail');
+ }
+ if ($_SESSION['options']['admingroup']=='') {
+ $error = true;
+ msg('Please provide an administrators group','fail');
+ }
+ if ($_SESSION['options']['registered']=='') {
+ $error = true;
+ msg('Please provide registered users group','fail');
+ }
+ if ($_SESSION['options']['unregistered']=='') {
+ $error = true;
+ msg('Please provide an unregistered users default group','fail');
+ }
+ if (!$error)
+ return $step+1;
+ } else if (!isset($_SESSION['options']['adminuser'])) {
+ $_SESSION['options']['adminuser']='admin';
+ $_SESSION['options']['adminpassword']='';
+ $_SESSION['options']['admingroup']='admins';
+ $_SESSION['options']['registered']='registered';
+ $_SESSION['options']['unregistered']='unregistered';
+ }
+?>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<table border="0">
+<tr><td>Administrator:</td><td><input type="text" name="adminuser" value="<?php echo $_SESSION['options']['adminuser']; ?>"></td></tr>
+<tr><td>Admin password:</td><td><input type="password" name="adminpassword" value=""></td></tr>
+<tr><td>Admin group:</td><td><input type="text" name="admingroup" value="<?php echo $_SESSION['options']['admingroup']; ?>"></td></tr>
+<tr><td>Users group:</td><td><input type="text" name="registered" value="<?php echo $_SESSION['options']['registered']; ?>"></td></tr>
+<tr><td>Not registered group:</td><td><input type="text" name="unregistered" value="<?php echo $_SESSION['options']['unregistered']; ?>"></td></tr>
+<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
+</table>
+</form>
+<?php
+}
+
+function plugins($step) {
+ global $_POST;
+ global $CONFIG;
+
+ if (isset($_POST['step'])) {
+ $CONFIG['plugins']=array();
+ foreach ($_POST as $k => $v) {
+ if (strpos($k,'plugin_')===0) {
+ $CONFIG['plugins'][]=$v;
+ }
+ }
+ return $step+1;
+ }
+
+ $plugins = listModules($CONFIG['INSTALL_ROOT'].'/plugins');
+?>
+<div id="message">Please select which plugins you want to use (better enable all of them):</div>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<table border="0">
+<?php
+foreach ($plugins as $p) {
+ echo '<tr><td>'.$p.'</td><td><input type="checkbox" name="plugin_'.$p.'" value="'.$p.'" checked></td></tr>';
+}
+?>
+<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
+</table>
+</form>
+<?php
+}
+
+function dbconnect($host,$user,$pwd,$db,$debug = false) {
+global $dbhandle;
+global $CONFIG;
+
+ switch ($CONFIG['database']['type']) {
+ case 'mysql':
+ if (!($dbhandle = mysql_connect($host,$user,$pwd))) {
+ if ($debug) echo '<div id="message">Reason: '.mysql_error().'</div>';
+ return false;
+ }
+ if ($db != '')
+ if (!(mysql_select_db($db,$dbhandle))) {
+ if ($debug) echo '<div id="message">Reason: '.mysql_error().'</div>';
+ return false;
+ }
+ break;
+ case 'pgsql':
+ $str = "host=".$host;
+ $str .= " port=5432";
+ $str .= " dbname=".$db;
+ $str .= " user=".$user;
+ $str .= " password=".$pwd;
+ if (!($dbhandle = pg_connect($str))) {
+ if ($debug) echo '<div id="message">Reason: '.pg_last_error().'</div>';
+ return false;
+ }
+ break;
+ default:
+ msg('ERROR: dbtype: '.$CONFIG['database']['type'].' not yet supported','fail');
+ return false;
+ break;
+ }
+ return true;
+}
+
+function dbquery($sql,$params = array(),$debug = false) {
+global $dbhandle;
+global $CONFIG;
+
+ $query = strtr($sql,$params);
+ if ($query == '') return true;
+
+ switch ($CONFIG['database']['type']) {
+ case 'mysql':
+ if (!mysql_query($query,$dbhandle)) {
+ if ($debug) echo '<div id="message">Query failed: '.$query.'<br>Reason: '.mysql_error().'</div>';
+ return false;
+ }
+ break;
+ case 'pgsql':
+ if (!pg_query($query)) {
+ if ($debug) echo '<div id="message">Query failed: '.$query.'<br>Reason: '.pg_last_error().'</div>';
+ return false;
+ }
+ break;
+ }
+ return true;
+}
+
+function createdb($step) {
+ global $CONFIG;
+ global $_SESSION;
+ global $_POST;
+ global $MYSQL_QUERY;
+ global $PGSQL_QUERY;
+
+ if (isset($_SESSION['substep']) and !(isset($_POST['restart']))) {
+ $substep = $_SESSION['substep'];
+ } else {
+ if ($_SESSION['options']['newdb']==1) {
+ $substep=1;
+ } else if ($_SESSION['options']['populate']>0) {
+ $substep = 2;
+ } else {
+ $substep = 5;
+ }
+ }
+ $_SESSION['substep']=$substep;
+ switch ($CONFIG['database']['type']) {
+ case 'mysql':
+ $query = $MYSQL_QUERY;
+ $dbn = 'mysql';
+ break;
+ case 'pgsql':
+ $query = $PGSQL_QUERY;
+ $dbn = 'postgres';
+ break;
+ }
+ $error = false;
+ $debug = (isset($_POST['debug']))?true:false;
+ if (isset($_POST['proceed']) or isset($_POST['retry']) or isset($_POST['next'])) {
+ /* connect to the db */
+ if (isset($_POST['proceed']) or isset($_POST['retry']))
+ $execute = true;
+ switch ($substep) {
+ case 1: /* database and user creation */
+ if ($execute) {
+ $error = false;
+ if ($_SESSION['options']['newdb']==1) {
+ if (dbconnect($CONFIG['database']['host'],$_SESSION['options']['rootuser'],$_SESSION['options']['rootpassword'],$dbn,$debug)) {
+ if ($_SESSION['options']['newuser']==1) {
+ $params['%1']=$CONFIG['database']['user'];
+ $params['%2']=$CONFIG['database']['name'];
+ $params['%3']=$CONFIG['database']['password'];
+ dbquery($query['dropuser'],$params,$debug);
+ if (dbquery($query['createuser'],$params,$debug)) {
+ msg('User creation: SUCCESS','ok');
+ } else {
+ $error = true;
+ msg('User creation: FAILED!!!','fail');
+ }
+ }
+ $params['%1']=$CONFIG['database']['name'];
+ dbquery($query['dropdb'],$params,false);
+ if (dbquery($query['createdb'],$params,$debug)) {
+ msg('Database creation: SUCCESS','ok');
+ } else {
+ $error = true;
+ msg('Database creation: FAILED!!!','fail');
+ }
+ $params['%1']=$CONFIG['database']['user'];
+ $params['%2']=$CONFIG['database']['name'];
+ $params['%3']=$CONFIG['database']['password'];
+ if (dbquery($query['grant'],$params,$debug)) {
+ msg('Grant privileges: SUCCESS','ok');
+ } else {
+ $error = true;
+ msg('Grant privileges: FAILED!!!','fail');
+ }
+ } else {
+ $error = true;
+ msg('Database connection failed, please review the connection information!','fail');
+ }
+ }
+ }
+ if (!$error) {
+ if ($_SESSION['options']['populate']>0)
+ $substep++;
+ else
+ $substep=5;
+ }
+ break;
+ case 2: /* structure load */
+ $error = false;
+ if ($execute) {
+ if (dbconnect($CONFIG['database']['host'],$CONFIG['database']['user'],$CONFIG['database']['password'],$CONFIG['database']['name'],$debug)) {
+ $params['%1']=$CONFIG['database']['prefix'];
+ foreach ($query['structure'] as $t => $q) {
+ $params['%2']=$t;
+ if (!dbquery($query['droptable'],$params,$debug))
+ $error = true;
+ if (!dbquery($q,$params,$debug)) {
+ msg('Table creation FAILED: '.$t,'fail');
+ $error = true;
+ } else {
+ msg('Table creation SUCCESS: '.$t,'ok');
+ }
+ }
+ } else {
+ msg('Database connection failed!','fail');
+ $error = true;
+ }
+ }
+ if (!$error) {
+ msg('Structure load: SUCCESS','ok');
+ if ($_SESSION['options']['populate']>1)
+ $substep++;
+ else
+ $substep=5;
+ } else {
+ msg('Structure load: FAILED','fail');
+ }
+ break;
+ case 3: /* data load */
+ $error = false;
+ if ($execute) {
+ if (dbconnect($CONFIG['database']['host'],$CONFIG['database']['user'],$CONFIG['database']['password'],$CONFIG['database']['name'],$debug)) {
+ $params['%0']=$CONFIG['database']['prefix'];
+ $params['%1']=$_SESSION['options']['adminuser'];
+ $params['%2']=crypt($_SESSION['options']['adminpassword']);
+ $params['%3']=$_SESSION['options']['admingroup'];
+ $params['%4']=$_SESSION['options']['registered'];
+ $params['%5']=$_SESSION['options']['unregistered'];
+ $params['%6']=$CONFIG['site']['webmaster'];
+ foreach ($query['base'] as $t => $q) {
+ if (!dbquery($q,$params,$debug)) {
+ msg('Query failed... n. '.$t,'fail');
+ $error = true;
+ } else {
+ msg('Data insert SUCCESS: '.$t,'ok');
+ }
+ }
+ } else {
+ msg('Database connection failed!','fail');
+ $error = true;
+ }
+ }
+ if (!$error) {
+ if ($_SESSION['options']['populate']>2)
+ $substep++;
+ else
+ $substep=5;
+ msg('<b>Base system load: SUCCESS</b>','ok');
+ } else {
+ msg('Base system load: FAILED','fail');
+ }
+ break;
+ case 4: /* mode load */
+ $mode = $_SESSION['options']['populate']-2;
+ $error = false;
+ if ($execute) {
+ if (dbconnect($CONFIG['database']['host'],$CONFIG['database']['user'],$CONFIG['database']['password'],$CONFIG['database']['name'],$debug)) {
+ $params['%0']=$CONFIG['database']['prefix'];
+ $params['%1']=$_SESSION['options']['adminuser'];
+ $params['%2']=crypt($_SESSION['options']['adminpassword']);
+ $params['%3']=$_SESSION['options']['admingroup'];
+ $params['%4']=$_SESSION['options']['registered'];
+ $params['%5']=$_SESSION['options']['unregistered'];
+ $params['%6']=$CONFIG['site']['webmaster'];
+ foreach ($query['mode_'.$mode] as $t => $q) {
+ if (!dbquery($q,$params,$debug)) {
+ msg('Query failed... n. '.$t,'fail');
+ $error = true;
+ } else {
+ msg('Data insert SUCCESS: '.$t,'ok');
+ }
+ }
+ } else {
+ msg('Database connection failed!','fail');
+ $error = true;
+ }
+ }
+ if (!$error) {
+ $substep=5;
+ msg('<b>Mode data load: SUCCESS</b>','ok');
+ } else {
+ msg('<b>Mode data load: FAILED</b>','fail');
+ }
+ break;
+ case 5: /* finished */
+ return $step+1;
+ break;
+ }
+ echo '<hr>';
+ }
+ $_SESSION['substep']=$substep;
+ $_SESSION['debug']=$debug;
+ switch ($substep) {
+ case 1: /* database and user creation */
+ if ($_SESSION['options']['newuser']==1) {
+ $msg = 'now we will proceed to the database and user creation.';
+ } else {
+ $msg = 'now we will proceed to the database creation.';
+ }
+ break;
+ case 2: /* structure load */
+ $msg = 'Let\'s proceed with structure creation.';
+ break;
+ case 3: /* data load */
+ $msg = 'Let\'s load the base system data.';
+ break;
+ case 4: /* mode load */
+ $msg = 'Let\'s load the selected mode data.';
+ break;
+ case 5: /* finished */
+ $msg = 'Database initialization finished';
+ break;
+ }
+?>
+<div id="message"><?php echo $msg; ?></div>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<input type="checkbox" name="debug" value="debug" <?php if ($_SESSION['debug']) echo 'checked'; ?>> Debug database query errors<br> <br>
+<input type="submit" name="restart" value="Restart">
+<?php if ($error) { ?><input type="submit" name="retry" value="Retry">
+<input type="submit" name="next" value="Skip to Next step >>"><?php } else if ($substep<5) { ?>
+<input type="submit" name="proceed" value="Execute">
+<?php } else { ?>
+<input type="submit" name="proceed" value="Next >>">
+<?php } ?>
+</form>
+<?php
+}
+
+function generateConfig() {
+ global $CONFIG;
+
+ $result = '<?php'."\n";
+ foreach ($CONFIG as $k => $v) {
+ if (is_array($v)) {
+ foreach ($v as $sk => $sv) {
+ $result .= '$CONFIG[\''.$k.'\'][\''.$sk.'\'] = \''.str_replace('\'','\\\'',$sv).'\';'."\n";
+ }
+ $result .= "\n\n";
+ } else {
+ $result .= '$CONFIG[\''.$k.'\'] = \''.str_replace('\'','\\\'',$v).'\';'."\n\n";
+ }
+ }
+ $result .='?>';
+ return $result;
+}
+
+function save($step) {
+ global $_POST;
+ global $CONFIG;
+ global $_SESSION;
+
+ if (isset($_POST['download'])) {
+ $result = generateConfig();
+ ob_clean();
+ header('Content-Type: text/plain');
+ header('Content-Length: '.strlen($result));
+ header('Content-Disposition: attachment; filename="config.inc.php"');
+ echo $result;
+ exit;
+ } else if (isset($_POST['save'])) {
+ $result = generateConfig();
+ $file = 'config.inc.php';
+ if (defined('__NOT_MAIN_SCRIPT')) {
+ $file = 'www/'.$file;
+ }
+ if (file_put_contents($file,$result)) {
+ msg('Configuration sucessfully saved!','ok');
+ echo '<a href="index.php">click here to start using your new site</a><br><br>';
+ } else {
+ msg('Configuration file could not be saved, please proceed with the download!','fail');
+ }
+ }
+?>
+<div id="message">Congratulations your setup is almost complete.</div>
+<div id="message">Now the remaining step is to save the config.inc.php file to your server.</div>
+<div id="message">You can try saving it automatically, and if it's ok you'll be redirected to you new installed site.<br>
+Please note that this requires write access to the "www" folder.</div>
+<div id="message">Or you can download the file to review and upload to the server.</div>
+<form method="POST" action="index.php">
+<input type="hidden" name="step" value="<?php echo $step; ?>">
+<input type="submit" name="download" value="Download Configuration">
+<input type="submit" name="save" value="Save Configuration">
+</form>
+<?php
+}
+
+/*********************** SETUP AND DISPLAY OF PAGE **********************/
+
+if (isset($_SESSION['steps'])) {
+ foreach ($_SESSION['steps'] as $k => $l) {
+ $steps[$k]['done']=$l;
+ }
+}
+
+if (isset($steps[$step])) {
+ $title = $steps[$step]['title'];
+ $fun = $steps[$step]['function'];
+}
+
+?>
+<html>
+<head><TITLE>OpenUpload Setup Script</TITLE></head>
+<style>
+body {
+ font-family: Helvetica, Arial;
+ font-size: 10pt;
+}
+#header {
+}
+#logo {
+ float:left;
+}
+#userinfo {
+ clear: right;
+ float: right;
+ height: 40px;
+ vertical-align: bottom;
+ margin-top: 40px;
+ margin-right: 20px;
+}
+#title {
+ background-color: #3161cf;
+ color: #ffffff;
+ font-size: 12pt;
+ font-weight: bold;
+ clear: right;
+ padding-left: 160px;
+ padding-top: 3px;
+ padding-bottom:3px;
+ text-align: left;
+ margin-top: 50px;
+}
+#left {
+ width: 200px;
+ float: left;
+ clear: both;
+}
+#left ul {
+ list-style:none;
+ margin-top: 10px;
+ padding: 0;
+}
+#left li {
+ padding-right: 8px;
+ padding-left: 8px;
+}
+#content {
+ margin-left: 220px;
+ padding-top: 20px;
+}
+#message {
+ padding-bottom: 10px;
+}
+a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:hover {
+ color: #4c8dff;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+#footer {
+ clear: both;
+ position: fixed;
+ bottom: 0px;
+ height: 20px;
+ width: 100%;
+ font-weight: bold;
+ font-size: 9pt;
+ border-top: 1px solid #000000;
+ text-align: center;
+ background-color: #ffffff;
+}
+#footer a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+#footer a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+</style>
+<div>
+<div id="header">
+<div id="logo"><img src="<?php echo $path; ?>/img/openupload.jpg" border="0"></div>
+</div>
+<div id="userinfo">
+</div>
+<div id="title"><?php echo $title; ?></div>
+<div id="left">
+<ul>
+<?php
+foreach ($steps as $k => $s) {
+ if ($step == $k) {
+ $img = 'current.png';
+ } else if ($s['done']) {
+ $img = 'ok.png';
+ } else {
+ $img = 'step.png';
+ }
+ if ($s['done']==false) {
+ echo '<li><img border="0" src="'.$path.'/img/setup/'.$img.'"> '.$s['title'].'</li>'."\n";
+ } else {
+ echo '<li><a href="index.php?step='.$k.'"><img border="0" src="'.$path.'/img/setup/'.$img.'"> '.$s['title'].'</a></li>'."\n";
+ }
+}
+?>
+</ul>
+</div>
+<div id="content">
+<?php
+ $res = $fun($step);
+ $_SESSION['config']=$CONFIG;
+ if ($res != '' and $res != $step) {
+ $steps[$step]['done']=true;
+ foreach ($steps as $k => $s) {
+ $_SESSION['steps'][$k]=$s['done'];
+ }
+ ob_clean();
+ header('location: index.php?step='.$res);
+ exit;
+ }
+?>
+</div>
+<br> <br>
+<!-- footer -->
+<div id="footer"><a href="http://openupload.sf.net">Open Upload</a> - Created by Alessandro Briosi © 2008</div>
+</body>
+</html>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-12 12:43:08
|
Revision: 136
http://openupload.svn.sourceforge.net/openupload/?rev=136&view=rev
Author: tsdogs
Date: 2008-11-12 12:43:04 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
Update status
Modified Paths:
--------------
trunk/CHANGELOG
trunk/TODO
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-11-12 12:41:56 UTC (rev 135)
+++ trunk/CHANGELOG 2008-11-12 12:43:04 UTC (rev 136)
@@ -8,6 +8,15 @@
- Added PostgreSQL db structures
- PostgreSQL seems to be stable now
+* Administration
+ - Languages can now be administrated
+ - New rights editing interface.
+ - Plugin options
+
+* Plugins
+ - Options are now group based and in the database
+
+
Changelog from 0.3a to 0.3b (updated 2008.11.07)
* Fixed Bugs
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-11-12 12:41:56 UTC (rev 135)
+++ trunk/TODO 2008-11-12 12:43:04 UTC (rev 136)
@@ -11,12 +11,10 @@
- Display upload progress (a bit too triky and workarounds ain't really nice)
Database
-- pgsql module deep testing
- txtdb deep testing
Plugins
- Upload different filesize limiting depending on group (needs plugin options based on groups)
-- Plugin configuration options
Maintainence
- Create a script to clean up the files/tmpfiles.
@@ -26,10 +24,7 @@
- Config administration
Administration
-- Language table admin.
-- Plugin options
- Enable multiple table operations (deletion mainly)
-- Rights with better administration...
******* OTHER THINGS/IDEAS *******
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-12 12:42:08
|
Revision: 135
http://openupload.svn.sourceforge.net/openupload/?rev=135&view=rev
Author: tsdogs
Date: 2008-11-12 12:41:56 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/sql/mysql/2_base.sql
Modified: trunk/sql/mysql/2_base.sql
===================================================================
--- trunk/sql/mysql/2_base.sql 2008-11-10 19:20:46 UTC (rev 134)
+++ trunk/sql/mysql/2_base.sql 2008-11-12 12:41:56 UTC (rev 135)
@@ -59,8 +59,8 @@
INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(3, 'admins', 'email', 'enable');
-INSERT INTO `plugin_options` (`id`, `plugin`, `group_name`, `name`, value`) VALUES (1, 'mimetypes', 'unregistered', 'message', 'Pdf, JPEG');
-INSERT INTO `plugin_options` (`id`, `plugin`, `group_name`, `name`, value`) VALUES (2, 'mimetypes', 'unregistered', 'allowed', 'application/pdf
+INSERT INTO `plugin_options` (`id`, `plugin`, `group_name`, `name`, `value`) VALUES (1, 'mimetypes', 'unregistered', 'message', 'Pdf, JPEG');
+INSERT INTO `plugin_options` (`id`, `plugin`, `group_name`, `name`, `value`) VALUES (2, 'mimetypes', 'unregistered', 'allowed', 'application/pdf
image/jpeg
');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-10 19:20:51
|
Revision: 134
http://openupload.svn.sourceforge.net/openupload/?rev=134&view=rev
Author: tsdogs
Date: 2008-11-10 19:20:46 +0000 (Mon, 10 Nov 2008)
Log Message:
-----------
release v0.3b announce
Modified Paths:
--------------
web/index.html
Modified: web/index.html
===================================================================
--- web/index.html 2008-11-07 19:10:09 UTC (rev 133)
+++ web/index.html 2008-11-10 19:20:46 UTC (rev 134)
@@ -140,6 +140,9 @@
</div>
<div id="section">
<div id="title">Download</div>
+<div id="text">2008.11.07<br><b>New bug fix, this shuold be "stable".</b><br>Release 0.3b
+Click <a target="_new" href="http://sourceforge.net/project/showfiles.php?group_id=242018&package_id=294593&release_id=638845">here</a> to download.</div>
+<br>
<div id="text">2008.11.03<br><b>As there were a couple of bugs I decided to release a bug fix version.</b><br>Release 0.3a
Click <a target="_new" href="http://sourceforge.net/project/showfiles.php?group_id=242018&package_id=294593&release_id=636546">here</a> to download.</div>
<br>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 19:10:12
|
Revision: 133
http://openupload.svn.sourceforge.net/openupload/?rev=133&view=rev
Author: tsdogs
Date: 2008-11-07 19:10:09 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
update changelog
Modified Paths:
--------------
trunk/CHANGELOG
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-11-07 19:09:35 UTC (rev 132)
+++ trunk/CHANGELOG 2008-11-07 19:10:09 UTC (rev 133)
@@ -6,8 +6,26 @@
* Database
- Added PostgreSQL support
- Added PostgreSQL db structures
+ - PostgreSQL seems to be stable now
+Changelog from 0.3a to 0.3b (updated 2008.11.07)
+* Fixed Bugs
+ #2229204 User administration password change now works
+ #2229163 Users now can change their password
+ #2225762 Group editing now works
+ #2221934 Administrator can now delete files
+
+* General
+ Changed the main.css file to better suit IE, major improvements in next release.
+ Now the slashes are normalized so paths result correct in browsers
+
+Changelog from 0.3 to 0.3a (updated 2008.11.03)
+
+* Fixed bugs:
+ #2216829 : remove link not working
+ #2212187 : User registration not working
+
Changelog for release 0.3 (updated on 2008.10.28).
* General
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 19:09:38
|
Revision: 132
http://openupload.svn.sourceforge.net/openupload/?rev=132&view=rev
Author: tsdogs
Date: 2008-11-07 19:09:35 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
Add database connection close
Modified Paths:
--------------
trunk/lib/modules/db/mysql.inc.php
trunk/lib/modules/db/pgsql.inc.php
Modified: trunk/lib/modules/db/mysql.inc.php
===================================================================
--- trunk/lib/modules/db/mysql.inc.php 2008-11-07 19:08:56 UTC (rev 131)
+++ trunk/lib/modules/db/mysql.inc.php 2008-11-07 19:09:35 UTC (rev 132)
@@ -12,12 +12,16 @@
function init() {
/* connect to the database */
mysql_connect($this->config['host'],$this->config['user'],$this->config['password'])
- or die(tr('ERROR: connection to database failed!'));
+ or die('ERROR: connection to database failed!');
- $this->db = mysql_select_db($this->config['name']);// or die('ERROR: database could not be opened');
+ $this->db = mysql_select_db($this->config['name']) or die('ERROR: database could not be opened');
}
+ function free() {
+ mysql_close();
+ }
+
function newId($tbl,$field = 'id',$keys = array ()) {
$sql = 'SELECT max(`'.$field.'`) as newid FROM `'.$this->prefix.$tbl.'`';
if (count($keys)>0) {
Modified: trunk/lib/modules/db/pgsql.inc.php
===================================================================
--- trunk/lib/modules/db/pgsql.inc.php 2008-11-07 19:08:56 UTC (rev 131)
+++ trunk/lib/modules/db/pgsql.inc.php 2008-11-07 19:09:35 UTC (rev 132)
@@ -23,6 +23,10 @@
$this->db = pg_connect($str) or die('ERROR: connection to db failed!');
}
+ function free() {
+ pg_close($this->db);
+ }
+
function newId($tbl,$field = 'id',$keys = array ()) {
$sql = 'SELECT max("'.$field.'") as newid FROM "'.$this->prefix.$tbl.'"';
if (count($keys)>0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 19:09:05
|
Revision: 131
http://openupload.svn.sourceforge.net/openupload/?rev=131&view=rev
Author: tsdogs
Date: 2008-11-07 19:08:56 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
Add database connection close
Modified Paths:
--------------
trunk/lib/classes.inc.php
trunk/lib/general.inc.php
trunk/lib/main.inc.php
Modified: trunk/lib/classes.inc.php
===================================================================
--- trunk/lib/classes.inc.php 2008-11-07 19:07:57 UTC (rev 130)
+++ trunk/lib/classes.inc.php 2008-11-07 19:08:56 UTC (rev 131)
@@ -43,6 +43,10 @@
}
+ function free() {
+
+ }
+
function newId($tbl,$field = 'id',$keys = array ()) {
app()->error('Please reimplement: '.$this->name.' newId');
return 0;
Modified: trunk/lib/general.inc.php
===================================================================
--- trunk/lib/general.inc.php 2008-11-07 19:07:57 UTC (rev 130)
+++ trunk/lib/general.inc.php 2008-11-07 19:08:56 UTC (rev 131)
@@ -45,6 +45,7 @@
} else {
header('location: '.$url);
}
+ app()->db->close();
exit(0);
}
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-11-07 19:07:57 UTC (rev 130)
+++ trunk/lib/main.inc.php 2008-11-07 19:08:56 UTC (rev 131)
@@ -373,6 +373,7 @@
$this->page['title']= tr('IP Banned');
$this->tpl->assign('page',app()->page);
$this->display($this->mainPage);
+ $this->db->free();
exit;
}
/* depending on the acl some actions need authentication others don't */
@@ -398,6 +399,7 @@
$this->page['content']=tr('THERE HAS BEEN A PERMISSION ERROR. PLEASE TRY ONE OF THE ALLOWED OPTIONS!');
$this->tpl->assign('page',$this->page);
$this->display($this->mainPage);
+ $this->db->free();
exit(0);
} else {
/* save the requested url */
@@ -435,6 +437,7 @@
$this->page['content']=$this->fetch('modules/'.$m->name.'/'.$fun);
$this->tpl->assign('page',$this->page);
$this->display($this->mainPage);
+ $this->db->free();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 19:08:00
|
Revision: 130
http://openupload.svn.sourceforge.net/openupload/?rev=130&view=rev
Author: tsdogs
Date: 2008-11-07 19:07:57 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/sql/pgsql/2_base.sql
Modified: trunk/sql/pgsql/2_base.sql
===================================================================
--- trunk/sql/pgsql/2_base.sql 2008-11-07 19:07:24 UTC (rev 129)
+++ trunk/sql/pgsql/2_base.sql 2008-11-07 19:07:57 UTC (rev 130)
@@ -99,7 +99,7 @@
--
INSERT INTO plugin_options VALUES (1, 'mimetypes', 'unregistered', 'message', 'Pdf, JPEG');
-INSERT INTO plugin_options VALUES (2, 'mimetypes', 'unregisteres', 'allowed', 'application/pdf
+INSERT INTO plugin_options VALUES (2, 'mimetypes', 'unregistered', 'allowed', 'application/pdf
image/jpeg
');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 19:07:28
|
Revision: 129
http://openupload.svn.sourceforge.net/openupload/?rev=129&view=rev
Author: tsdogs
Date: 2008-11-07 19:07:24 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
add plugin options
Modified Paths:
--------------
trunk/sql/mysql/2_base.sql
Modified: trunk/sql/mysql/2_base.sql
===================================================================
--- trunk/sql/mysql/2_base.sql 2008-11-07 18:03:54 UTC (rev 128)
+++ trunk/sql/mysql/2_base.sql 2008-11-07 19:07:24 UTC (rev 129)
@@ -57,3 +57,10 @@
INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(1, 'admins', 'password', 'enable');
INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(2, 'admins', 'captcha', 'enable');
INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(3, 'admins', 'email', 'enable');
+
+
+INSERT INTO `plugin_options` (`id`, `plugin`, `group_name`, `name`, value`) VALUES (1, 'mimetypes', 'unregistered', 'message', 'Pdf, JPEG');
+INSERT INTO `plugin_options` (`id`, `plugin`, `group_name`, `name`, value`) VALUES (2, 'mimetypes', 'unregistered', 'allowed', 'application/pdf
+image/jpeg
+');
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 18:03:56
|
Revision: 128
http://openupload.svn.sourceforge.net/openupload/?rev=128&view=rev
Author: tsdogs
Date: 2008-11-07 18:03:54 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
Add username auto focus
Modified Paths:
--------------
trunk/templates/default/modules/auth/loginForm.tpl
Modified: trunk/templates/default/modules/auth/loginForm.tpl
===================================================================
--- trunk/templates/default/modules/auth/loginForm.tpl 2008-11-07 18:03:04 UTC (rev 127)
+++ trunk/templates/default/modules/auth/loginForm.tpl 2008-11-07 18:03:54 UTC (rev 128)
@@ -12,4 +12,10 @@
</form>
</fieldset>
{include file="default/modules/auth/registerlink.tpl"}
-</div>
\ No newline at end of file
+</div>
+{literal}
+<script langiage="javascript">
+ obj = document.getElementById('username');
+ obj.focus();
+</script>
+{/literal}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 18:03:09
|
Revision: 127
http://openupload.svn.sourceforge.net/openupload/?rev=127&view=rev
Author: tsdogs
Date: 2008-11-07 18:03:04 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
add pgsql sql start scripts
Added Paths:
-----------
trunk/sql/pgsql/1_structure.sql
trunk/sql/pgsql/2_base.sql
trunk/sql/pgsql/3_mode_private.sql
trunk/sql/pgsql/3_mode_public.sql
trunk/sql/pgsql/3_mode_restricted.sql
trunk/sql/pgsql/3_mode_service.sql
Added: trunk/sql/pgsql/1_structure.sql
===================================================================
--- trunk/sql/pgsql/1_structure.sql (rev 0)
+++ trunk/sql/pgsql/1_structure.sql 2008-11-07 18:03:04 UTC (rev 127)
@@ -0,0 +1,408 @@
+--
+-- PostgreSQL database dump
+--
+
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = off;
+SET check_function_bodies = false;
+SET client_min_messages = warning;
+SET escape_string_warning = off;
+
+SET search_path = public, pg_catalog;
+
+SET default_tablespace = '';
+
+SET default_with_oids = false;
+
+--
+-- Name: acl; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE acl (
+ id integer NOT NULL,
+ module character varying(100) NOT NULL,
+ action character varying(100) NOT NULL,
+ group_name character varying(100) NOT NULL,
+ access character varying(100) NOT NULL
+);
+
+
+--
+-- Name: banned; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE banned (
+ id integer NOT NULL,
+ ip character varying(50),
+ access character varying(50),
+ priority integer
+);
+
+
+
+--
+-- Name: file_options; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE file_options (
+ id integer NOT NULL,
+ file_id character varying(100) NOT NULL,
+ module character varying(50) NOT NULL,
+ name character varying(50) NOT NULL,
+ value character varying(200) NOT NULL
+);
+
+
+
+--
+-- Name: files; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE files (
+ id character varying(100) NOT NULL,
+ name character varying(200) NOT NULL,
+ mime character varying(200) NOT NULL,
+ description text NOT NULL,
+ size integer NOT NULL,
+ remove character varying(100) NOT NULL,
+ user_login character varying(100) NOT NULL,
+ ip character varying(40) NOT NULL,
+ upload_date timestamp without time zone NOT NULL
+);
+
+
+
+--
+-- Name: groups; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE groups (
+ name character varying(50) NOT NULL,
+ description character varying(250)
+);
+
+
+
+--
+-- Name: langs; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE langs (
+ id character varying(10) NOT NULL,
+ name character varying(50) NOT NULL,
+ locale character varying(10) NOT NULL,
+ browser character varying(200),
+ charset character varying(50) NOT NULL,
+ active integer DEFAULT 1 NOT NULL
+);
+
+
+
+--
+-- Name: plugin_acl; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE plugin_acl (
+ id integer NOT NULL,
+ group_name character varying(50) NOT NULL,
+ plugin character varying(100) NOT NULL,
+ access character varying(10) NOT NULL
+);
+
+
+
+--
+-- Name: plugin_options; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE plugin_options (
+ id integer NOT NULL,
+ plugin character varying(100) NOT NULL,
+ group_name character varying(100) NOT NULL,
+ name character varying(100) NOT NULL,
+ value text
+);
+
+
+
+--
+-- Name: users; Type: TABLE; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE TABLE users (
+ id integer NOT NULL,
+ login character varying(100) NOT NULL,
+ password character varying(100) NOT NULL,
+ name character varying(200) NOT NULL,
+ group_name character varying(50) NOT NULL,
+ email character varying(250) NOT NULL,
+ lang character varying(10) NOT NULL,
+ reg_date timestamp without time zone NOT NULL,
+ regid character varying(50) NOT NULL,
+ active integer NOT NULL
+);
+
+
+
+--
+-- Name: acl_id_seq; Type: SEQUENCE; Schema: public; Owner: openupload
+--
+
+CREATE SEQUENCE acl_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+
+--
+-- Name: acl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: openupload
+--
+
+ALTER SEQUENCE acl_id_seq OWNED BY acl.id;
+
+
+--
+-- Name: banned_id_seq; Type: SEQUENCE; Schema: public; Owner: openupload
+--
+
+CREATE SEQUENCE banned_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+
+--
+-- Name: banned_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: openupload
+--
+
+ALTER SEQUENCE banned_id_seq OWNED BY banned.id;
+
+
+--
+-- Name: file_options_id_seq; Type: SEQUENCE; Schema: public; Owner: openupload
+--
+
+CREATE SEQUENCE file_options_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+
+--
+-- Name: file_options_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: openupload
+--
+
+ALTER SEQUENCE file_options_id_seq OWNED BY file_options.id;
+
+
+--
+-- Name: plugin_acl_id_seq; Type: SEQUENCE; Schema: public; Owner: openupload
+--
+
+CREATE SEQUENCE plugin_acl_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+
+--
+-- Name: plugin_acl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: openupload
+--
+
+ALTER SEQUENCE plugin_acl_id_seq OWNED BY plugin_acl.id;
+
+
+--
+-- Name: plugin_options_id_seq; Type: SEQUENCE; Schema: public; Owner: openupload
+--
+
+CREATE SEQUENCE plugin_options_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+
+--
+-- Name: plugin_options_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: openupload
+--
+
+ALTER SEQUENCE plugin_options_id_seq OWNED BY plugin_options.id;
+
+
+--
+-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: openupload
+--
+
+CREATE SEQUENCE users_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+--
+-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: openupload
+--
+
+ALTER SEQUENCE users_id_seq OWNED BY users.id;
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: openupload
+--
+
+ALTER TABLE acl ALTER COLUMN id SET DEFAULT nextval('acl_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: openupload
+--
+
+ALTER TABLE banned ALTER COLUMN id SET DEFAULT nextval('banned_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: openupload
+--
+
+ALTER TABLE file_options ALTER COLUMN id SET DEFAULT nextval('file_options_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: openupload
+--
+
+ALTER TABLE plugin_acl ALTER COLUMN id SET DEFAULT nextval('plugin_acl_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: openupload
+--
+
+ALTER TABLE plugin_options ALTER COLUMN id SET DEFAULT nextval('plugin_options_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: openupload
+--
+
+ALTER TABLE users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
+
+
+--
+-- Name: acl_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY acl
+ ADD CONSTRAINT acl_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: banned_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY banned
+ ADD CONSTRAINT banned_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: file_options_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY file_options
+ ADD CONSTRAINT file_options_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY files
+ ADD CONSTRAINT files_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: groups_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY groups
+ ADD CONSTRAINT groups_pkey PRIMARY KEY (name);
+
+
+--
+-- Name: langs_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY langs
+ ADD CONSTRAINT langs_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: plugin_acl_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY plugin_acl
+ ADD CONSTRAINT plugin_acl_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: plugin_options_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY plugin_options
+ ADD CONSTRAINT plugin_options_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: openupload; Tablespace:
+--
+
+ALTER TABLE ONLY users
+ ADD CONSTRAINT users_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: file_id_idx; Type: INDEX; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE INDEX file_id_idx ON file_options USING btree (file_id);
+
+
+--
+-- Name: plugin_acl_group_plugin_key; Type: INDEX; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE UNIQUE INDEX plugin_acl_group_plugin_key ON plugin_acl USING btree (group_name, plugin);
+
+
+--
+-- Name: users_login_key; Type: INDEX; Schema: public; Owner: openupload; Tablespace:
+--
+
+CREATE UNIQUE INDEX users_login_key ON users USING btree (login);
+
+
+--
+-- Name: public; Type: ACL; Schema: -; Owner: postgres
+--
+
+REVOKE ALL ON SCHEMA public FROM PUBLIC;
+REVOKE ALL ON SCHEMA public FROM postgres;
+GRANT ALL ON SCHEMA public TO postgres;
+GRANT ALL ON SCHEMA public TO PUBLIC;
+
+
+--
+-- PostgreSQL database dump complete
+--
Added: trunk/sql/pgsql/2_base.sql
===================================================================
--- trunk/sql/pgsql/2_base.sql (rev 0)
+++ trunk/sql/pgsql/2_base.sql 2008-11-07 18:03:04 UTC (rev 127)
@@ -0,0 +1,117 @@
+--
+-- PostgreSQL database dump
+--
+
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = off;
+SET check_function_bodies = false;
+SET client_min_messages = warning;
+SET escape_string_warning = off;
+
+SET search_path = public, pg_catalog;
+
+--
+-- Name: acl_id_seq; Type: SEQUENCE SET; Schema: public; Owner: openupload
+--
+
+SELECT pg_catalog.setval('acl_id_seq', 1, true);
+
+
+--
+-- Name: banned_id_seq; Type: SEQUENCE SET; Schema: public; Owner: openupload
+--
+
+SELECT pg_catalog.setval('banned_id_seq', 1, false);
+
+
+--
+-- Name: file_options_id_seq; Type: SEQUENCE SET; Schema: public; Owner: openupload
+--
+
+SELECT pg_catalog.setval('file_options_id_seq', 1, true);
+
+
+--
+-- Name: plugin_acl_id_seq; Type: SEQUENCE SET; Schema: public; Owner: openupload
+--
+
+SELECT pg_catalog.setval('plugin_acl_id_seq', 1, false);
+
+
+--
+-- Name: plugin_options_id_seq; Type: SEQUENCE SET; Schema: public; Owner: openupload
+--
+
+SELECT pg_catalog.setval('plugin_options_id_seq', 1, true);
+
+
+--
+-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: openupload
+--
+
+SELECT pg_catalog.setval('users_id_seq', 1, true);
+
+
+--
+-- Data for Name: acl; Type: TABLE DATA; Schema: public; Owner: openupload
+--
+
+INSERT INTO acl VALUES (1, '*', '*', 'admins', 'allow');
+INSERT INTO acl VALUES (2, 'admin', '*', 'admins', 'allow');
+INSERT INTO acl VALUES (3, 'admin', '*', '*', 'deny');
+INSERT INTO acl VALUES (4, 'auth', 'login', 'unregistered', 'allow');
+
+
+--
+-- Data for Name: banned; Type: TABLE DATA; Schema: public; Owner: openupload
+--
+
+INSERT INTO banned VALUES (1, '127.0.0.1', 'allow', 1);
+INSERT INTO banned VALUES (2, '0.0.0.0/0', 'allow', 9999999);
+
+--
+-- Data for Name: groups; Type: TABLE DATA; Schema: public; Owner: openupload
+--
+
+INSERT INTO groups VALUES ('admins', 'Administrators group');
+INSERT INTO groups VALUES ('unregistered', 'Unregistered users');
+INSERT INTO groups VALUES ('registered', 'Registered Users');
+
+
+--
+-- Data for Name: langs; Type: TABLE DATA; Schema: public; Owner: openupload
+--
+
+INSERT INTO langs VALUES ('en', 'English', 'en_EN', '[en];[en-EN]', 'iso-8559-1', 1);
+INSERT INTO langs VALUES ('it', 'Italiano', 'it_IT.utf8', '[it];[it-IT]', 'utf8', 1);
+
+
+--
+-- Data for Name: plugin_acl; Type: TABLE DATA; Schema: public; Owner: openupload
+--
+
+INSERT INTO plugin_acl VALUES (1, 'admins', 'password', 'enable');
+INSERT INTO plugin_acl VALUES (2, 'admins', 'captcha', 'enable');
+INSERT INTO plugin_acl VALUES (3, 'admins', 'email', 'enable');
+
+--
+-- Data for Name: plugin_options; Type: TABLE DATA; Schema: public; Owner: openupload
+--
+
+INSERT INTO plugin_options VALUES (1, 'mimetypes', 'unregistered', 'message', 'Pdf, JPEG');
+INSERT INTO plugin_options VALUES (2, 'mimetypes', 'unregisteres', 'allowed', 'application/pdf
+image/jpeg
+');
+
+
+--
+-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: openupload
+--
+
+INSERT INTO users VALUES (1, 'admin', '$1$jYkADrMf$pIf7UKkS3prHZPlvJ9vX61', 'Administrator', 'admins', 'ope...@yo...', 'en', now(), '', 1);
+
+
+--
+-- PostgreSQL database dump complete
+--
+
Added: trunk/sql/pgsql/3_mode_private.sql
===================================================================
--- trunk/sql/pgsql/3_mode_private.sql (rev 0)
+++ trunk/sql/pgsql/3_mode_private.sql 2008-11-07 18:03:04 UTC (rev 127)
@@ -0,0 +1,17 @@
+--
+-- Dump dei dati per la tabella `acl`
+--
+INSERT INTO acl VALUES (5, 'auth', 'register', '*', 'deny');
+INSERT INTO acl VALUES (6, 'auth', '*', 'unregistered', 'deny');
+INSERT INTO acl VALUES (7, 'auth', '*', '*', 'allow');
+INSERT INTO acl VALUES (8, 'files', '*', 'unregistered', 'deny');
+INSERT INTO acl VALUES (9, 'files', '*', '*', 'allow');
+
+--
+-- Dump dei dati per la tabella `plugin_acl`
+--
+
+INSERT INTO plugin_acl VALUES (4, 'registered', 'password', 'enable');
+INSERT INTO plugin_acl VALUES (5, 'registered', 'captcha', 'enable');
+INSERT INTO plugin_acl VALUES (6, 'registered', 'email', 'enable');
+
Added: trunk/sql/pgsql/3_mode_public.sql
===================================================================
--- trunk/sql/pgsql/3_mode_public.sql (rev 0)
+++ trunk/sql/pgsql/3_mode_public.sql 2008-11-07 18:03:04 UTC (rev 127)
@@ -0,0 +1,14 @@
+--
+-- Dump dei dati per la tabella acl
+--
+
+INSERT INTO acl VALUES(5, 'auth', '*', '*', 'deny');
+INSERT INTO acl VALUES(6, 'files', '*', '*', 'allow');
+
+--
+-- Dump dei dati per la tabella plugin_acl
+--
+
+INSERT INTO plugin_acl VALUES (4, 'unregistered', 'password', 'enable');
+INSERT INTO plugin_acl VALUES (5, 'unregistered', 'captcha', 'enable');
+INSERT INTO plugin_acl VALUES (6, 'unregistered', 'email', 'enable');
Added: trunk/sql/pgsql/3_mode_restricted.sql
===================================================================
--- trunk/sql/pgsql/3_mode_restricted.sql (rev 0)
+++ trunk/sql/pgsql/3_mode_restricted.sql 2008-11-07 18:03:04 UTC (rev 127)
@@ -0,0 +1,18 @@
+--
+-- Dump dei dati per la tabella acl
+--
+INSERT INTO acl VALUES (5, 'auth', 'register', '*', 'deny');
+INSERT INTO acl VALUES (6, 'auth', '*', 'unregistered', 'deny');
+INSERT INTO acl VALUES (7, 'auth', '*', '*', 'allow');
+INSERT INTO acl VALUES (8, 'files', 'd', 'unregistered', 'allow');
+INSERT INTO acl VALUES (9, 'files', 'g', 'unregistered', 'allow');
+INSERT INTO acl VALUES (10, 'files', '*', 'unregistered', 'deny');
+INSERT INTO acl VALUES (11, 'files', '*', '*', 'allow');
+
+--
+-- Dump dei dati per la tabella plugin_acl
+--
+
+INSERT INTO plugin_acl VALUES (4, 'registered', 'password', 'enable');
+INSERT INTO plugin_acl VALUES (5, 'registered', 'captcha', 'enable');
+INSERT INTO plugin_acl VALUES (6, 'registered', 'email', 'enable');
\ No newline at end of file
Added: trunk/sql/pgsql/3_mode_service.sql
===================================================================
--- trunk/sql/pgsql/3_mode_service.sql (rev 0)
+++ trunk/sql/pgsql/3_mode_service.sql 2008-11-07 18:03:04 UTC (rev 127)
@@ -0,0 +1,19 @@
+--
+-- Dump dei dati per la tabella acl
+--
+INSERT INTO acl VALUES(5, 'auth', 'register', 'unregistered', 'allow');
+INSERT INTO acl VALUES(6, 'auth', '*', 'unregistered', 'deny');
+INSERT INTO acl VALUES(7, 'auth', 'register', '*', 'deny');
+INSERT INTO acl VALUES(8, 'auth', '*', '*', 'allow');
+INSERT INTO acl VALUES(9, 'files', '*', '*', 'allow');
+
+--
+-- Dump dei dati per la tabella plugin_acl
+--
+
+INSERT INTO plugin_acl VALUES (4, 'registered', 'password', 'enable');
+INSERT INTO plugin_acl VALUES (5, 'registered', 'captcha', 'enable');
+INSERT INTO plugin_acl VALUES (6, 'registered', 'email', 'enable');
+INSERT INTO plugin_acl VALUES (7, 'unregistered', 'mimetypes', 'enable');
+INSERT INTO plugin_acl VALUES (8, 'unregistered', 'captcha', 'enable');
+INSERT INTO plugin_acl VALUES (9, 'unregistered', 'password', 'enable');
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 18:02:04
|
Revision: 126
http://openupload.svn.sourceforge.net/openupload/?rev=126&view=rev
Author: tsdogs
Date: 2008-11-07 18:01:47 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
add pgsql sql start scripts
Added Paths:
-----------
trunk/sql/pgsql/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-07 17:59:01
|
Revision: 125
http://openupload.svn.sourceforge.net/openupload/?rev=125&view=rev
Author: tsdogs
Date: 2008-11-07 17:58:57 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
add pgsql instructions
Modified Paths:
--------------
trunk/INSTALL
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2008-11-06 19:57:33 UTC (rev 124)
+++ trunk/INSTALL 2008-11-07 17:58:57 UTC (rev 125)
@@ -62,6 +62,16 @@
mysql <database> -u <user> -p < sql/mysql/2_base.sql
- import the configuration mode (it is not required):
mysql <database> -u <user> -p < sql/mysql/3_mode_<selected>.sql
+ PGSQL:
+ - create the user and the db
+ su - postgres (or whatever is the db admin)
+ createuser -P -S -D -R -l openupload
+ createdb --owner=openupload openupload "OpenUpload DB"
+ - import the database schema and default config options
+ psql -h 127.0.0.1 -W -U openupload -f sql/pgsql/1_structure.sql
+ psql -h 127.0.0.1 -W -U openupload -f sql/pgsql/2_base.sql
+ - import the configuration mode (it is not required):
+ psql -h 127.0.0.1 -W -U openupload -f sql/pgsql/3_mode_<selected>.sql
FLAT FILE (TXT):
- the txt is usable, but I would not suggest it unless it's a really low traffic site.
- make sure the "rootdir" for the txtdb folder is writable by your apache user
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-06 19:57:35
|
Revision: 124
http://openupload.svn.sourceforge.net/openupload/?rev=124&view=rev
Author: tsdogs
Date: 2008-11-06 19:57:33 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
Plugin options now are in the db.
Modified Paths:
--------------
trunk/lib/classes.inc.php
trunk/lib/modules/default/admin.inc.php
trunk/plugins/mimetypes.inc.php
trunk/templates/default/modules/admin/groups.tpl
trunk/templates/default/modules/admin/pluginoptions.tpl
trunk/templates/default/modules/admin/rights.tpl
trunk/templates/default/plugins/mimetypes/uploadForm.tpl
Added Paths:
-----------
trunk/templates/default/modules/admin/pluginoptionadd.tpl
trunk/templates/default/modules/admin/pluginoptiondetail.tpl
trunk/templates/default/modules/admin/pluginoptionedit.tpl
Modified: trunk/lib/classes.inc.php
===================================================================
--- trunk/lib/classes.inc.php 2008-11-06 14:12:08 UTC (rev 123)
+++ trunk/lib/classes.inc.php 2008-11-06 19:57:33 UTC (rev 124)
@@ -90,10 +90,13 @@
function OpenUploadMoule() {
}
- function nextStep($step = 0, $action = '') {
+ function nextStep($step = 0, $action = '',$params='') {
$step = $step==0?app()->step+1:$step;
$action = $action==''?app()->action:$action;
- redirect('?action='.$action.'&step='.$step);
+ if ($params!='')
+ redirect('?action='.$action.'&step='.$step.'&'.$params);
+ else
+ redirect('?action='.$action.'&step='.$step);
}
function prevStep() {
@@ -115,6 +118,8 @@
var $messageHTML;
var $name;
var $fields = array();
+ var $options = array();
+ var $config = array();
function MySharePlugin() {
}
@@ -127,7 +132,34 @@
$this->pluginHTML .= app()->fetch('plugins/'.$this->name.'/'.$tpl);
}
+ function loadConfig() {
+ if (count($this->options)>0) {
+ $opt = app()->db->read('plugin_options',array('plugin' => $this->name),array(),'',array('name','group_name'));
+ if (count($opt)==0) return;
+ foreach ($this->options as $o) {
+ $this->config[$o['name']] = array();
+ if (isset($opt[$o['name']])) {
+ foreach ($opt[$o['name']] as $g => $v) {
+ switch ($o['type']) {
+ case 'list':
+ $this->config[$o['name']][$g] = explode("\n",chop($v['value']));
+ break;
+ case 'text':
+ $this->config[$o['name']][$g] = $v['value'];
+ break;
+ default:
+ $this->config[$o['name']][$g] = $v['value'];
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
function init() {
+ $this->loadConfig();
+
}
/* functions that can be called
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-11-06 14:12:08 UTC (rev 123)
+++ trunk/lib/modules/default/admin.inc.php 2008-11-06 19:57:33 UTC (rev 124)
@@ -19,9 +19,10 @@
),
"adminpluginsoptions" => array (
1 => "pluginoptions",
- 2 => "pluginoptionadd",
- 3 => "pluginoptionedit",
- 4 => "pluginoptiondelete",
+ 2 => "pluginoptiondetail",
+ 3 => "pluginoptionadd",
+ 4 => "pluginoptionedit",
+ 5 => "pluginoptiondelete",
),
"adminfiles" => array (
1 => "files",
@@ -319,7 +320,7 @@
}
}
}
- redirect('?action=adminrights&step=2&id='.$id);
+ $this->nextStep(2,'','id='.$id);
} else {
$id = $_GET['id'];
}
@@ -473,16 +474,105 @@
}
function pluginoptiondetail() {
+ global $_GET;
+
+ if (isset($_GET['id'])) {
+ $groups = app()->auth->groupinfo();
+ $options = app()->db->read('plugin_options',array('plugin' => $_GET['id']),array('group_name'),
+ '',array('group_name','name'));
+ $this->tpl->assign('groups',$groups);
+ $this->tpl->assign('plugin_options',$options);
+ $this->tpl->assign('options',app()->plugins[$_GET['id']]->options);
+ $this->tpl->assign('pluginname',$_GET['id']);
+ } else {
+ $this->nextStep(1);
+ }
}
function pluginoptionadd() {
+ global $_GET;
+ global $_POST;
+
+ if (isset($_GET['id']) or isset($_POST['id'])) {
+ $plugin = isset($_POST['id'])?$_POST['id']:$_GET['id'];
+ $poptions = app()->plugins[$plugin]->options;
+ $groups = app()->auth->groupinfo();
+ $this->tpl->assign('groups',$groups);
+ $this->tpl->assign('options',$poptions);
+ $this->tpl->assign('pluginname',$plugin);
+ if (isset($_POST['id'])) {
+ $group = $_POST['gid'];
+ /* should check if values for this group already exsist */
+ $tmp = app()->db->read('plugin_options',array('group_name' => $group, 'plugin' => $plugin));
+ if (count($tmp)>0) {
+ app()->error(tr('Options for this group already exsist, please use the edit function!'));
+ } else {
+ foreach ($poptions as $o) {
+ $val = array();
+ $val['plugin']=$plugin;
+ $val['group_name']=$group;
+ $val['name']=$o['name'];
+ $val['value'] = $_POST[$o['name']];
+ app()->db->insert('plugin_options',$val);
+ }
+ $this->nextStep(2,'','id='.$plugin);
+ }
+ } else {
+ $options = array();
+ }
+ $this->tpl->assign('plugin_options',$options);
+ } else {
+ $this->nextStep(1);
+ }
}
function pluginoptionedit() {
+ global $_GET;
+ global $_POST;
+
+ if (isset($_GET['id']) or isset($_POST['id'])) {
+ $plugin = isset($_POST['id'])?$_POST['id']:$_GET['id'];
+ $group = isset($_POST['gid'])?$_POST['gid']:$_GET['gid'];
+ $options = app()->db->read('plugin_options',array('plugin' => $plugin, 'group_name' => $group),array(),'',
+ array('name'));
+ $poptions = app()->plugins[$plugin]->options;
+ if (isset($_POST['id'])) {
+ foreach ($poptions as $o) {
+ $val = array();
+ if (isset($options[$o['name']])) {
+ $val = $options[$o['name']];
+ $val['value'] = $_POST[$o['name']];
+ app()->db->update('plugin_options',$val,array('id' => $val['id']));
+ } else {
+ $val['plugin']=$plugin;
+ $val['group_name']=$group;
+ $val['name']=$o['name'];
+ $val['value'] = $_POST[$o['name']];
+ app()->db->insert('plugin_options',$val);
+ }
+ }
+ $this->nextStep(2,'','id='.$plugin);
+ } else if ($group!='') {
+ $this->tpl->assign('plugin_options',$options);
+ $this->tpl->assign('options',$poptions);
+ } else {
+ $this->nextStep(2,'','id='.$plugin);
+ }
+ $this->tpl->assign('gid',$group);
+ $this->tpl->assign('pluginname',$plugin);
+ } else {
+ $this->nextStep(1);
+ }
}
function pluginoptiondelete() {
+ global $_GET;
+
+ if (isset($_GET['id'])) {
+ app()->db->delete('plugin_options',array('group_name' => $_GET['gid'], 'plugin' => $_GET['id']));
+ $this->nextStep(2,'','id='.$_GET['id']);
+ }
}
function settings() {
@@ -519,11 +609,11 @@
app()->db->insert('banned',$ban);
app()->message(tr('IP %1 has been banned!',$ip));
if (isset($_GET['nextaction']))
- redirect('?action='.$_GET['nextaction']);
+ $this->nextStep(1,$_GET['nextaction']);
} else {
app()->error(tr('IP %1 was already in state: %2!',$ip,$ban['access']));
if (isset($_GET['newaction']))
- redirect('?action='.$_GET['newaction']);
+ $this->nextStep(1,$_GET['newaction']);
}
} else if (isset($_POST['addbannedip'])) {
$ip = $_POST['addbannedip'];
Modified: trunk/plugins/mimetypes.inc.php
===================================================================
--- trunk/plugins/mimetypes.inc.php 2008-11-06 14:12:08 UTC (rev 123)
+++ trunk/plugins/mimetypes.inc.php 2008-11-06 19:57:33 UTC (rev 124)
@@ -4,14 +4,38 @@
function MimeTypesPlugin() {
$this->description = tr('Limit the mimetypes a user can upload');
+ $this->options = array(
+ array('name' => 'allowed', 'description' => tr('Allowed mime types'), 'type' => 'list'),
+ array('name' => 'message', 'description' => tr('Types in message'), 'type' => 'text'),
+ );
+ /* load the plugin configuration */
}
+ function getGroup() {
+ $group = app()->user->group();
+ if (is_array($group)) {
+ /* check for which group there is a configuration */
+ foreach ($group as $g) {
+ if (isset($this->config['allowed'][$g])) {
+ if (count($this->config['allowed'])) {
+ return $g;
+ }
+ }
+ }
+ return $group[0];
+ } else {
+ return $group;
+ }
+ }
+
function uploadForm(&$finfo,$acl) {
if ($acl!='enable') return true;
- if (count(app()->config['mimetypes'])==0) {
+ $group = $this->getGroup();
+ if (count($this->config['allowed'][$group])==0) {
app()->error(tr('WARNING: no mime types defined. Plugin has been disabled!'));
} else {
- $this->assign('mimetypes',app()->config['mimetypes']);
+ $this->assign('message',$this->config['message'][$group]);
+ $this->assign('mimetypes',$this->config['allowed'][$group]);
$this->display('uploadForm');
}
return true;
@@ -19,9 +43,10 @@
function uploadOptions(&$finfo,$acl) {
if ($acl!='enable') return true;
- if (count(app()->config['mimetypes'])==0) {
+ $group = $this->getGroup();
+ if (count($this->config['allowed'][$group])==0) {
app()->error(tr('WARNING: no mime types defined. Plugin has been disabled!'));
- } else if (array_search($finfo['mime'],app()->config['mimetypes'])===FALSE) {
+ } else if (array_search($finfo['mime'],$this->config['allowed'][$group])===FALSE) {
app()->error(tr('This file type (%1) is not allowed on this site!',$finfo['mime']));
return false;
}
Modified: trunk/templates/default/modules/admin/groups.tpl
===================================================================
--- trunk/templates/default/modules/admin/groups.tpl 2008-11-06 14:12:08 UTC (rev 123)
+++ trunk/templates/default/modules/admin/groups.tpl 2008-11-06 19:57:33 UTC (rev 124)
@@ -7,9 +7,9 @@
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
- <th width="100">Name</th>
- <th width="200">Description</th>
- <th width="100">Actions</th>
+ <th width="100">{tr}Group Name{/tr}</th>
+ <th>width="200">{tr}Description{/tr}</th>
+ <th width="100">{tr}Actions{/tr}</th>
</tr>
{foreach from=$groups item=g}
{cycle values="row1,row2" advance=true assign=rid}
Added: trunk/templates/default/modules/admin/pluginoptionadd.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginoptionadd.tpl (rev 0)
+++ trunk/templates/default/modules/admin/pluginoptionadd.tpl 2008-11-06 19:57:33 UTC (rev 124)
@@ -0,0 +1,27 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+
+<form action="{$script}" method="post">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<input type="hidden" name="id" value="{$pluginname}">
+<table border="0">
+<tr><td>{tr}Group{/tr}:</td><td>
+ <select name="gid">
+ {foreach from=$groups item=g}
+ <option value="{$g.name}">{$g.description}</option>
+ {/foreach}
+ </select></td>
+</tr>
+{foreach from=$options item=o}
+<tr><td valign="top">{$o.description}:</td><td>
+{if $o.type=='list'}
+<textarea cols="40" rows="6" name="{$o.name}">
+{$plugin_options[$o.name].value}
+</textarea>
+{elseif $o.type=='text'}
+<input type="text" name="{$o.name}" value="{$plugin_options[$o.name].value}"></td></tr>
+{/if}
+{/foreach}
+<tr><td colspan="2" align=right><input type="submit" class="submit" value="{tr}Confirm{/tr}"></td></tr>
+</table>
+</form>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/pluginoptiondetail.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginoptiondetail.tpl (rev 0)
+++ trunk/templates/default/modules/admin/pluginoptiondetail.tpl 2008-11-06 19:57:33 UTC (rev 124)
@@ -0,0 +1,38 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+<h3>{$pluginname}</h3>
+
+{if count($options)==0}
+<div id="message">{tr}Plugin does not have any option to be configured{/tr}</div>
+{else}
+<div id="toolbar">
+<a href="{$script}?action={$action}&step=3&id={$pluginname}"><img src="{tpl file=/img/admin/tadd.png}"></a>
+<img src="{tpl file=/img/admin/tdelete.png}">
+</div>
+<br>
+<table border="0" id="dbtable">
+ <tr>
+ <th width="150">{tr}Group{/tr}</th>
+{foreach from=$options item=o}
+ <th width="200">{$o.description}</th>
+{/foreach}
+ <th width="80">{tr}Actions{/tr}</th>
+ </tr>
+{foreach from=$groups item=g}
+ {cycle values="row1,row2" advance=true assign=rid}
+ {if isset($plugin_options[$g.name])}
+ <tr>
+ <td id="{$rid}" style="text-align:left; vertical-align: top;">
+ <a href="{$script}?action={$action}&step=4&id={$pluginname}&gid={$g.name}">{$g.name}</a></td>
+ {foreach from=$options item=o}
+ <td id="{$rid}" style="text-align:left; vertical-align: top;"><pre>{$plugin_options[$g.name][$o.name].value}</pre></td>
+ {/foreach}
+ <td id="{$rid}" style="text-align:justify">
+ <a href="{$script}?action={$action}&step=4&id={$pluginname}&gid={$g.name}"><img src="{tpl file=/img/admin/edit_plugin.png}"></a>
+
+ <a href="{$script}?action={$action}&step=5&id={$pluginname}&gid={$g.name}"><img src="{tpl file=/img/admin/delete.png}"></a></td>
+ </td>
+ </tr>
+ {/if}
+{/foreach}
+</table>
+{/if}
\ No newline at end of file
Added: trunk/templates/default/modules/admin/pluginoptionedit.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginoptionedit.tpl (rev 0)
+++ trunk/templates/default/modules/admin/pluginoptionedit.tpl 2008-11-06 19:57:33 UTC (rev 124)
@@ -0,0 +1,19 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+
+<form action="{$script}" method="post">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<input type="hidden" name="id" value="{$pluginname}">
+<input type="hidden" name="gid" value="{$gid}">
+<table border="0">
+<tr><td>{tr}Group{/tr}:</td><td>{$gid}</td></tr>
+{foreach from=$options item=o}
+<tr><td valign="top">{$o.description}:</td><td>{if $o.type=='list'}
+<textarea cols="40" rows="6" name="{$o.name}">{$plugin_options[$o.name].value}</textarea>
+{elseif $o.type=='text'}
+<input type="text" name="{$o.name}" value="{$plugin_options[$o.name].value}"></td></tr>
+{/if}
+{/foreach}
+<tr><td colspan="2" align=right><input type="submit" class="submit" value="{tr}Confirm{/tr}"></td></tr>
+</table>
+</form>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/pluginoptions.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginoptions.tpl 2008-11-06 14:12:08 UTC (rev 123)
+++ trunk/templates/default/modules/admin/pluginoptions.tpl 2008-11-06 19:57:33 UTC (rev 124)
@@ -1,4 +1,5 @@
{include file="default/modules/admin/adminmenu.tpl"}
+<br>
<table border="0" id="dbtable">
<tr>
<th width="100">Plugin</th>
Modified: trunk/templates/default/modules/admin/rights.tpl
===================================================================
--- trunk/templates/default/modules/admin/rights.tpl 2008-11-06 14:12:08 UTC (rev 123)
+++ trunk/templates/default/modules/admin/rights.tpl 2008-11-06 19:57:33 UTC (rev 124)
@@ -2,9 +2,9 @@
<br>
<table border="0" id="dbtable">
<tr>
- <th width="100">Name</th>
- <th width="200">Description</th>
- <th width="100">Rights set?</th>
+ <th width="100">{tr}Gruppo{/tr}</th>
+ <th width="200">{tr}Description{/tr}</th>
+ <th width="100">{tr}Rights set?{/tr}</th>
</tr>
{foreach from=$groups item=g}
{cycle values="row1,row2" advance=true assign=rid}
Modified: trunk/templates/default/plugins/mimetypes/uploadForm.tpl
===================================================================
--- trunk/templates/default/plugins/mimetypes/uploadForm.tpl 2008-11-06 14:12:08 UTC (rev 123)
+++ trunk/templates/default/plugins/mimetypes/uploadForm.tpl 2008-11-06 19:57:33 UTC (rev 124)
@@ -1 +1,4 @@
-<div id="mime">{tr}Only the following mime types are allowed{/tr} ({foreach from=$mimetypes item=m}{$m}, {/foreach})</div>
\ No newline at end of file
+<div id="mime">{tr}Only the following mime types are allowed{/tr} (
+{if $message!=''}{$message}
+{else}{foreach from=$mimetypes item=m}{$m}, {/foreach}{/if}
+)</div>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-06 14:12:15
|
Revision: 123
http://openupload.svn.sourceforge.net/openupload/?rev=123&view=rev
Author: tsdogs
Date: 2008-11-06 14:12:08 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
complete languages administration
Modified Paths:
--------------
trunk/lib/modules/default/admin.inc.php
trunk/templates/default/modules/admin/pluginoptions.tpl
Added Paths:
-----------
trunk/templates/default/modules/admin/langadd.tpl
trunk/www/templates/default/img/admin/edit_lang.png
trunk/www/templates/default/img/admin/langs.png
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-11-06 12:40:40 UTC (rev 122)
+++ trunk/lib/modules/default/admin.inc.php 2008-11-06 14:12:08 UTC (rev 123)
@@ -588,6 +588,43 @@
}
function langadd() {
+ if (isset($_POST['addlangid'])) {
+ $lang['id']=$_POST['addlangid'];
+ $lang['name']=$_POST['addlangname'];
+ $lang['locale']=$_POST['addlanglocale'];
+ $lang['browser']=$_POST['addlangbrowser'];
+ $lang['charset']=$_POST['addlangcharset'];
+ $lang['active']=isset($_POST['addlangactive'])?1:0;
+ //$this->tpl->assign('lang' , $lang[0]);
+ $tmp = app()->db->read('langs',array('id' => $_POST['id']));
+ if ($lang['id']=='') {
+ $error = true;
+ app()->error(tr('Language "%1" cannot be empty',tr('ID')));
+ } else if ($tmp[0]['id']==$lang['id']) {
+ $error = true;
+ app()->error(tr('Language "%1" already exists!',$lang['id']));
+ }
+ if ($lang['name']=='') {
+ $error = true;
+ app()->error(tr('Language "%1" cannot be empty!',tr('Name')));
+ }
+ if ($lang['locale']=='') {
+ $error = true;
+ app()->error(tr('Language "%1" cannot be empty!',tr('Locale')));
+ }
+ if ($lang['charset']=='') {
+ $error = true;
+ app()->error(tr('Language "%1" cannot be empty!',tr('Charset')));
+ }
+ if (!$error) {
+ app()->db->insert('langs',$lang);
+ $this->nextStep(1);
+ }
+ } else {
+ $lang['name']='New language';
+ $lang['active']=1;
+ }
+
}
function langedit() {
@@ -613,6 +650,12 @@
}
function langdel() {
+ global $_GET;
+
+ if (isset($_GET['id'])) {
+ app()->db->delete('langs',array( 'id' => $_GET['id']));
+ }
+ $this->nextStep(1);
}
function langtoggle() {
Added: trunk/templates/default/modules/admin/langadd.tpl
===================================================================
--- trunk/templates/default/modules/admin/langadd.tpl (rev 0)
+++ trunk/templates/default/modules/admin/langadd.tpl 2008-11-06 14:12:08 UTC (rev 123)
@@ -0,0 +1,15 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+
+<form action="{$script}" method="post">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<table border="0">
+<tr><td>{tr}ID{/tr}:</td><td><input type="text" name="addlangid" value="{$lang.id}"></td></tr>
+<tr><td>{tr}Name{/tr}:</td><td><input type="text" name="addlangname" value="{$lang.name}"></td></tr>
+<tr><td>{tr}Locale{/tr}:</td><td><input type="text" name="addlanglocale" value="{$lang.locale}"></td></tr>
+<tr><td>{tr}Browser recon{/tr}:</td><td><input type="text" name="addlangbrowser" value="{$lang.browser}"></td></tr>
+<tr><td>{tr}Charset{/tr}:</td><td><input type="text" name="addlangcharset" value="{$lang.charset}"></td></tr>
+<tr><td>{tr}Active{/tr}:</td><td><input type="checkbox" name="addlangactive" value="1" {if $lang.active==1}checked{/if}></td></tr>
+<tr><td colspan="2" align=right><input type="submit" class="submit" value="{tr}Confirm{/tr}"></td></tr>
+</table>
+</form>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/pluginoptions.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginoptions.tpl 2008-11-06 12:40:40 UTC (rev 122)
+++ trunk/templates/default/modules/admin/pluginoptions.tpl 2008-11-06 14:12:08 UTC (rev 123)
@@ -1,3 +1,15 @@
{include file="default/modules/admin/adminmenu.tpl"}
-<br>
-<h1>To be implemented!!!</h1>
\ No newline at end of file
+<table border="0" id="dbtable">
+<tr>
+ <th width="100">Plugin</th>
+ <th width="400">Description</th>
+</tr>
+{foreach from=$pluginlist item=p}
+{cycle values="row1,row2" advance=true assign=rid}
+<tr>
+ <td id="{$rid}" style="text-align:left; vertical-align: top;">
+ <a href="{$script}?action={$action}&step=2&id={$p.name}">{$p.name}</a></td>
+ <td id="{$rid}" style="text-align:justify">{$p.description}</td>
+</tr>
+{/foreach}
+</table>
\ No newline at end of file
Added: trunk/www/templates/default/img/admin/edit_lang.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/edit_lang.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/langs.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/langs.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-06 12:40:42
|
Revision: 122
http://openupload.svn.sourceforge.net/openupload/?rev=122&view=rev
Author: tsdogs
Date: 2008-11-06 12:40:40 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
Add initial language administration
remove not needed file for rights
Added Paths:
-----------
trunk/templates/default/modules/admin/langedit.tpl
trunk/templates/default/modules/admin/langs.tpl
Removed Paths:
-------------
trunk/templates/default/modules/admin/rightadd.tpl
Added: trunk/templates/default/modules/admin/langedit.tpl
===================================================================
--- trunk/templates/default/modules/admin/langedit.tpl (rev 0)
+++ trunk/templates/default/modules/admin/langedit.tpl 2008-11-06 12:40:40 UTC (rev 122)
@@ -0,0 +1,16 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+
+<form action="{$script}" method="post">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<input type="hidden" name="id" value="{$lang.id}">
+<table border="0">
+<tr><td>{tr}ID{/tr}:</td><td>{$lang.id}</td></tr>
+<tr><td>{tr}Name{/tr}:</td><td><input type="text" name="editlangname" value="{$lang.name}"></td></tr>
+<tr><td>{tr}Locale{/tr}:</td><td><input type="text" name="editlanglocale" value="{$lang.locale}"></td></tr>
+<tr><td>{tr}Browser recon{/tr}:</td><td><input type="text" name="editlangbrowser" value="{$lang.browser}"></td></tr>
+<tr><td>{tr}Charset{/tr}:</td><td><input type="text" name="editlangcharset" value="{$lang.charset}"></td></tr>
+<tr><td>{tr}Active{/tr}:</td><td><input type="checkbox" name="editlangactive" value="1" {if $lang.active==1}checked{/if}></td></tr>
+<tr><td colspan="2" align=right><input type="submit" class="submit" value="{tr}Confirm{/tr}"></td></tr>
+</table>
+</form>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/langs.tpl
===================================================================
--- trunk/templates/default/modules/admin/langs.tpl (rev 0)
+++ trunk/templates/default/modules/admin/langs.tpl 2008-11-06 12:40:40 UTC (rev 122)
@@ -0,0 +1,33 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+<div id="toolbar">
+<a href="{$script}?action={$action}&step=2&id={$u.id}"><img src="{tpl file=/img/admin/tadd.png}"></a>
+<img src="{tpl file=/img/admin/tdelete.png}">
+</div>
+<br>
+<table border="0" id="dbtable">
+<tr>
+ <th width="10">S</th>
+ <th width="100">ID</th>
+ <th width="200">Name</th>
+ <th width="100">Locale</th>
+ <th width="20">Active</th>
+ <th width="100">Actions</th>
+</tr>
+{foreach from=$langlist item=l}
+{cycle values="row1,row2" advance=true assign=rid}
+<tr>
+ <td id="{$rid}"><input type="checkbox" name="user_{$l.id}" value="1"></td>
+ <td id="{$rid}"><a href="{$script}?action={$action}&step=3&id={$l.id}">{$l.id}</a></td>
+ <td id="{$rid}">{$l.name}</td>
+ <td id="{$rid}">{$l.locale}</td>
+ <td id="{$rid}"><a href="{$script}?action={$action}&step=5&id={$l.id}&active={$l.active}">
+ <img src="{tpl file='/img/admin/active%s.png'|sprintf:$l.active}">
+ </a>
+ </td>
+ <td id="{$rid}">
+ <a href="{$script}?action={$action}&step=3&id={$l.id}"><img src="{tpl file=/img/admin/edit_lang.png}"></a>
+
+ <a href="{$script}?action={$action}&step=4&id={$l.id}"><img src="{tpl file=/img/admin/delete.png}"></a></td>
+</tr>
+{/foreach}
+</table>
\ No newline at end of file
Deleted: trunk/templates/default/modules/admin/rightadd.tpl
===================================================================
--- trunk/templates/default/modules/admin/rightadd.tpl 2008-11-06 12:39:52 UTC (rev 121)
+++ trunk/templates/default/modules/admin/rightadd.tpl 2008-11-06 12:40:40 UTC (rev 122)
@@ -1,28 +0,0 @@
-{include file="default/modules/admin/adminmenu.tpl"}
-
-<form action="{$script}" method="post">
-<input type="hidden" name="action" value="{$action}">
-<input type="hidden" name="step" value="{$step}">
-<table border="0">
-<tr><td>{tr}Group{/tr}:</td><td>
-<select name="addrightgroup">
-{foreach from=$groups item=g}
-<option value="{$g.name}" {if $g.name==$right.group_name}selected{/if}>{$g.name}</option>
-{/foreach}
-</select></td></tr>
-<tr><td>{tr}Module{/tr}:</td><td>
-<select name="addrightmodule">
-{foreach from=$modules item=m}
-<option value="{$m}" {if $m==$right.module}selected{/if}>{$m}</option>
-{/foreach}
-</select></td></tr>
-<tr><td>{tr}Action{/tr}:</td><td><input type="text" name="addrightaction" value="{$right.action}"></td></tr>
-<tr><td>{tr}Access{/tr}:</td><td>
-<select name="addrightaccess">
-{foreach from=$access item=a key=k}
-<option value="{$k}" {if $k==$right.access}selected{/if}>{$a}</option>
-{/foreach}
-</select></td></tr>
-<tr><td colspan="2" align=right><input type="submit" class="submit" value="{tr}Add{/tr}"></td></tr>
-</table>
-</form>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|