Cross-platform Batch Uploading - Page 3 Cross-platform Batch Uploading - Page 3
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Cross-platform Batch Uploading

Started by mstralka, July 23, 2004, 04:37:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mhaller

hey guys,
i'm the developer of jupload and will try to bring some light into the problems:

- since jupload is still under development, many internal structures change between releases
- the completURL parameter does not work with realTimeResponse enabled for >0.75. just switch off with <param name="realTimeResponse" value="false"> and completeURL should work fine.
- the license problem can be discussed, i would be willing to give permission to redistribute jupload within coppermine, although i can't give out the source code (is this necessary for GPL?)

if you've got any questions, or want to request the current beta (many bugfixes and a few new, neat features like screenshot and clipboard support), just send me an email to support@jupload.biz - i try to answer every mail.

and thanks for using jupload :-)

greets
Mike

peubarge

Hi!
First of all, thanks for this great add-on and great applet (jupload).

After a few hours, i finally got it working. I sitill have a problem though:

When I upload 2 or 3 files with jupload, it works perfectly. When I select more files, and it takes of course more time, I get the following error in the appache error log:

[client 62.167.185.177] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\Inetpub\\wwwroot\\cpg132\\upload.php on line 21

I tried changing the value in php.ini to 3600 seconds (!) and I still get:

[client 62.167.185.177] PHP Fatal error:  Maximum execution time of 3600 seconds exceeded in C:\\Inetpub\\wwwroot\\cpg132\\upload.php on line 21

I really don't know what to do!

The server is a Windows Server 2003 with Appache 2.0.50 and php 4.3.9

I am using jupload 0.75 and cpg 1.3.2

Any idea?

Joachim Müller

Quote from: mhaller on November 27, 2004, 08:37:03 PM
- the license problem can be discussed, i would be willing to give permission to redistribute jupload within coppermine, although i can't give out the source code (is this necessary for GPL?)
Packaging jupload with coppermine would be possible, but we couldn't label it as being open source under GPL, we'd have to state that part of it isn't. I think people would be shying away from the whole package if it wasn't released under GPL fully, that's why I suggest having jupload as a separate download; maybe we could ship the coppermine package (for future versions) with everything it takes to use jupload right from the start. People would then find reference to jupload in the documentation together with a link where they can get it. How does this sound to you?

Joachim

AWJunkies

Is this MOD still all good? Should I attempt to instal on the new 1.4.3 stable? I need users to be able to upload more then 10 files. The other copermine I had it was one at a time and it drove the members crazy. Now 10 is small step forward but we are talking about hundreds of photos that need to be uploaded at a time.  Anything higher then 10 would be awesome. Is there any other solutions out there?

Joachim Müller

The thread is labelled "1.3.x", so we don't know if it will work with cpg1.4.x - why don't you try to find out and post your report here. If it works with cpg1.4.x as well, we'll re-label this thread.

AWJunkies

Ok I will try it for sure. Just saw that is was 6 months old.

AWJunkies

I got all the group permission stuff to work and java applet to show. Only issue I am having is with creating the tempdata in the temptable. I am not getting any errors. The bottom status bar just keeps going accross until full and just sits there. I left it on while I went to eat and was still like that. Not sure what is causing the stall up or why it is not inserting into table. I will keep at it and get it to work. I really need this mod.

AWJunkies

If someone could help me with this JUpload MOD to 1.4.3 Stand alone stable. Everything seems to be working but the cookie stuff. The core code is totaly different in 1.4.3.

