I'm looking at upload_accept, but it doesn't look like the filehash has been created yet and I don't think I have the file data yet to create one myself. I'll keep digging.
Thanks,
James
--------------- Added [DATE]1328546156[/DATE] at [TIME]1328546156[/TIME] ---------------
Quote:
Originally Posted by kh99
Yeah, it's caused by this code in class_upload.php (around line 957):
Code:
if (!($result = $this->data->save()))
{
if (empty($this->data->errors[0]) OR !($this->registry->userinfo['permissions']['adminpermissions'] & $this->registry->bf_ugp_adminpermissions['cancontrolpanel']))
{
$this->set_error('upload_file_failed');
}
else
{
$this->error =& $this->data->errors[0];
}
}
For some reason if you're not an admin it doesn't use the errors from the attachment object.
|
I hate editing more standard VB files for mods, but I think a quick change in class_upload.php might be the best fix.
This works:
Code:
if (!($result = $this->data->save()))
{
echo "<script>alert('class_upload error ". $this->data->errors[0] ."')</script>";
if (empty($this->data->errors[0]) OR !($this->registry->userinfo['permissions']['adminpermissions'] & $this->registry->bf_ugp_adminpermissions['cancontrolpanel']) AND ($this->data->errors[0] != "This file is not allowed to be uploaded on our website."))
{
$this->set_error('upload_file_failed');
}
else
{
$this->error =& $this->data->errors[0];
}
}
However, I know I shouldn't use the string literal here. How can I get the text of the phrase
jb_file_not_allowed_here to use in the comparison here in
class_upload.php ?
Thanks,
James