diff --git a/infolog/inc/class.boinfolog.inc.php b/infolog/inc/class.boinfolog.inc.php index a3547837a5..243e8fa116 100644 --- a/infolog/inc/class.boinfolog.inc.php +++ b/infolog/inc/class.boinfolog.inc.php @@ -245,9 +245,9 @@ ** Put a file to the corrosponding place in the VFS and set the attributes ** ACL check is done by the VFS */ - function attach_file($info_id,$filepos,$name,$size,$type,$comment='',$full_fname='') + function attach_file($info_id,$filepos,$name,$size,$type,$comment='',$full_fname='',$ip='') { - //echo "

add_one_file: info_id='$info_id', filepos='$filepos', name='$name', size='$size', type='$type', comment='$comment', full_fname='$full_fname'

\n"; + //echo "

attach_file: info_id='$info_id', filepos='$filepos', name='$name', size='$size', type='$type', comment='$comment', full_fname='$full_fname', ip='$ip'

\n"; // create the root for attached files in infolog, if it does not exists if (!($this->vfs->file_exists($this->vfs_basedir,array(RELATIVE_ROOT)))) @@ -274,13 +274,14 @@ { // check case-insensitive for WIN etc. $check = $valid[0] == '\\' || strstr(':',$valid) ? 'eregi' : 'ereg'; $valid2 = str_replace('\\','/',$valid); + //echo "

attach_file: ereg('".$this->send_file_ips[$valid]."', '$ip')=".ereg($this->send_file_ips[$valid],$ip)."

\n"; if ($check('^('.$valid2.')(.*)$',$full_fname,$parts) && ereg($this->send_file_ips[$valid],$ip) && // right IP $this->vfs->file_exists($trans.$parts[2],array(RELATIVE_NONE|VFS_REAL))) { $tfname = $trans.$parts[2]; } - // echo "

add_one_file: full_fname='$full_fname', valid2='$valid2', trans='$trans', check=$check, tfname='$tfname', parts=(x,'${parts[1]}','${parts[2]}')

\n"; + //echo "

attach_file: full_fname='$full_fname', valid2='$valid2', trans='$trans', check=$check, tfname='$tfname', parts=(x,'${parts[1]}','${parts[2]}')

\n"; } if ($tfname && !$this->vfs->securitycheck($tfname)) { diff --git a/infolog/inc/class.uiinfolog.inc.php b/infolog/inc/class.uiinfolog.inc.php index 24061a235c..c33e622c52 100644 --- a/infolog/inc/class.uiinfolog.inc.php +++ b/infolog/inc/class.uiinfolog.inc.php @@ -591,7 +591,8 @@ if ($upload && $attachfile && $attachfile != "none") { - $fileerror = $this->bo->attach_file($info_id,$attachfile,$attachfile_name,$attachfile_size,$attachfile_type,$filecomment,$full_fname); + $fileerror = $this->bo->attach_file($info_id,$attachfile,$attachfile_name,$attachfile_size, + $attachfile_type,$filecomment,$full_fname,$GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR']); if ($fileerror) $error[]=$fileerror; } $GLOBALS['phpgw']->common->phpgw_header(); @@ -752,7 +753,9 @@ if ($attachfile && $attachfile != "none") // save the attached file { - $fileerror = $this->bo->attach_file($this->bo->so->data['info_id'],$attachfile,$attachfile_name,$attachfile_size,$attachfile_type,$filecomment,$full_fname); + $fileerror = $this->bo->attach_file($this->bo->so->data['info_id'],$attachfile, + $attachfile_name,$attachfile_size,$attachfile_type,$filecomment,$full_fname, + $GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR']); if ($fileerror) $error[]=$fileerror; } }