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

Remove email functionality #2301

Merged
merged 2 commits into from
Aug 21, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions scripts/pi-hole/php/func.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,6 @@ function validMAC($mac_addr)
return !filter_var($mac_addr, FILTER_VALIDATE_MAC) === false;
}

function validEmail($email)
{
return filter_var($email, FILTER_VALIDATE_EMAIL)
// Make sure that the email does not contain special characters which
// may be used to execute shell commands, even though they may be valid
// in an email address. If the escaped email does not equal the original
// email, it is not safe to store in setupVars.
&& escapeshellcmd($email) === $email;
}

function get_ip_type($ip)
{
return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? 4 :
Expand Down
9 changes: 0 additions & 9 deletions scripts/pi-hole/php/savesettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,6 @@ function addStaticDHCPLease($mac, $ip, $hostname)
break;

case 'webUI':
$adminemail = trim($_POST['adminemail']);
if (strlen($adminemail) == 0 || !isset($adminemail)) {
$adminemail = '';
}
if (strlen($adminemail) > 0 && !validEmail($adminemail)) {
$error .= 'Administrator email address ('.htmlspecialchars($adminemail).') is invalid!<br>';
} else {
pihole_execute('-a -e \''.$adminemail.'\'');
}
if (isset($_POST['boxedlayout'])) {
pihole_execute('-a layout boxed');
} else {
Expand Down
16 changes: 0 additions & 16 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,14 +1027,6 @@
</form>
</div>
<!-- ######################################################### API and Web ######################################################### -->
<?php
// Administrator email address
if (isset($setupVars['ADMIN_EMAIL'])) {
$adminemail = $setupVars['ADMIN_EMAIL'];
} else {
$adminemail = '';
}
?>
<div id="api" class="tab-pane fade<?php if ($tab === 'api') { ?> in active<?php } ?>">
<div class="row">
<div class="col-md-6">
Expand Down Expand Up @@ -1138,14 +1130,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h4>Administrator Email Address</h4>
<input type="email" class="form-control" name="adminemail" value="<?php echo htmlspecialchars($adminemail); ?>">
<input type="hidden" name="field" value="webUI">
<input type="hidden" name="token" value="<?php echo $token; ?>">
</div>
</div>
</div>
<div class="box-footer clearfix">
<button type="submit" class="btn btn-primary pull-right">Save</button>
Expand Down