source: trunk/admin/include/uploadify/uploadify.php @ 5195

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
Line 
1<?php
2define('PHPWG_ROOT_PATH','../../../');
3define('IN_ADMIN', true);
4
5$_COOKIE['pwg_id'] = $_POST['session_id'];
6
7include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
8include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
9include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
10
11check_pwg_token();
12
13ob_start();
14print_r($_FILES);
15print_r($_POST);
16print_r($user);
17$tmp = ob_get_contents(); 
18ob_end_clean();
19error_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
28if (!isset($_SESSION['uploads']))
29{
30  $_SESSION['uploads'] = array();
31}
32
33if (!isset($_SESSION['uploads'][ $_POST['upload_id'] ]))
34{
35  $_SESSION['uploads'][ $_POST['upload_id'] ] = array();
36}
37
38array_push(
39  $_SESSION['uploads'][ $_POST['upload_id'] ],
40  $image_id
41  );
42
43echo "1";
44?>
Note: See TracBrowser for help on using the repository browser.