mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Added button to enter current IP while whitelisting.
This commit is contained in:
parent
0df60a4bf1
commit
1708e535a6
@ -44,6 +44,19 @@ require_once(e_HANDLER.'iphandler_class.php'); // This is probably already load
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
||||
|
||||
e107::js('footer-inline', "
|
||||
|
||||
$('#useip').click(function (event) {
|
||||
|
||||
var id = $(this).attr('data-ip');
|
||||
$('#banlist-ip').val(id);
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
");
|
||||
|
||||
|
||||
|
||||
class banlist_admin extends e_admin_dispatcher
|
||||
{
|
||||
@ -149,6 +162,14 @@ class banlist_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
if($this->getAction() == 'create')
|
||||
{
|
||||
$myip = e107::getIPHandler()->getIP(true);
|
||||
$this->fields['banlist_ip']['writeParms']['rightCellClass'] = 'form-inline';
|
||||
$this->fields['banlist_ip']['writeParms']['pre'] = "<div class='input-append'>";
|
||||
$this->fields['banlist_ip']['writeParms']['post'] = "<button class='btn btn-primary' id='useip' data-ip='{$myip}'>Use My IP</button></div>"; // USERIP;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -390,7 +411,7 @@ class banlist_form_ui extends e_admin_form_ui
|
||||
}
|
||||
elseif($this->getController()->getAction() == 'create')
|
||||
{
|
||||
return $this->hidden('banlist_bantype',eIPHandler::BAN_TYPE_MANUAL)."<span class='label label-important'>Blacklist entry</span>"; //TODO LAN
|
||||
return $this->hidden('banlist_bantype',eIPHandler::BAN_TYPE_MANUAL)."<span class='label label-important'>Blacklist entry</span>"; //TODO LAN
|
||||
}
|
||||
|
||||
|
||||
|
@ -3692,7 +3692,7 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$ret = $this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms);
|
||||
$ret = vartrue($parms['pre']).$this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms).vartrue($parms['post']);
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
@ -4435,12 +4435,17 @@ class e_form
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$leftCellClass = (!empty($writeParms['leftCellClass'])) ? " class='".$writeParms['leftCellClass']."'" : "";
|
||||
$rightCellClass = (!empty($writeParms['rightCellClass'])) ? " class='".$writeParms['rightCellClass']."'" : "";
|
||||
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>
|
||||
<td{$leftCellClass}>
|
||||
".$leftCell."
|
||||
</td>
|
||||
<td>
|
||||
<td{$rightCellClass}>
|
||||
".$rightCell."
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user