Skip to content

Commit

Permalink
Fixed errors, and changed icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
alee2-bcchr committed May 9, 2019
1 parent fe16c86 commit 0a8311a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions UnbanIp.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ public function unbanIpAddress()
{
$sql = "DELETE FROM redcap_ip_banned WHERE ip ='$ip' LIMIT 1";
$this->query($sql);
$rowsAffected = db_affected_rows();
if ($rowsAffected > 0)
{
REDCap::logEvent("Unbanned IP Address", "IP Address $ip unsuspended", $sql);
REDCap::logEvent("Unbanned IP Address $ip", null, $sql);
return TRUE;
}
else
Expand All @@ -40,7 +41,7 @@ public function generateIndex()
?>
<style type="text/css">#pagecontent { margin-top: 70px; }</style>
<?php if ($_GET["success"] == "1"): ?>
<div class="green">IP Address unsuspended successfully</div>
<div class="green" style="margin-bottom:20px">IP Address unsuspended successfully</div>
<?php endif; ?>
<div style="width: 70%; margin: auto;">
<h2 style="text-align: center">Unban IP Addresses</h2>
Expand Down
2 changes: 1 addition & 1 deletion UnbanIpAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

if ($success === TRUE)
{
$unban_ip->getUrl("index.php");
header("Location: " . $unban_ip->getUrl("index.php?success=1"));
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Unban IP",
"namespace": "BCCHR\\UnbanIp",
"description": "This module allows you to unban an ip address that has been banned by REDCap.",
"description": "This module allows you to unban an IP address that has been banned by REDCap.",
"authors": [
{
"name": "Ashley Lee",
Expand All @@ -14,7 +14,7 @@
{
"name": "Unban IP",
"url": "index.php",
"icon": "link"
"icon": "computer"
}
]
},
Expand Down

0 comments on commit 0a8311a

Please sign in to comment.