I create a patch that add a button (a link in fact) to Purge the statistics data. I really need it and maybe other user would also want that feature.

NOTE: If you apply the patch, don't forget to reset the Menu cache:
/admin_menu/flush-cache/menu

In the browsecap configuration page (Administer > Site configuration > Browscap), you will see the following line:
[Purge data now] This will purge all data about previous browser visit. In other words, it will reset the reports in the Browscap reports area.

If you click on [Purge data now], all the data about the previous visit will be clear.
Basically, it will execute the following SQL Query: DELETE FROM browscap_statistics

Comments

greggles’s picture

Status: Needs review » Active

It seems the patch is missing?

To avoid a Cross Site Request Forgery you should use either a token or a button or a confirmation form. See Protecting Drupal against cross site request forgeries for more information.

gaellafond’s picture

StatusFileSize
new3.39 KB

Hum, I know I attached the Patch by using the Attach button. I think it disappear when I use the Preview button.

Thanks for the suggestion, I will have a look at this URL after the lunch.

greggles’s picture

Status: Active » Needs work

Sounds good.

gaellafond’s picture

Status: Needs work » Needs review
StatusFileSize
new3.53 KB

Thank you for that URL about Drupal XSS. They propose a pretty good and simple solution by adding a confirmation page using confirm_form(). That function handle the token transparently. In addition, the confirmation page looks better and more robust than a javascript confirm window.

[edit]
I don't really like the look of the line I add on the configuration page, but that's all the time I can invest on this patch for now. Feel free to modify it if you want.
[/edit]

devin carlson’s picture

Status: Needs review » Closed (won't fix)

Useragent recording functionality has been removed from Browscap #1795920: Remove useragent recording functionality.