当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_allowDeny函数代码示例

本文整理汇总了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') {
开发者ID:mi-squared,项目名称:openemr,代码行数:31,代码来源:common.inc.php

示例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"));
 }
开发者ID:kfjihailong,项目名称:phpMyAdmin,代码行数:27,代码来源:PMA_ip_allow_deny_test.php


注:本文中的PMA_allowDeny函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。