示例#1
0
function ip_matches_regexp($ip, $ip_restrict)
	{
	if (substr($ip_restrict, 0, 1)!='!')
		return ip_matches($ip, $ip_restrict);

	return @preg_match('/'.substr($ip_restrict, 1).'/su', $ip);
	}
示例#2
0
function HookAuto_loginAllIprestrict()
{
    global $allow, $ip, $ip_restrict;
    if (substr($ip_restrict, 0, 1) != '!') {
        return false;
    }
    $allow = ip_matches($ip, $ip_restrict);
    return true;
}
示例#3
0
echo $lang["helpfile"];
?>
</td>
<td width="10%"><?php 
echo $lang["basecall"];
?>
</td>
</tr>

<?php 
// find available api plugins
$ip = get_ip();
$current_whitelists = sql_query("select * from api_whitelist w join user u on w.userref=u.ref where u.ref={$userref} order by u.username");
$allowed_apis = array();
foreach ($current_whitelists as $whitelist) {
    if (ip_matches($ip, $whitelist['ip_domain'])) {
        $allowed_apis = explode(",", $whitelist['apis']);
    }
}
foreach ($plugins as $plugin) {
    if (substr($plugin, 0, 4) == "api_" && $plugin !== "api_core") {
        ?>
       <tr class="ListviewTitleStyle">
       <td width="10%"><?php 
        echo $plugin;
        ?>
</td>
       <td width="10%"><a href="#" onClick="jQuery.ajax('<?php 
        echo $baseurl;
        ?>
/plugins/<?php 
if (!$valid && $api) {
    echo "invalid login";
    exit;
}
# Handle IP address restrictions
$ip = get_ip();
if (isset($ip_restrict_group)) {
    $ip_restrict = $ip_restrict_group;
    if ($ip_restrict_user != "") {
        $ip_restrict = $ip_restrict_user;
    }
    # User IP restriction overrides the group-wide setting.
    if ($ip_restrict != "") {
        $allow = false;
        if (!hook('iprestrict')) {
            $allow = ip_matches($ip, $ip_restrict);
        }
        if (!$allow) {
            if ($iprestrict_friendlyerror) {
                exit("Sorry, but the IP address you are using to access the system (" . $ip . ") is not in the permitted list. Please contact an administrator.");
            }
            header("HTTP/1.0 403 Access Denied");
            exit("Access denied.");
        }
    }
}
#update activity table
global $pagename;
$terms = "";
if ($pagename != "login" && $pagename != "terms") {
    $terms = ",accepted_terms=1";
示例#5
0
?>
 fa-fw"></i> Role: <strong class="admin-user-info admin-user-role"><?php 
echo $user_info->roles[0];
?>
</strong>
						<?php 
if (is_dev()) {
    ?>
							<small>(Dev)</small>
						<?php 
}
?>
					</li>
					<li>
						<?php 
if (ip_matches('phg')) {
    ?>
							<img src="<?php 
    echo get_template_directory_uri();
    ?>
/images/phg/phg-symbol.png" alt="Pinckney Hugo Group" style="max-width: 14px;"/>
						<?php 
} else {
    ?>
							<i class="fa fa-laptop fa-fw"></i>
						<?php 
}
?>
						IP Address: <strong class="admin-user-info admin-user-ip"><?php 
echo $_SERVER["REMOTE_ADDR"];
?>