<?php
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
-
-# This form was initially auto-generated. If you would like to alter the
-# parameters and generate a new one try this URL:
-#
-# http://metaform.l/?file_name=admin_files&table_name=files&singular=file&plural=files&opt_email=No&opt_db=Yes&opt_listing=Yes&opt_display=No&opt_pass=Yes&opt_public_form=No&opt_public_display=No&fields=filename+file%0D%0Adescription+textbox&edit=yes
-
-
-# SETUP
-
-# To save results to a database, you'll need to create the files table
-# (the file admin_files.sql should help with this), and create the file
-# 'code/db_connect.php' which calls db_connect() see:
-# inc/wfpl/examples/db_connect.php
-#
-# if you rename any of the database fields, you'll need to update this:
+# This form requires wfpl. See: http://sametwice.com/wfpl
define('ADMIN_FILES_DB_FIELDS', 'filename,description');
$GLOBALS['filename_file_name'] = uniqid() . getmypid() . '.txt';
-require_once('inc/wfpl/format.php');
-require_once('inc/wfpl/email.php');
-require_once('inc/wfpl/upload.php');
+require_once(__DIR__.'/'.'inc/wfpl/format.php');
+require_once(__DIR__.'/'.'inc/wfpl/email.php');
+require_once(__DIR__.'/'.'inc/wfpl/upload.php');
function admin_files_get_fields() {
$data = array();
#header('Content-Type: text/plain');
#print_r(array($_REQUEST['filename'], $_FILES['filename']));
#exit();
- $filename_filename_tmp = format_filename($_FILES['filename']['name']);
+ $filename_filename_tmp = format_filename($_FILES['filename']['name'], true);
if(!$filename_filename_tmp) {
$filename_filename_tmp = $GLOBALS['filename_file_name'];
}
if(_REQUEST_cut('delete_filename') == 'Yes') {
$data['filename'] = '';
} else {
- $data['filename'] = format_path(_REQUEST_cut('old_filename'));
+ $data['filename'] = format_path(_REQUEST_cut('old_filename'), true);
}
}
unset($_FILES['filename']);
function admin_files_main() {
- if(logged_in_as_admin()) {
- tem_set('admin_privs');
- } else {
- $_REQUEST['url'] = this_url();
- return 'admin_login';
- }
+ session_auth_must('admin_files');
$id = _REQUEST_cut('edit_id');
if($id) {