| @@ 99-110 (lines=12) @@ | ||
| 96 | break; |
|
| 97 | case 'delete': |
|
| 98 | /* Delete document */ |
|
| 99 | if ($itemId) { |
|
| 100 | $fileDeleted = deleteWorkItem($itemId, $courseInfo); |
|
| 101 | if (!$fileDeleted) { |
|
| 102 | Display::addFlash( |
|
| 103 | Display::return_message(get_lang('YouAreNotAllowedToDeleteThisDocument'), 'error') |
|
| 104 | ); |
|
| 105 | } else { |
|
| 106 | Display::addFlash( |
|
| 107 | Display::return_message(get_lang('TheDocumentHasBeenDeleted'), 'confirmation') |
|
| 108 | ); |
|
| 109 | } |
|
| 110 | } |
|
| 111 | break; |
|
| 112 | case 'delete_correction': |
|
| 113 | $result = get_work_user_list(null, null, null, null, $workId); |
|
| @@ 136-147 (lines=12) @@ | ||
| 133 | $absolute_datadir = $backupDir.'data'; |
|
| 134 | $absolute_sqldir = $backupDir.'dump.sql'; |
|
| 135 | ||
| 136 | if (!is_dir($backupDir)) { |
|
| 137 | $result = mkdir($backupDir, 0777, true); |
|
| 138 | if ($result) { |
|
| 139 | Display::addFlash( |
|
| 140 | Display::return_message('Directory created: '.$backupDir) |
|
| 141 | ); |
|
| 142 | } else { |
|
| 143 | Display::addFlash( |
|
| 144 | Display::return_message("Cannot create directory: $backupDir check the folder permissions", 'error') |
|
| 145 | ); |
|
| 146 | } |
|
| 147 | } |
|
| 148 | ||
| 149 | if ($vchamilostep == 0) { |
|
| 150 | // Create directories, if necessary. |
|
| @@ 839-849 (lines=11) @@ | ||
| 836 | ||
| 837 | foreach ($paths as $path) { |
|
| 838 | $path = trim($path); |
|
| 839 | if (is_dir($path)) { |
|
| 840 | if (!is_writable($path)) { |
|
| 841 | Display::addFlash( |
|
| 842 | Display::return_message("Directory must have writable permissions: '$path'", 'warning') |
|
| 843 | ); |
|
| 844 | }; |
|
| 845 | } else { |
|
| 846 | Display::addFlash( |
|
| 847 | Display::return_message("Directory doesn't exist: '$path'", 'warning') |
|
| 848 | ); |
|
| 849 | } |
|
| 850 | } |
|
| 851 | } |
|
| 852 | ||