Skip to content
Permalink
Browse files

Code Cleanup

- For agent 'locked' field, audit as islocked instead of isactive
- Audit for deleting pages needed tweaking
  • Loading branch information...
aydreeihn committed Jul 16, 2019
1 parent 2aacbd1 commit ff9063895ecf076bb015c1967e1fe29c83f3b5b1
Showing with 9 additions and 14 deletions.
  1. +1 −2 include/class.staff.php
  2. +8 −12 scp/pages.php
@@ -1163,10 +1163,9 @@ function update($vars, &$errors) {
foreach ($vars as $key => $value) {
if ($key == 'islocked') $key = 'isactive';
if (isset($this->$key) && ($this->$key != $value) && ($key != 'perms') && ($key != 'teams') && ($key != 'dept_access')) {
$type = array('type' => 'edited', 'key' => $key);
$type = array('type' => 'edited', 'key' => ($key == 'isactive') ? 'islocked' : $key);
Signal::send('object.edited', $this, $type);
}
if ($key == 'isactive') $key = 'islocked';
}
}
@@ -103,21 +103,17 @@
if($i && $i==$count) {
$msg = sprintf(__('Successfully deleted %s.'),
_N('selected site page', 'selected site pages', $count));
if (class_exists('AuditEntry')) {
if (PluginManager::auditPlugin()) {
$data = array();
foreach ($_POST['ids'] as $id) {
$data = AuditEntry::getDataById($id, 'G');
if ($data)
$name = json_decode($data[1], true);
else {
$name = __('NA');
$data = array('G', $id);
}
if ($exists = AuditEntry::getDataById($id, 'G'))
$data = json_decode($exists[1], true);
else
$data['name'] = 'NA';
if (PluginManager::auditPlugin()) {
$type = array('type' => 'deleted');
Signal::send('object.deleted', $data, $type);
}
$data[0] = 'G';
$type = array('type' => 'deleted');
Signal::send('object.deleted', $data, $type);
}
}
}

0 comments on commit ff90638

Please sign in to comment.
You can’t perform that action at this time.