Detailed Description:
file action.copycompany.php has two bugs:
$compid = '';
$srcdir =
cms_join_path($gCms->config['uploads_path'],'companydirectory','id'.$compid);
// get params
if( !isset($params['compid']) )
{
echo $this->ShowErrors($this->Lang('error_missingparam'));
return;
}
$compid = (int)$params['compid'];
should be (srcdir assigned after compid):
$compid = '';
// get params
if( !isset($params['compid']) )
{
echo $this->ShowErrors($this->Lang('error_missingparam'));
return;
}
$compid = (int)$params['compid'];
$srcdir =
cms_join_path($gCms->config['uploads_path'],'companydirectory','id'.$compid);
if( count($srcfiles) ) {
$destdir =
cms_join_path($gCms->config['uploads_path'],'companydirectory','id'.$new_compid);
cge_dir::mkdirr($destdir);
foreach( $srcfiles as $onefile ) {
$bn = basename($onefile);
@copy($srcfile,cms_join_path($destdir,$bn));
}
}
should be the file ($onefile) not the array $srcfile) in copy():
if( count($srcfiles) ) {
$destdir =
cms_join_path($gCms->config['uploads_path'],'companydirectory','id'.$new_compid);
cge_dir::mkdirr($destdir);
foreach( $srcfiles as $onefile ) {
$bn = basename($onefile);
@copy($onefile,cms_join_path($destdir,$bn));
}
}
with those changes the listing copy, copies the files into a new directory