@@ -80,8 +80,9 @@ discard block |
||
| 80 | 80 | $session = SessionManager::getSession(); |
| 81 | 81 | |
| 82 | 82 | // Random encryption key |
| 83 | -if ($session->get('key') === null) |
|
| 83 | +if ($session->get('key') === null) { |
|
| 84 | 84 | $session->set('key', generateQuickPassword(30, false)); |
| 85 | +} |
|
| 85 | 86 | |
| 86 | 87 | $request = SymfonyRequest::createFromGlobals(); |
| 87 | 88 | $configManager = new ConfigManager(); |
@@ -980,7 +981,10 @@ discard block |
||
| 980 | 981 | <input type="password" class="form-control" id="dialog-ldap-user-build-keys-database-code"> |
| 981 | 982 | <br/> |
| 982 | 983 | </div> |
| 983 | - <div class="input-group mb-3<?php if ($session_auth_type === 'oauth2') echo ' hidden'; ?>"> |
|
| 984 | + <div class="input-group mb-3<?php if ($session_auth_type === 'oauth2') { |
|
| 985 | + echo ' hidden'; |
|
| 986 | +} |
|
| 987 | +?>"> |
|
| 984 | 988 | <div class="input-group-prepend"> |
| 985 | 989 | <span class="input-group-text"><?php echo $lang->get('provide_your_current_password'); ?></span> |
| 986 | 990 | </div> |
@@ -119,8 +119,9 @@ |
||
| 119 | 119 | */ |
| 120 | 120 | private function isParentFolderAllowed($parent_id, $user_accessible_folders, $user_is_admin, $user_can_create_root_folder) |
| 121 | 121 | { |
| 122 | - if ($parent_id == 0 && $user_can_create_root_folder == true) |
|
| 123 | - return true; |
|
| 122 | + if ($parent_id == 0 && $user_can_create_root_folder == true) { |
|
| 123 | + return true; |
|
| 124 | + } |
|
| 124 | 125 | |
| 125 | 126 | if (in_array($parent_id, $user_accessible_folders) === false |
| 126 | 127 | && (int) $user_is_admin !== 1 |
@@ -64,7 +64,9 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function execute() { |
| 66 | 66 | try { |
| 67 | - if (LOG_TASKS=== true) $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG'); |
|
| 67 | + if (LOG_TASKS=== true) { |
|
| 68 | + $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG'); |
|
| 69 | + } |
|
| 68 | 70 | // Dispatch selon le type de processus |
| 69 | 71 | switch ($this->processType) { |
| 70 | 72 | case 'item_copy': |
@@ -136,7 +138,9 @@ discard block |
||
| 136 | 138 | $arguments = ''; |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | - if (LOG_TASKS=== true) $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG'); |
|
| 141 | + if (LOG_TASKS=== true) { |
|
| 142 | + $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG'); |
|
| 143 | + } |
|
| 140 | 144 | |
| 141 | 145 | // Add 'arguments' only if not empty |
| 142 | 146 | if (!empty($arguments)) { |
@@ -150,7 +154,9 @@ discard block |
||
| 150 | 154 | 'increment_id = %i', |
| 151 | 155 | $this->taskId |
| 152 | 156 | ); |
| 153 | - if (LOG_TASKS=== true) $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG'); |
|
| 157 | + if (LOG_TASKS=== true) { |
|
| 158 | + $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG'); |
|
| 159 | + } |
|
| 154 | 160 | } |
| 155 | 161 | |
| 156 | 162 | /** |
@@ -185,7 +191,9 @@ discard block |
||
| 185 | 191 | * @return void |
| 186 | 192 | */ |
| 187 | 193 | private function processSubTasks($arguments) { |
| 188 | - if (LOG_TASKS=== true) $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG'); |
|
| 194 | + if (LOG_TASKS=== true) { |
|
| 195 | + $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG'); |
|
| 196 | + } |
|
| 189 | 197 | // Get all subtasks related to this task |
| 190 | 198 | $subtasks = DB::query( |
| 191 | 199 | 'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC', |
@@ -194,7 +202,9 @@ discard block |
||
| 194 | 202 | |
| 195 | 203 | // Check if there are any subtasks to process |
| 196 | 204 | if (empty($subtasks)) { |
| 197 | - if (LOG_TASKS=== true) $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG'); |
|
| 205 | + if (LOG_TASKS=== true) { |
|
| 206 | + $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG'); |
|
| 207 | + } |
|
| 198 | 208 | return; |
| 199 | 209 | } |
| 200 | 210 | |
@@ -204,7 +214,9 @@ discard block |
||
| 204 | 214 | // Get the subtask data |
| 205 | 215 | $subtaskData = json_decode($subtask['task'], true); |
| 206 | 216 | |
| 207 | - if (LOG_TASKS=== true) $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG'); |
|
| 217 | + if (LOG_TASKS=== true) { |
|
| 218 | + $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG'); |
|
| 219 | + } |
|
| 208 | 220 | |
| 209 | 221 | // Mark subtask as in progress |
| 210 | 222 | DB::update( |