...
 
Commits (2)
......@@ -211,7 +211,6 @@ class CopyPasteHandler
foreach ($this->clean_objects as $key => $entry) {
$this->current = $entry;
$errors = $this->current['object']->save();
logging::log('copy', 'paste', $this->current['object']->dn, [], reset($errors));
if (empty($errors)) {
$this->current_saved();
......@@ -231,7 +230,6 @@ class CopyPasteHandler
/* Save current object if edition is finished */
if (isset($_POST['edit_finish'])) {
$errors = $this->current['object']->save();
logging::log('copy', 'paste', $this->current['object']->dn, [], reset($errors));
if (empty($errors)) {
$this->current_saved();
......@@ -272,6 +270,7 @@ class CopyPasteHandler
private function current_saved ()
{
$this->lastdn = $this->current['object']->dn;
logging::log('copy', 'paste', $this->lastdn);
$this->handleReferences();
$this->current = FALSE;
}
......
......@@ -40,32 +40,27 @@ class logging
/*!
* \brief logging method
*
* \param $action One of these values (modify|create|remove|copy|snapshot|security|error)
* \param string $action One of these values (modify|create|remove|copy|snapshot|security|error)
*
* \param $objecttype represents the current edited objecttype, like user/user, or the event, like logout
* \param string $objecttype represents the current edited objecttype, like user/user, or the event, like logout
*
* \param $object represents the current edited object dn, or the target of the operation
* \param string $object represents the current edited object dn, or the target of the operation
*
* \param $changes_array An array containing names of all touched attributes
* \param array $changes An array containing names of all touched attributes
*
* \param $result A status message, containing errors or success messages
* \param string $result A status message, containing errors or success messages
*/
static function log ($action, $objecttype, $object, array $changes_array = [], $result = '')
static function log (string $action, string $objecttype, string $object, array $changes = [], string $result = '')
{
global $config, $ui;
if ($result === NULL) {
trigger_error('"Result" parameter should not be NULL');
$result = '';
}
/* Create data object */
$entry = [
'timestamp' => microtime(TRUE),
'action' => $action,
'objecttype' => $objecttype,
'object' => $object,
'changes' => $changes_array,
'changes' => $changes,
'result' => $result
];
if (isset($ui->dn) && !empty($ui->dn)) {
......