示例#1
0
 /** 
  * Sanity Checker for this class, which helps us debug,
  * or ensure that its working as expected 
  */
 static function ip2country_check()
 {
     global $ss_disableFeatures;
     if ($ss_disableFeatures['geoip']) {
         return;
     }
     // sanity check for ip2country, to ensure that it is working as expected.
     $checks = array('www.paradise.net.nz' => array('code' => 'NZ', 'name' => 'New Zealand'), 'news.com.au' => array('code' => 'AU', 'name' => 'Australia'), 'www.google.com' => array('code' => 'US', 'name' => 'United States'), 'a.b.c.d.e.f.g' => false);
     $status = true;
     foreach ($checks as $url => $expectedResponse) {
         $response = ip2country($url);
         if (!$response && $expectedResponse) {
             user_error("ip2country_check failed sanity check: ip2country({$url}) returned false. Expected code: '{$expectedResponse}'", E_USER_WARNING);
             $status = false;
         } elseif ($response != $expectedResponse) {
             user_error("ip2country_check failed sanity check: ip2country({$url}) returned code: '{$response['code']}/{$response['name']}'. Expected code: '{$expectedResponse['code']}/{$expectedResponse['name']}'", E_USER_WARNING);
             $status = false;
         }
     }
     return $status;
 }
示例#2
0
?>
</b></td>
            </tr>
            <tr>
              <td><?php 
_e("User IP");
?>
</td>
              <td><?php 
print $ord['user_ip'];
?>
                <?php 
if (function_exists('ip2country')) {
    ?>
                <?php 
    print ip2country($ord['user_ip']);
    ?>
                <?php 
}
?>
</td>
            </tr>
          </table>
          <div class="mw-ui-box order-details-box">
            <div class="mw-ui-box-header">
              <?php 
_e("Shipping Address");
?>
            </div>
            <div class="mw-ui-box-content">
              <table cellspacing="0" cellpadding="0" class="mw-ui-table mw-ui-table-basic" style="margin-top: 0;">
示例#3
0
     if ($n == "email" || $n == "email2") {
         if (validateEmail($value) !== true) {
             $pass = "******";
             serveranswer(0, $lang['txt']['invalidemail']);
             continue;
         }
         continue;
     }
 }
 if (!preg_match("/^[a-zA-Z0-9_]+((\\-?)[a-zA-Z0-9_](\\-?)+)*\$/", $input->p['username'])) {
     serveranswer(0, $lang['txt']['username_charallowed']);
 }
 $partmail = explode("@", $email);
 $maila = "*@" . $partmail[1];
 $mailb = $email;
 $country = ip2country($_SERVER['REMOTE_ADDR']);
 $my_ip_add = $_SERVER['REMOTE_ADDR'];
 $sect = explode(".", $my_ip_add);
 $reip = $sect[0] . "." . $sect[1] . "." . $sect[2] . "." . $sect[3];
 $reipa = $sect[0] . "." . $sect[1] . "." . $sect[2] . ".*";
 $reipb = $sect[0] . "." . $sect[1] . ".*.*";
 $reipc = $sect[0] . ".*.*.*";
 $verifymaila = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='email' AND criteria='" . $maila . "'");
 $verifymailb = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='email' AND criteria='" . $mailb . "'");
 $verifyusername = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='username' AND criteria='" . $username . "'");
 $ipban1 = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='ip' AND criteria='" . $reip . "'");
 $ipban2 = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='ip' AND criteria='" . $reipa . "'");
 $ipban3 = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='ip' AND criteria='" . $reipb . "'");
 $ipban4 = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='ip' AND criteria='" . $reipc . "'");
 $countryban = $db->fetchOne("SELECT COUNT(*) AS NUM FROM blacklist WHERE type='country' AND criteria='" . $country . "'");
 if ($password != $password2) {