any clues or things to look at? i can spend some time trying to fix it. it kind of looks like it is in how it gets the IDs from the database to choose where to put the uploaded file. one of the problems anyways...
i think in this section of software_upload.php, but i don't know the rest of the system well enough yet to figure it out...
Code:
if ($success == 1) {
$user_id = $_SESSION['user_id'];
$upload = 1;
if($file == 0) {
$fname = $_FILES['sw_file']['name'];
} elseif($file == 1) {
$fname = substr($_POST['sw_wget'], (strrpos($_POST['sw_wget'], '/')+1));
}
$filename = substr($fname, 0, -7);
$extension = substr($fname, -7);
$query="
INSERT INTO
`web_software`
(
`reseller_id`, `software_name`, `software_version`, `software_language`, `software_type`, `software_db`,
`software_archive`, `software_installfile`, `software_prefix`, `software_link`, `software_desc`, `software_status`
) VALUES (
?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?
)
";
$rs = exec_query($sql, $query, array($user_id, "waiting_for_input", "waiting_for_input", "waiting_for_input", "waiting_for_input", "0", $filename, "waiting_for_input", "waiting_for_input", "waiting_for_input", "waiting_for_input", "toadd"));
$sw_id = $sql->Insert_ID();
if ($file == 0) {
$dest_dir = $cfg->GUI_SOFTWARE_DIR.'/'.$user_id.'/'.$filename.'-'.$sw_id.$extension;
if (!is_dir($cfg->GUI_SOFTWARE_DIR.'/'.$user_id)) {
@mkdir($cfg->GUI_SOFTWARE_DIR.'/'.$user_id,0755,true);
}
i think however it is getting the "user_id" is incorrect, wrong table/column, but I haven't found its origin yet