Last change
on this file since 5195 was
5195,
checked in by plg, 14 years ago
|
bug 1328: backport the pwg_token on trunk
bug 1329: backport the check_input_parameter on trunk
feature 1026: add pwg_token feature for edit/delete comment. Heavy refactoring
on this feature to make the code simpler and easier to maintain (I hope).
|
File size:
913 bytes
|
Rev | Line | |
---|
[5089] | 1 | <?php |
---|
| 2 | define('PHPWG_ROOT_PATH','../../../'); |
---|
| 3 | define('IN_ADMIN', true); |
---|
| 4 | |
---|
| 5 | $_COOKIE['pwg_id'] = $_POST['session_id']; |
---|
| 6 | |
---|
| 7 | include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); |
---|
| 8 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
| 9 | include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php'); |
---|
| 10 | |
---|
[5195] | 11 | check_pwg_token(); |
---|
[5089] | 12 | |
---|
| 13 | ob_start(); |
---|
| 14 | print_r($_FILES); |
---|
| 15 | print_r($_POST); |
---|
| 16 | print_r($user); |
---|
| 17 | $tmp = ob_get_contents(); |
---|
| 18 | ob_end_clean(); |
---|
| 19 | error_log($tmp, 3, "/tmp/php-".date('YmdHis').'-'.sprintf('%020u', rand()).".log"); |
---|
| 20 | |
---|
| 21 | $image_id = add_uploaded_file( |
---|
| 22 | $_FILES['Filedata']['tmp_name'], |
---|
| 23 | $_FILES['Filedata']['name'], |
---|
| 24 | null, |
---|
| 25 | 8 |
---|
| 26 | ); |
---|
| 27 | |
---|
| 28 | if (!isset($_SESSION['uploads'])) |
---|
| 29 | { |
---|
| 30 | $_SESSION['uploads'] = array(); |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | if (!isset($_SESSION['uploads'][ $_POST['upload_id'] ])) |
---|
| 34 | { |
---|
| 35 | $_SESSION['uploads'][ $_POST['upload_id'] ] = array(); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | array_push( |
---|
| 39 | $_SESSION['uploads'][ $_POST['upload_id'] ], |
---|
| 40 | $image_id |
---|
| 41 | ); |
---|
| 42 | |
---|
| 43 | echo "1"; |
---|
| 44 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.