|
|
|
@ -395,17 +395,16 @@ if (isset($_GET['action']) && $_GET['action'] == 'copytomyfiles' && api_get_sett |
|
|
|
|
$file = $sys_course_path.$_course['path'].'/document'.$clean_get_id; |
|
|
|
|
$copyfile = $user_folder.basename($clean_get_id); |
|
|
|
|
|
|
|
|
|
if (file_exists($copyfile) && !isset ($_GET['copy'])) { |
|
|
|
|
$message = get_lang('AlreadyCopy').' '.get_lang('ConfirmCopyDoc').'</p>'.'<p>'.'<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$_GET['curdirpath'].'">'.get_lang("No").'</a>'.' | '.'<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$_GET['curdirpath'].'&action=copytomyfiles&id='.$clean_get_id.'&copy=yes\">'.get_lang("Yes").'</a>'.'</p>'; |
|
|
|
|
|
|
|
|
|
Display::display_warning_message($message,false); |
|
|
|
|
|
|
|
|
|
if (Security::remove_XSS($_GET['copy']) == 'yes') |
|
|
|
|
{ |
|
|
|
|
if (file_exists($copyfile)) { |
|
|
|
|
$message = get_lang('AlreadyCopy').'</p><p>'.'<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$_GET['curdirpath'].'">'.get_lang("No").'</a> | <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$_GET['curdirpath'].'&action=copytomyfiles&id='.$clean_get_id.'&copy=yes">'.get_lang("Yes").'</a></p>'; |
|
|
|
|
if (!isset($_GET['copy'])){ |
|
|
|
|
Display::display_warning_message($message,false); |
|
|
|
|
} |
|
|
|
|
if (Security::remove_XSS($_GET['copy']) == 'yes'){ |
|
|
|
|
if (!copy($file, $copyfile)) { |
|
|
|
|
Display::display_error_message(get_lang('CopyFailled')); |
|
|
|
|
}else{ |
|
|
|
|
Display::display_confirmation_message(get_lang('CopyReleased')); |
|
|
|
|
Display::display_confirmation_message(get_lang('FileOverwrited')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|