1.3.5
functions.inc.php before JUpload MOD
function user_get_profile()
{
        global $CONFIG, $USER, $HTTP_COOKIE_VARS;

        if (isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_data'])) {
                $USER = @unserialize(@base64_decode($HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_data']));
        }

        if (!isset($USER['ID']) || strlen($USER['ID']) != 32) {
                list($usec, $sec) = explode(' ', microtime());
                $seed = (float) $sec + ((float) $usec * 100000);
                srand($seed);
                $USER=array('ID' => md5(uniqid(rand(),1)));
        } else {
                $USER['ID'] = addslashes($USER['ID']);
        }

        if (!isset($USER['am'])) $USER['am'] = 1;
}


1.3.5
functions.inc.php WITH JUpload MOD
function user_get_profile()
{
global $CONFIG, $USER, $HTTP_COOKIE_VARS;
if (isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_data'])) {
$USER = @unserialize(@base64_decode($HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_data']));
} else if (isset($_GET["cookie"])) {
//JUpload Modification Mark Stralka 7/25/2004
//if a parameter named "cookie" is passed, try to parse it into the the $USER object and
//set the cookie values.
$USER = @unserialize(@base64_decode($_GET["cookie"]));
$HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_uid'] = $USER[$CONFIG['cookie_name'].'_uid'];
$HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_data'] = $USER[$CONFIG['cookie_name'].'_data'];
$HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_pass'] = $USER[$CONFIG['cookie_name'].'_pass'];
}

if (!isset($USER['ID']) || strlen($USER['ID']) != 32) {
list($usec, $sec) = explode(' ', microtime());
$seed = (float) $sec + ((float) $usec * 100000);
srand($seed);
$USER=array('ID' => md5(uniqid(rand(),1)));
} else {
$USER['ID'] = addslashes($USER['ID']);
}

if (!isset($USER['am'])) $USER['am'] = 1;
}


1.4.3
functions.inc.php before JUpload MOD
function user_get_profile()
{
        global $CONFIG, $USER;

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_data'])) {
                $USER = @unserialize(@base64_decode($_COOKIE[$CONFIG['cookie_name'].'_data']));
        }

        if (!isset($USER['ID']) || strlen($USER['ID']) != 32) {
                list($usec, $sec) = explode(' ', microtime());
                $seed = (float) $sec + ((float) $usec * 100000);
                srand($seed);
                $USER=array('ID' => md5(uniqid(rand(),1)));
        } else {
                $USER['ID'] = addslashes($USER['ID']);
        }

        if (!isset($USER['am'])) $USER['am'] = 1;
}


1.4.3
functions.inc.php WITH JUpload MOD
function user_get_profile()
{
global $CONFIG, $USER;
if (isset($_COOKIE[$CONFIG['cookie_name'].'_data'])) {
$USER = @unserialize(@base64_decode($_COOKIE[$CONFIG['cookie_name'].'_data']));
} else if (isset($_GET["cookie"])) {
//JUpload Modification Mark Stralka 7/25/2004
//if a parameter named "cookie" is passed, try to parse it into the the $USER object and
//set the cookie values.
$USER = @unserialize(@base64_decode($_GET["cookie"]));
$_COOKIE[$CONFIG['cookie_name'].'_uid'] = $USER[$CONFIG['cookie_name'].'_uid'];
$_COOKIE[$CONFIG['cookie_name'].'_data'] = $USER[$CONFIG['cookie_name'].'_data'];
$_COOKIE[$CONFIG['cookie_name'].'_pass'] = $USER[$CONFIG['cookie_name'].'_pass'];
}

if (!isset($USER['ID']) || strlen($USER['ID']) != 32) {
list($usec, $sec) = explode(' ', microtime());
$seed = (float) $sec + ((float) $usec * 100000);
srand($seed);
$USER=array('ID' => md5(uniqid(rand(),1)));
} else {
$USER['ID'] = addslashes($USER['ID']);
}

if (!isset($USER['am'])) $USER['am'] = 1;
}


Now I am not sure if I applied this right or if the $USER[$CONFIG['cookie_name'].'_uid']; and other two peramiters even work to push to cookie. Now the authentification() function is totaly different from 1.3.5 and 1.4.3 and is causing me some confusion.

1.3.5
init.inc.php
// Authenticate
if (defined('UDB_INTEGRATION')) {
    udb_authenticate();
} else {
    if (!isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_uid']) || !isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_pass'])) {
        $cookie_uid = 0;
        $cookie_pass = '*';
    } else {
        $cookie_uid = (int)$HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_uid'];
        $cookie_pass = substr(addslashes($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_pass']), 0, 32);
    }

    $sql = "SELECT * " . "FROM {$CONFIG['TABLE_USERS']} WHERE user_id='$cookie_uid'" . "AND user_active = 'YES' " . "AND user_password != '' " . "AND BINARY MD5(user_password) = '$cookie_pass'";
    $results = db_query($sql);

    if (mysql_num_rows($results)) {
        $USER_DATA = mysql_fetch_assoc($results);
        //unset($USER_DATA['user_password']);
        $USER_DATA['user_password'] = '********';

                $USER_DATA = $USER_DATA + cpgGetUserData($USER_DATA['user_group'], explode(',', $USER_DATA['user_group_list']));

        define('USER_ID', (int)$USER_DATA['user_id']);
        define('USER_NAME', $USER_DATA['user_name']);
        define('USER_GROUP', $USER_DATA['group_name']);
        define('USER_GROUP_SET', '(' . implode(',', $USER_DATA['groups']) . ')');
        define('USER_IS_ADMIN', (int)$USER_DATA['has_admin_access']);
        define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
        define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
        define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
        define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
        define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);
        define('USER_UPLOAD_FORM', (int)$USER_DATA['upload_form_config']);
        define('CUSTOMIZE_UPLOAD_FORM', (int)$USER_DATA['custom_user_upload']);
        define('NUM_FILE_BOXES', (int)$USER_DATA['num_file_upload']);
        define('NUM_URI_BOXES', (int)$USER_DATA['num_URI_upload']);
        mysql_free_result($results);
    } else {
        $USER_DATA = cpgGetUserData(3, array(3));
        define('USER_ID', 0);
        define('USER_NAME', 'Anonymous');
        define('USER_GROUP', $USER_DATA['group_name']);
        define('USER_GROUP_SET', '(' . $USER_DATA['group_id'] . ')');
        define('USER_IS_ADMIN', 0);
        define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
        define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
        define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
        define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
        define('USER_CAN_CREATE_ALBUMS', 0);
        define('USER_UPLOAD_FORM', (int)$USER_DATA['upload_form_config']);
        define('CUSTOMIZE_UPLOAD_FORM', (int)$USER_DATA['custom_user_upload']);
        define('NUM_FILE_BOXES', (int)$USER_DATA['num_file_upload']);
        define('NUM_URI_BOXES', (int)$USER_DATA['num_URI_upload']);
        mysql_free_result($results);
    }
}


1.4.3
init.inc.php
// Authenticate
$cpg_udb->authenticate();


So now lets follow the authenticate function on the 1.4.3 and see what it is doing.

1.4.3
udb_base.inc.php
function authenticate()
{
global $USER_DATA;

if (!($auth = $this->session_extraction()) && !($auth = $this->cookie_extraction())) {
$this->load_guest_data();
} else {
list ($id, $cookie_pass) = $auth;
$f = $this->field;

if (isset($this->usergroupstable)){
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, ug.{$f['usertbl_group_id']} AS group_id ".
   "FROM {$this->usertable} AS u, {$this->usergroupstable} AS ug ".
   "WHERE u.{$f['user_id']}=ug.{$f['user_id']} AND u.{$f['user_id']}='$id'";
} else {
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['usertbl_group_id']}+100 AS group_id ".
   "FROM {$this->usertable} AS u INNER JOIN {$this->groupstable} AS g ON u.{$f['usertbl_group_id']}=g.{$f['grouptbl_group_id']} ".
   "WHERE u.{$f['user_id']}='$id'";
}

$result = cpg_db_query($sql, $this->link_id);

if (mysql_num_rows($result)){
$row = mysql_fetch_assoc($result);
mysql_free_result($result);

$db_pass = $this->udb_hash_db($row['password']);
if ($db_pass === $cookie_pass) {
$this->load_user_data($row);
} else {
$this->load_guest_data();
}
} else {
$this->load_guest_data();
}
}

$user_group_set = '(' . implode(',', $USER_DATA['groups']) . ')';

        $USER_DATA = array_merge($USER_DATA, $this->get_user_data($USER_DATA['groups'][0], $USER_DATA['groups'], $this->guestgroup));

if ($this->use_post_based_groups){
$USER_DATA['has_admin_access'] = (in_array($USER_DATA['groups'][0] - 100,$this->admingroups)) ? 1 : 0;
} else {
$USER_DATA['has_admin_access'] = ($USER_DATA['groups'][0] == 1) ? 1 : 0;
}

$USER_DATA['can_see_all_albums'] = $USER_DATA['has_admin_access'];

// avoids a template error
if (!$USER_DATA['user_id']) $USER_DATA['can_create_albums'] = 0;

    // For error checking
$CONFIG['TABLE_USERS'] = '**ERROR**';

define('USER_ID', $USER_DATA['user_id']);
        define('USER_NAME', addslashes($USER_DATA['user_name']));
        define('USER_GROUP', $USER_DATA['group_name']);
        define('USER_GROUP_SET', $user_group_set);
        define('USER_IS_ADMIN', $USER_DATA['has_admin_access']);
        define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
        define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
        define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
        define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
        define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);
        define('USER_UPLOAD_FORM', (int)$USER_DATA['upload_form_config']);
        define('CUSTOMIZE_UPLOAD_FORM', (int)$USER_DATA['custom_user_upload']);
        define('NUM_FILE_BOXES', (int)$USER_DATA['num_file_upload']);
        define('NUM_URI_BOXES', (int)$USER_DATA['num_URI_upload']);

$this->session_update();
}


So everything changed. Now I have no idea what is going on right here" list ($id, $cookie_pass) = $auth; " . So basicaly I need to know how to apply the idea of what they where doing here:
} else if (isset($_GET["cookie"])) {
//JUpload Modification Mark Stralka 7/25/2004
//if a parameter named "cookie" is passed, try to parse it into the the $USER object and
//set the cookie values.
$USER = @unserialize(@base64_decode($_GET["cookie"]));
$HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_uid'] = $USER[$CONFIG['cookie_name'].'_uid'];
$HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_data'] = $USER[$CONFIG['cookie_name'].'_data'];
$HTTP_COOKIE_VARS[$CONFIG['cookie_name'].'_pass'] = $USER[$CONFIG['cookie_name'].'_pass'];

to the 1.4.3.

If anyone can help me in this it would be much appreciated.

Joachim Müller

split the topic that deals with this mod for cpg1.4.x into a separate thread: Cross-platform Batch Uploading (cpg1.4.x)