chg: [diagnostic:submodule] Better control of the glue merging command outputs

pull/4435/head
mokaddem 2019-04-08 11:33:42 +02:00
parent 208da99f6a
commit 255fbcf97a
1 changed files with 7 additions and 7 deletions

View File

@ -4693,31 +4693,31 @@ class Server extends AppModel
public function updateAfterPull($submodule_name, $userId) {
$user = $this->User->getAuthUser($userId);
$result = '';
$result = array();
if ($user['Role']['perm_site_admin']) {
$updateAll = empty($submodule_name);
if ($submodule_name == 'app/files/misp-galaxy' || $updateAll) {
$this->Galaxy = ClassRegistry::init('Galaxy');
$result .= ($this->Galaxy->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
$result[] = ($this->Galaxy->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
}
if ($submodule_name == 'app/files/misp-objects' || $updateAll) {
$this->ObjectTemplate = ClassRegistry::init('ObjectTemplate');
$result .= ($this->ObjectTemplate->update($user, false, false) ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
$result[] = ($this->ObjectTemplate->update($user, false, false) ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
}
if ($submodule_name == 'app/files/noticelists' || $updateAll) {
$this->Noticelist = ClassRegistry::init('Noticelist');
$result .= ($this->Noticelist->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
$result[] = ($this->Noticelist->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
}
if ($submodule_name == 'app/files/taxonomies' || $updateAll) {
$this->Taxonomy = ClassRegistry::init('Taxonomy');
$result .= ($this->Taxonomy->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
$result[] = ($this->Taxonomy->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
}
if ($submodule_name == 'app/files/warninglists' || $updateAll) {
$this->Warninglist = ClassRegistry::init('Warninglist');
$result .= ($this->Warninglist->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
$result[] = ($this->Warninglist->update() ? 'Update `' . h($submodule_name) . '` Sucessful.' : 'Update `'. h($submodule_name) . '` failed.') . PHP_EOL;
}
}
return $result;
return implode('\n', $result);
}
public function update($status)