Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer possibility to import auditlog.list from teleporter archive #816

Merged
merged 1 commit into from Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/pi-hole/php/teleporter.php
Expand Up @@ -143,6 +143,14 @@ function check_domains($domains)
$importedsomething = true;
}

if(isset($_POST["auditlog"]) && $file->getFilename() === "auditlog.list")
{
$auditlog = process_file(file_get_contents($file));
echo "Processing auditlog.list (".count($auditlog)." entries)<br>\n";
exec("sudo pihole -a clearaudit");
exec("sudo pihole -a audit ".implode(" ",$auditlog));
}

if($importedsomething)
{
exec("sudo pihole restartdns");
Expand Down
5 changes: 5 additions & 0 deletions settings.php
Expand Up @@ -1099,6 +1099,11 @@ function convertseconds($argument)
checked>
Regex filters</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="auditlog" value="true"
checked>
Audit log</label>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12">
Expand Down