diff options
| -rw-r--r-- | blob/files.conf | 50 | ||||
| -rw-r--r-- | www/register.php | 2 |
2 files changed, 51 insertions, 1 deletions
diff --git a/blob/files.conf b/blob/files.conf new file mode 100644 index 0000000..9b7ab95 --- /dev/null +++ b/blob/files.conf @@ -0,0 +1,50 @@ +server { + listen 80; + server_name files.iamfabulous.de; + index index.html; + root /var/www/files/www; + #location / { + # autoindex on; + #} + + error_page 404 /lolrndm.php; + error_page 401 /lolrndm.php; + + location ~* \.php { + fastcgi_pass unix:/var/run/php5-fpm.sock; + include fastcgi_params;# SCRIPT_FILENAME $document_root$fastcgi_script_name; +# fastcgi_param SCRIPT_FILENAME $request_filename; + } + + #try_files $URI /files.php; + + location ~* ^/?login(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? { + rewrite ^/?login(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /login.php?$1 last; + } + + location ~* ^/?register(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? { + rewrite ^/?register(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /register.php?$1 last; + } + + location ~* ^/?invite(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? { + rewrite ^/?invite(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /invite.php?$1 last; + } + + location ~* \.php(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? { + } + + location / { + rewrite ^/([0-9a-zA-Z-_]*)/(.*) /index.php?name=$1&folder=$2 last; + rewrite ^/([0-9a-zA-Z-_]*) /index.php?name=$1&folder=$2 last; + break; + } + + #rewrite ^/(.*) /files.php?$1 break; + #rewrite ^/(.*) https://$server_name/$1 permanent; + +# location /admin { +# autoindex on; +# auth_basic "protected"; +# auth_basic_user_file /etc/nginx/claudio.passwd; +# } +} diff --git a/www/register.php b/www/register.php index 01ac54c..5322df8 100644 --- a/www/register.php +++ b/www/register.php @@ -56,7 +56,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { if($db->exec(" BEGIN TRANSACTION; UPDATE user SET name='$safe_name', salt='$salt', password='$hash_password', status=1, invites=5 WHERE email='$safe_email'; - CREATE TABLE $safe_name (id INTEGER PRIMARY KEY, folder INTEGER, name TEXT, typ TEXT, public TEXT); + CREATE TABLE $safe_name (id INTEGER PRIMARY KEY, folder INTEGER, name TEXT, type TEXT, public TEXT); INSERT INTO $safe_name (id, folder, name, typ, public) VALUES (NULL, 0, '/', 'FOLDER', 'HIDDEN'); COMMIT;") ){ |
