__string2array() private method

private __string2array ( $p_IPaddress )
コード例 #1
0
ファイル: IPAccess.php プロジェクト: sourcefabric/newscoop
 public static function GetUsersHavingIP($p_ipAddress)
 {
     global $g_ado_db;
     $cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
     $cacheKey = $cacheService->getCacheKey(array('GetUsersHavingIP', $p_ipAddress), 'users');
     if ($cacheService->contains($cacheKey)) {
         $users = $cacheService->fetch($cacheKey);
     } else {
         $ipObj = new IPAccess();
         $intIPAddress = $ipObj->__array2int($ipObj->__string2array($p_ipAddress));
         $queryStr = "SELECT DISTINCT(IdUser) FROM SubsByIP WHERE StartIP <= {$intIPAddress} " . "AND {$intIPAddress} <= (StartIP + Addresses - 1)";
         $rows = (array) $g_ado_db->GetAll($queryStr);
         if (empty($rows)) {
             $cacheService->save($cacheKey, array());
             return array();
         }
         $users = array();
         foreach ($rows as $row) {
             $users[] = $GLOBALS['controller']->getHelper('service')->getService('user')->find($row['IdUser']);
         }
         $cacheService->save($cacheKey, $users);
     }
     return $users;
 }
コード例 #2
0
ファイル: IPAccess.php プロジェクト: nistormihai/Newscoop
	public static function GetUsersHavingIP($p_ipAddress)
	{
        global $g_ado_db;

        $ipObj = new IPAccess();
        $intIPAddress = $ipObj->__array2int($ipObj->__string2array($p_ipAddress));
        $queryStr = "SELECT DISTINCT(IdUser) FROM SubsByIP WHERE StartIP <= $intIPAddress "
        . "AND $intIPAddress <= (StartIP + Addresses - 1)";
        $rows = $g_ado_db->GetAll($queryStr);
        $users = array();
		foreach ($rows as $row) {
			$users[] = new User($row['IdUser']);
		}
		return $users;
	}
コード例 #3
0
ファイル: IPAccess.php プロジェクト: nidzix/Newscoop
 public static function GetUsersHavingIP($p_ipAddress)
 {
     global $g_ado_db;
     $ipObj = new IPAccess();
     $intIPAddress = $ipObj->__array2int($ipObj->__string2array($p_ipAddress));
     $queryStr = "SELECT DISTINCT(IdUser) FROM SubsByIP WHERE StartIP <= {$intIPAddress} " . "AND {$intIPAddress} <= (StartIP + Addresses - 1)";
     $rows = (array) $g_ado_db->GetAll($queryStr);
     if (empty($rows)) {
         return array();
     }
     $users = array();
     foreach ($rows as $row) {
         $users[] = $GLOBALS['controller']->getHelper('service')->getService('user')->find($row['IdUser']);
     }
     return $users;
 }