]> git.p6c8.net - jirafeau_mojo42.git/blobdiff - script.php
Update README.md
[jirafeau_mojo42.git] / script.php
index b8c4bcf10e92e0bce463ada017e7ecb875fa7608..0d4aeab43d59e7ad8cf8f74de6c1fc7e8c9b5942 100644 (file)
@@ -99,6 +99,9 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES)
             case 'week':
                 $time += JIRAFEAU_WEEK;
                 break;
             case 'week':
                 $time += JIRAFEAU_WEEK;
                 break;
+            case 'fortnight':
+                $time += JIRAFEAU_FORTNIGHT;
+                break;
             case 'month':
                 $time += JIRAFEAU_MONTH;
                 break;
             case 'month':
                 $time += JIRAFEAU_MONTH;
                 break;
@@ -127,12 +130,18 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES)
         exit;
     }
 
         exit;
     }
 
+    if ($cfg['store_uploader_ip']) {
+        $ip = get_ip_address($cfg);
+    } else {
+        $ip = "";
+    }
+    
     $res = jirafeau_upload(
         $_FILES['file'],
         isset($_POST['one_time_download']),
         $key,
         $time,
     $res = jirafeau_upload(
         $_FILES['file'],
         isset($_POST['one_time_download']),
         $key,
         $time,
-        get_ip_address($cfg),
+        $ip,
         $cfg['enable_crypt'],
         $cfg['link_name_length'],
         $cfg['file_hash']
         $cfg['enable_crypt'],
         $cfg['link_name_length'],
         $cfg['file_hash']
@@ -251,8 +260,8 @@ if [ -n "$JIRAFEAU_ONE_TIME" ]; then
     one_time='1'
 fi
 
     one_time='1'
 fi
 
-if [ -n "$UPLOAD_PASSWD" ]; then
-    upload_password="$JIRAFEAU_UPLOAD_PASSWORD"
+if [ -n "$JIRAFEAU_UPLOAD_PASSWD" ]; then
+    upload_password="$JIRAFEAU_UPLOAD_PASSWD"
 fi
 
 if [ -z "$curl" ]; then
 fi
 
 if [ -z "$curl" ]; then
@@ -284,9 +293,9 @@ if [ -z "$2" ]; then
     echo "    $0 delete URL"
     echo
     echo "Global variables to export:"
     echo "    $0 delete URL"
     echo
     echo "Global variables to export:"
-    echo "    JIRAFEAU_PROXY: Domain and port of proxy server, eg. »proxysever.example.com:3128«"
+    echo "    JIRAFEAU_PROXY: Domain and port of proxy server, eg. »proxyserver.example.com:3128«"
     echo "    JIRAFEAU_URL : URI to Jirafeau installation with trailing slash, eg. »https://example.com/jirafeau/«"
     echo "    JIRAFEAU_URL : URI to Jirafeau installation with trailing slash, eg. »https://example.com/jirafeau/«"
-    echo "    JIRAFEAU_TIME : expiration time, eg. »minute«, »hour«, »day«, »week«, »month«, »quarter«, »year« or »none«"
+    echo "    JIRAFEAU_TIME : expiration time, eg. »minute«, »hour«, »day«, »week«, fortnight, »month«, »quarter«, »year« or »none«"
     echo "    JIRAFEAU_ONE_TIME : self-destroy after first download, eg. »1« to enable or »« (empty) to disable"
     echo "    JIRAFEAU_CURL : alternative path to curl binary"
     echo "    JIRAFEAU_UPLOAD_PASSWD : upload password"
     echo "    JIRAFEAU_ONE_TIME : self-destroy after first download, eg. »1« to enable or »« (empty) to disable"
     echo "    JIRAFEAU_CURL : alternative path to curl binary"
     echo "    JIRAFEAU_UPLOAD_PASSWD : upload password"
@@ -372,12 +381,12 @@ if [ "$1" == "send" ]; then
     echo
     echo "Download via API:"
     if [[ $key_code ]]; then
     echo
     echo "Download via API:"
     if [[ $key_code ]]; then
-        echo "    ${0} get ${url}${apipage}?h=$code&k=$key_code [PASSWORD}"
+        echo "    ${0} get ${url}${apipage}?h=$code&k=$key_code [PASSWORD]"
     else
     else
-        echo "    ${0} get ${url}${apipage}?h=$code [PASSWORD}"
+        echo "    ${0} get ${url}${apipage}?h=$code [PASSWORD]"
     fi
     echo "Delete via API:"
     fi
     echo "Delete via API:"
-    echo "    ${0} delete ${url}${downloadpage}?h=$code&d=$del_code"
+    echo "    ${0} delete \"${url}${downloadpage}?h=$code&d=$del_code\""
 
 elif [ "$1" == "get" ]; then
     if [ -z "$password" ]; then
 
 elif [ "$1" == "get" ]; then
     if [ -z "$password" ]; then
@@ -386,7 +395,7 @@ elif [ "$1" == "get" ]; then
         $curl $proxy -OJ -X POST -F key=$password "$2"
     fi
 elif [ "$1" == "delete" ]; then
         $curl $proxy -OJ -X POST -F key=$password "$2"
     fi
 elif [ "$1" == "delete" ]; then
-    $curl $proxy "$2"
+    $curl $proxy "$2" --data-raw "do_delete=1%2F" | grep "div class" |sed -e "s/<[^>]\+>//g"
 fi
 <?php
     } else {
 fi
 <?php
     } else {
@@ -447,6 +456,9 @@ elseif (isset($_GET['init_async'])) {
             case 'week':
                 $time += JIRAFEAU_WEEK;
                 break;
             case 'week':
                 $time += JIRAFEAU_WEEK;
                 break;
+            case 'fortnight':
+                $time += JIRAFEAU_FORTNIGHT;
+                break;
             case 'month':
                 $time += JIRAFEAU_MONTH;
                 break;
             case 'month':
                 $time += JIRAFEAU_MONTH;
                 break;
@@ -461,13 +473,20 @@ elseif (isset($_GET['init_async'])) {
                 break;
         }
     }
                 break;
         }
     }
+
+    if ($cfg['store_uploader_ip']) {
+        $ip = get_ip_address($cfg);
+    } else {
+        $ip = "";
+    }
+    
     echo jirafeau_async_init(
         $_POST['filename'],
         $type,
         isset($_POST['one_time_download']),
         $key,
         $time,
     echo jirafeau_async_init(
         $_POST['filename'],
         $type,
         isset($_POST['one_time_download']),
         $key,
         $time,
-        get_ip_address($cfg)
+        $ip
     );
 }
 /* Continue an asynchronous upload. */
     );
 }
 /* Continue an asynchronous upload. */

patrick-canterino.de