本文整理汇总了PHP中PMA_allowDeny函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_allowDeny函数的具体用法?PHP PMA_allowDeny怎么用?PHP PMA_allowDeny使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_allowDeny函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$allowDeny_forbidden = true;
if (PMA_allowDeny('allow')) {
$allowDeny_forbidden = false;
}
if (PMA_allowDeny('deny')) {
$allowDeny_forbidden = true;
}
} elseif ($cfg['Server']['AllowDeny']['order'] == 'deny,allow') {
if (PMA_allowDeny('deny')) {
$allowDeny_forbidden = true;
}
if (PMA_allowDeny('allow')) {
$allowDeny_forbidden = false;
}
} elseif ($cfg['Server']['AllowDeny']['order'] == 'explicit') {
if (PMA_allowDeny('allow') && !PMA_allowDeny('deny')) {
$allowDeny_forbidden = false;
} else {
$allowDeny_forbidden = true;
}
}
// end if ... elseif ... elseif
// Ejects the user if banished
if ($allowDeny_forbidden) {
PMA_logUser($cfg['Server']['user'], 'allow-denied');
$auth_plugin->authFails();
}
}
// end if
// is root allowed?
if (!$cfg['Server']['AllowRoot'] && $cfg['Server']['user'] == 'root') {
示例2: testPMA_allowDeny
/**
* Test for PMA_allowDeny
*
* @return void
*/
public function testPMA_allowDeny()
{
$_SERVER['REMOTE_ADDR'] = "";
$this->assertEquals(false, PMA_allowDeny("allow"));
$_SERVER['REMOTE_ADDR'] = "255.0.1.0";
$this->assertEquals(true, PMA_allowDeny("allow"));
$_SERVER['REMOTE_ADDR'] = "10.0.0.0";
$this->assertEquals(false, PMA_allowDeny("allow"));
$_SERVER['REMOTE_ADDR'] = "255.255.0.1";
$this->assertEquals(true, PMA_allowDeny("deny"));
$_SERVER['REMOTE_ADDR'] = "255.124.0.5";
$this->assertEquals(true, PMA_allowDeny("deny"));
$_SERVER['REMOTE_ADDR'] = "122.124.0.5";
$this->assertEquals(false, PMA_allowDeny("deny"));
//IPV6
$_SERVER['REMOTE_ADDR'] = "2001:4998:c:a0d:0000:0000:4998:1020";
$this->assertEquals(true, PMA_allowDeny("allow"));
$_SERVER['REMOTE_ADDR'] = "2001:4998:c:a0d:0000:0000:4998:1000";
$this->assertEquals(false, PMA_allowDeny("allow"));
$_SERVER['REMOTE_ADDR'] = "2001:4998:c:a0d:0000:0000:4998:1020";
$this->assertEquals(true, PMA_allowDeny("allow"));
}