summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-09-01 16:25:00 +0200
committerSebastian Wagner2011-09-01 16:25:00 +0200
commit8f7d600a81b9478fd2b39ab3a3a243e85660c1a9 (patch)
tree733ac5d77f6b4b27e9a575a557540af35e68a79f
parentfehler (diff)
downloadpbs2-8f7d600a81b9478fd2b39ab3a3a243e85660c1a9.tar.gz
pbs2-8f7d600a81b9478fd2b39ab3a3a243e85660c1a9.tar.xz
pbs2-8f7d600a81b9478fd2b39ab3a3a243e85660c1a9.zip
ipv4 ipv6 check
-rw-r--r--application/modules/fbgui/controllers/IndexController.php6
l---------library/Zend2
2 files changed, 7 insertions, 1 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index 3f59873..5934a49 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -74,6 +74,12 @@ class Fbgui_IndexController extends Zend_Controller_Action
$client = new Application_Model_Client();
$client->setMacadress($mySession->postdata['mac']);
$client->setHardwarehash($mySession->postdata['hardwarehash']);
+ //check IPv4 / IPv6
+ if(preg_match('/^\d{1,3}(\.\d{1,3}){3,3}$/',$_SERVER['REMOTE_ADDR'])){
+ $client->setIp($_SERVER['REMOTE_ADDR']);
+ }else{
+ $client->setIp6($_SERVER['REMOTE_ADDR']);
+ }
$client->setGroupID($groupID);
$client->setCreated(time());
$client = $n->createClient($client);
diff --git a/library/Zend b/library/Zend
index c56249b..a826578 120000
--- a/library/Zend
+++ b/library/Zend
@@ -1 +1 @@
-/usr/share/php/libzend-framework-php/Zend/ \ No newline at end of file
+/usr/share/php/libzend-framework-php/Zend \ No newline at end of file