News:

Wondering if this will always be free?  See why free is better.

Main Menu

trying to learn how the admin logs work

Started by rcane, July 23, 2024, 12:54:06 PM

Previous topic - Next topic

rcane

So, i just noticed that there's a 24 hour wait on clearing logs.

I wanted to know where/how it all gets processed.


Is modlog.php the spot?

This is what caught my eye.

if (isset($_POST['removeall']) && $context['can_delete'])
{
checkSession();

$smcFunc['db_query']('', '
DELETE FROM {db_prefix}log_actions
WHERE id_log = {int:moderate_log}
AND log_time < {int:twenty_four_hours_wait}' . (!empty($context['uneditable_actions']) ? '
AND action NOT IN ({array_string:uneditable})' : ''),
array(
'twenty_four_hours_wait' => time() - $context['hoursdisable'] * 3600,
'moderate_log' => $context['log_type'],
'uneditable' => $context['uneditable_actions'],
)
);
}
elseif (!empty($_POST['remove']) && isset($_POST['delete']) && $context['can_delete'])
{
checkSession();
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}log_actions
WHERE id_log = {int:moderate_log}
AND id_action IN ({array_string:delete_actions})
AND log_time < {int:twenty_four_hours_wait}' . (!empty($context['uneditable_actions']) ? '
AND action NOT IN ({array_string:uneditable})' : ''),
array(
'twenty_four_hours_wait' => time() - $context['hoursdisable'] * 3600,
'delete_actions' => array_unique($_POST['delete']),
'moderate_log' => $context['log_type'],
'uneditable' => $context['uneditable_actions'],
)
);
}


rcane

Thanks,

And I think i found what I was looking for

Arantor

What were you looking for exactly? If it's the 24 hours wait, there is a good reason it's there...
Holder of controversial views, all of which my own.


rcane

Quote from: Arantor on July 23, 2024, 01:19:08 PMWhat were you looking for exactly? If it's the 24 hours wait, there is a good reason it's there...

It was actually.  What's the design-intent?

Arantor

It used to be the case that if you cleared the logs, it would leave no trace - meaning that on a site with multiple admins, one of them could do something they shouldn't, then clear the log to remove any trace of having done so.

This way, it's impossible for an admin to clear the logs without leaving a record of having done so (without direct database access and suitable knowledge).

So the next question is why does it matter? For most people this is a non-issue that this is there, and people that feel the need to change it always set off alarm bells in my head.
Holder of controversial views, all of which my own.


rcane

Oh it's just me—no one else. 

And I just like to know how things work.

But, doesn't this only put things off for 24 hours?  Or was the idea that another admin would see things before the safeties were removed?

Arantor

But the clearing of the log *puts an item in*. So if they clear it, even if they clear it every day, there will still be a trace left for any other admin to see.

I'm sorry, I have distinct distrust of "I just like to know how things work" because every single time I've ever heard it, it's a prelude to changing something with a bad outcome.

If you don't care about the logs, turn them off rather than worrying about this.
Holder of controversial views, all of which my own.


rcane

Quote from: Arantor on July 24, 2024, 12:15:04 PMBut the clearing of the log *puts an item in*. So if they clear it, even if they clear it every day, there will still be a trace left for any other admin to see.

I'm sorry, I have distinct distrust of "I just like to know how things work" because every single time I've ever heard it, it's a prelude to changing something with a bad outcome.

If you don't care about the logs, turn them off rather than worrying about this.

Ha, I appreciate your concern/experience.  No, I like to know how things work.  And yeah, you're always going to be leaving a mark of "was here" so you're only cleaning the screen up to that point. 

I didn't think logs could be turned off--just for these reasons.  I hadn't gone to the core features page since install.   

Advertisement: