summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-09-22 15:49:06 +0200
committerBjörn Geiger2011-09-22 15:49:06 +0200
commitfd984f133e97986feb8c64b0bc41d95323d749c2 (patch)
treed13fd1be634985acb42e6155dc50f481bcede9e1 /application
parentverschiedene Korrekturen (diff)
downloadpoolctrl-fd984f133e97986feb8c64b0bc41d95323d749c2.tar.gz
poolctrl-fd984f133e97986feb8c64b0bc41d95323d749c2.tar.xz
poolctrl-fd984f133e97986feb8c64b0bc41d95323d749c2.zip
Nur so viele Clients werden gestartet/heruntergefahren, wie in Participants angegeben
Diffstat (limited to 'application')
-rwxr-xr-xapplication/controllers/EventController.php52
1 files changed, 32 insertions, 20 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 29b846a..b959ec7 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -726,20 +726,26 @@ class EventController extends Zend_Controller_Action
$poolXML = new SimpleXMLElement($poolXMLString);
foreach($poolXML->poollist->pool as $pool) {
$clientsXML = $pool->clients;
+ $count = 1;
foreach($clientsXML->client as $clientNew) {
- $client = new Application_Model_Client();
- $client->setID(sprintf("%s", $clientNew->clientID));
- $client->setCreated(sprintf("%s", $clientNew->created));
- $client->setGroupID(sprintf("%s", $clientNew->groupid));
- $client->setHardwarehash(sprintf("%s", $clientNew->location));
- $client->setIp(sprintf("%s", $clientNew->ip));
- $client->setIp6(sprintf("%s", $clientNew->ip6));
- $client->setMacadress(sprintf("%s", $clientNew->macadress));
- $clientArray = array(
+ if($event->getParticipants() > 0 && $event->getParticipants() > $count) {
+ $client = new Application_Model_Client();
+ $client->setID(sprintf("%s", $clientNew->clientID));
+ $client->setCreated(sprintf("%s", $clientNew->created));
+ $client->setGroupID(sprintf("%s", $clientNew->groupid));
+ $client->setHardwarehash(sprintf("%s", $clientNew->location));
+ $client->setIp(sprintf("%s", $clientNew->ip));
+ $client->setIp6(sprintf("%s", $clientNew->ip6));
+ $client->setMacadress(sprintf("%s", $clientNew->macadress));
+ $clientArray = array(
'id' => $client->getID(),
'ip' => $client->getIp(),
'mac' => $client->getMacadress());
- $clients[] = $clientArray;
+ $clients[] = $clientArray;
+ $count++;
+ } else {
+ break;
+ }
}
}
}
@@ -1090,20 +1096,26 @@ class EventController extends Zend_Controller_Action
$poolXML = new SimpleXMLElement($poolXMLString);
foreach($poolXML->poollist->pool as $pool) {
$clientsXML = $pool->clients;
+ $count = 1;
foreach($clientsXML->client as $clientNew) {
- $client = new Application_Model_Client();
- $client->setID(sprintf("%s", $clientNew->clientID));
- $client->setCreated(sprintf("%s", $clientNew->created));
- $client->setGroupID(sprintf("%s", $clientNew->groupid));
- $client->setHardwarehash(sprintf("%s", $clientNew->location));
- $client->setIp(sprintf("%s", $clientNew->ip));
- $client->setIp6(sprintf("%s", $clientNew->ip6));
- $client->setMacadress(sprintf("%s", $clientNew->macadress));
- $clientArray = array(
+ if($event->getParticipants() > 0 && $event->getParticipants() > $count) {
+ $client = new Application_Model_Client();
+ $client->setID(sprintf("%s", $clientNew->clientID));
+ $client->setCreated(sprintf("%s", $clientNew->created));
+ $client->setGroupID(sprintf("%s", $clientNew->groupid));
+ $client->setHardwarehash(sprintf("%s", $clientNew->location));
+ $client->setIp(sprintf("%s", $clientNew->ip));
+ $client->setIp6(sprintf("%s", $clientNew->ip6));
+ $client->setMacadress(sprintf("%s", $clientNew->macadress));
+ $clientArray = array(
'id' => $client->getID(),
'ip' => $client->getIp(),
'mac' => $client->getMacadress());
- $clients[] = $clientArray;
+ $clients[] = $clientArray;
+ $count++;
+ } else {
+ break;
+ }
}
}
}