summaryrefslogtreecommitdiffstats
path: root/application/modules/dev/controllers/FilterController.php
blob: d68f0338812f6d52224efea4828c825810f7dfe3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
<?php
/*
 * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
 * This program is free software distributed under the GPL version 2.
 * See http://gpl.openslx.org/
 *
 * If you have any feedback please consult http://feedback.openslx.org/ and
 * send your suggestions, praise, or complaints to feedback@openslx.org
 *
 * General information about OpenSLX can be found at http://openslx.org/
 */

class dev_FilterController extends Zend_Controller_Action
{

    private $_filtermapper = null;

    private $db = null;

    public function init()
    {
        try{		 
        	$this->_filtermapper = new Application_Model_FilterMapper();
		}catch (Zend_Exception $e) {  
        	echo "Error message 1: " . $e->getMessage() . "\n";
		}
		$this->db = Zend_Db_Table::getDefaultAdapter();
    }

    public function indexAction()
    {
        try{			
        			$this->_filtermapper = new Application_Model_FilterMapper();
               		$this->view->filters = $this->_filtermapper->fetchAll();
            	}catch (Zend_Exception $e) {  
        			echo "Error message 2: " . $e->getMessage() . "\n";
    		}
	}

    public function addfilterAction()
    {
        $bmmapper = new Application_Model_BootMenuMapper();
		//TODO get bootmenu by group
		$bootmenus = $bmmapper->fetchAll();
        if (!isset($_POST["add"])){		
    		$addfilterform = new dev_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus));    		
			$this->view->addfilterform = $addfilterform;			
		}else {
			$addfilterform = new dev_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus),$_POST);
			if ($addfilterform->isValid($_POST)) {			
				try{
					$newfilter = new Application_Model_Filter($_POST);
					$newfilter->setCreated(time());

					// TODO: Ändere mit ACL
					$newfilter->setGroupID('1');
					$newfilter->setMembershipID('1');			

					$newfilter2 = new Application_Model_FilterMapper();
					$newfilter2->save($newfilter);

					$this->_redirect('/dev/filter');
			    	return;
				}catch (Zend_Exception $e) {  
        			echo "Error message 2: " . $e->getMessage() . "\n";  
        		}
			}
			$this->view->addfilterform = $addfilterform;
		}
    }

    public function removefilterAction()
    {
        $filterID = $this->_request->getParam('filterID');
        		// TODO: ACL implementieren ob er den filter löschen darf
        		if(is_numeric($filterID)){
        			$deletefilter = new Application_Model_Filter();
        			$deletefilter->setID($filterID);
        			$filtermapper = new Application_Model_FilterMapper();
        			$filtermapper->delete($deletefilter);
        		}
        		$this->_redirect('/dev/filter');
    }

    public function editfilterAction()
    {
        $bmmapper = new Application_Model_BootMenuMapper();
        		//TODO get bootmenu by group
        		$bootmenus = $bmmapper->fetchAll();
        		if (!isset($_POST["add"])){
        		    // TODO: ACL implementieren ob er editieren darf
        			$filterID = $this->_request->getParam('filterID');
        			$filter = new Application_Model_Filter();
        			
        
        			$filtermapper = new Application_Model_FilterMapper();
        			$filtermapper->find($filterID,$filter);		
        			$filter2 = $filter->toArray();
        
        			$editfilterform = new dev_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus));  
        			$editfilterform->populate($filter2);
        			$this->view->editfilterform = $editfilterform;
        		
        		} else{
        			try{
        				$filterID = $this->_request->getParam('filterID');	
        				
        				$editfilterform = new dev_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus),$_POST);
        				//TODO: ACL integrieren				
        				$_POST['groupID'] = 1;
        				$_POST['membershipID'] = 1;
        				$_POST['created'] = time();
        
        				if ($editfilterform->isValid($_POST)) {	
        					$newfilterenty = new Application_Model_Filter($_POST);
        					$newfilterenty->setID($this->_request->getParam('filterID'));
        					$newfilter2 = new Application_Model_FilterMapper();				
        					$newfilter2->save($newfilterenty);
        					echo 'valid';	
        					$this->_redirect('/dev/filter');				
        				}		
        				$this->view->editfilterform = $editfilterform;
        			}catch (Zend_Exception $e) {  
            			echo "Error message 2: " . $e->getMessage() . "\n";  
            		}
        		}
    }

    public function addfilterentryAction()
    {
        // TODO: ACL implementieren ob er editieren darf   
		if (!isset($_POST["add"])){
			try{
				$editfilterform = new dev_Form_FilterEntriesAdd(
									array(	'buttontext' => 'Add Filterentry',
											'filterID' => $this->_request->getParam('filterID'),
											'data' => $_POST
										));
				$editfilterform->populate($_POST);
				$this->view->editfilterform = $editfilterform;
			}catch (Zend_Exception $e) {  
				echo "Error message 2: " . $e->getMessage() . "\n";  
			}
		} else{
			$editfilterform = new dev_Form_FilterEntriesAdd(array('buttontext' => 'Add Filterentry'),$_POST);			
			if ($editfilterform->isValid($_POST)) {							
				$newfilterenty = new Application_Model_FilterEntries();
				$newfilterenty->setFilterID($_POST['filterID']);
				$newfilterenty->setFiltertypeID($_POST['filtertypeID']);

				if($_POST['filtertypeID'] == 1){
					$newfilterenty->setFiltervalue($this->fillIP($_POST['filtervalue']));
					$newfilterenty->setFiltervalue2($this->fillIP($_POST['filtervalue2']));
				}
				else{				
					$newfilterenty->setFiltervalue($_POST['filtervalue']);
					$newfilterenty->setFiltervalue2($_POST['filtervalue2']);	
				}
				
				$newfilter2 = new Application_Model_FilterEntriesMapper();
				$newfilter2->save($newfilterenty);					
				#print_a($newfilterenty);
				$this->_redirect('/dev/filter');
			}
			$this->view->editfilterform = $editfilterform;
		}
    }

    public function editfilterentryAction()
    {
        if (!isset($_POST["add"])){
			try{
				$filterentriesID = $this->_request->getParam('filterentriesID');
								
				$filterentry = new Application_Model_FilterEntries();
				$filterentriesmapper = new Application_Model_FilterEntriesMapper();
				$filterentriesmapper->find($filterentriesID,$filterentry);		
			
				
				
				#$editfilterform->setFilterID($filterID);
				if(isset($_POST['filtertypeID']) && $_POST['filtertypeID'] != $filterentry->getFiltertypeID()){
					$filterentry->setFiltertypeID($_POST['filtertypeID']) ;
				}
				$data = $filterentry->toArray();
				print_a($data);
				$editfilterform = new dev_Form_FilterEntriesAdd(
												array('buttontext' => 'Edit Filterentry',
														'data' => $data));
				
				$editfilterform->populate($filterentry->toArray());
				$this->view->editfilterform = $editfilterform;

			}catch (Zend_Exception $e) {  
				echo "Error message 2: " . $e->getMessage() . "\n";  
			}
		} else{
			try{
				$filterentriesID = $this->_request->getParam('filterentriesID');	
				$editfilterform = new dev_Form_FilterEntriesAdd(array('buttontext' => 'Edit Filterentry'),$_POST);	
				if ($editfilterform->isValid($_POST)) {	
					if($_POST['filterID'] == '')
						unset($_POST['filterID']);
					$newfilterenty = new Application_Model_FilterEntries($_POST);					
					$newfilterenty->setID($filterentriesID);				
					if($_POST['filtertypeID'] == 1){
						$newfilterenty->setFiltervalue($this->fillIP($_POST['filtervalue']));
						$newfilterenty->setFiltervalue2($this->fillIP($_POST['filtervalue2']));
					}
					else{				
						$newfilterenty->setFiltervalue($_POST['filtervalue']);
						$newfilterenty->setFiltervalue2($_POST['filtervalue2']);	
					}
					$newfilter2 = new Application_Model_FilterEntriesMapper();				
					$newfilter2->save($newfilterenty);
					#print_a($newfilterenty);
					$this->_redirect('/dev/filter');
								
				}
				$this->view->editfilterform = $editfilterform;
			}catch (Zend_Exception $e) {  
				echo "Error message 2: " . $e->getMessage() . "\n";  
			}				
		}
    }

    public function removefilterentryAction()
    {
        try{    		
    			$filterentriesID = $this->_request->getParam('filterentriesID');
    
    			// TODO: ACL implementieren ob er den filter löschen darf
    			if(is_numeric($filterentriesID)){
    				$deletefilterentry = new Application_Model_FilterEntries();
    				$deletefilterentry->setID($filterentriesID);    				
    
    				$filterentriesmapper = new Application_Model_FilterEntriesMapper();
    				$filterentriesmapper->delete($deletefilterentry);
    				echo "ok";
    			}
    			$this->_redirect('/dev/filter');
    		}catch (Zend_Exception $e) {  
    			echo "Error message 2: " . $e->getMessage() . "\n";
		}
    }

    private function fillIP($ip)
    {
        $ar = explode(".",$ip);
        		$representation = array();
        		foreach($ar as $part){
        			$representation[] = sprintf("%03s",$part);
        		}
        		return implode(".",$representation);
    }

    private function fillMac($ip)
    {
        $ar = explode(":",$ip);
        		$representation = array();
        		foreach($ar as $part){
        			$representation[] = sprintf("%02s",$part);
        		}
        		return implode(":",$representation);
    }

    public function evaluateAction()
    {
        $db = $this->db;	
		$showPartResults = false;
		// For Testing Filters
		

		$testFilter = (isset($_POST['submit']))?true:false;
		
		if($testFilter){
			$ipAdress = $_POST['ip'];
			$macAdress = $_POST['mac'];
			$poolID = $_POST['poolID'];
			$bootisoID = $_POST['bootisoID'];
			$membershipID = $_POST['membershipID'];
			$groupID = $_POST['groupID'];
			$time = ($_POST['time']);
			$clientID = $_POST['clientID'];
			$weekday = $_POST['weekday'];		
			$date = $_POST['date'];
			print_a('Input',
				array('ipAdress'=>$ipAdress,
					'macAdress'=>$macAdress,
					'poolID' => $poolID,
					'bootisoID' => $bootisoID,
					'membershipID'=>$membershipID,
					'groupID'=>$groupID,
					'time'=> $time." - ".date('d.m.Y H:i:s',$time),
					'clientID' => $clientID,
					'hardwarehash' => $hardwarehash,
					'weekday' => $weekday,
					'date' => $date));
		}
		
		
		try{ 			
			$mysession = '1';
			$set = array();

			
			$session = new Application_Model_Session();
			$sessionmapper = new Application_Model_SessionMapper();
			$sessionmapper->find($mysession,$session);
			#########################################################
			// IP Adress
			$filtertypID = 1;
			// get it from session_table with session_id from the session
			if(!$testFilter){
				$ipAdress = $session->getIp();
			}
			$ipAdress = str_replace(".","",$this->fillIP($ipAdress));

			$select = $db->select()
			     ->from(array('pbs_filterentries')
					)
				->where('filtertypeID  = ?',$filtertypID)
				->where('REPLACE(filtervalue,".","") <= ?',$ipAdress)
				->where('? <= REPLACE(filtervalue2,".","")',$ipAdress);
	
			$stmt = $select->query();
			$result = $stmt->fetchAll();
			foreach($result as $r){
				$set[$filtertypID][] = $r['filterID'];	
			}

			if($showPartResults)
				print_a('ipAdress',$result,$set[$filtertypID]);	

			#########################################################
			// Mac range
			$filtertypID = 2;
			// get it from session_table with session_id from the session
			if(!$testFilter){
				$client = new Application_Model_Client();
				$clientmapper = new Application_Model_ClientMapper();
				$clientmapper->find($session->getClientID(),$client);
				$macAdress = $client->getMacadress();
			}
			try{
				$macAdress = $this->fillMac($macAdress);			
				$stmt = $db->query("SELECT * FROM pbs_filterentries WHERE 
								filtertypeID  = ".$filtertypID." AND
								filtervalue <= '".$macAdress."' AND
								'".$macAdress."' <= filtervalue2");
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}
			if($showPartResults)
				print_a('macAdress',$result,$set[$filtertypID]);

			#########################################################
			// PoolID
			$filtertypID = 3;
				// get PoolID from client_ID from session_id from the session
			if(!$testFilter){			
				$poolentry = new Application_Model_PoolEntries();
				$poolentrymapper = new Application_Model_PoolEntriesMapper();
				$poolentry = $poolentrymapper->findby(array('clientID' => $client->getID()),true);
				$poolentry = $poolentry[0];		
			
				$poolID = $poolentry['poolID'];
			}			
			
			try{
				$stmt = $db->query("SELECT * FROM pbs_filterentries WHERE 
								filtertypeID  = ".$filtertypID." AND
								filtervalue = ".$poolID." ");			
				$result = $stmt->fetchAll();
				if(count($result)>0){
					foreach($result as $r){
						$set[$filtertypID][] = $r['filterID'];	
					}
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('poolID',$result,$set[$filtertypID]);
			#########################################################
			// ClientID		
			$filtertypID = 8;	
			// get client_ID from session_id from the session
			
			if(!$testFilter){
				$clientID = $session->getClientID();
			}
			try{
				$stmt = $db->query("SELECT * FROM pbs_filterentries WHERE 
								filtertypeID  = ".$filtertypID." AND
								filtervalue = ".$clientID." ");
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('clientID',$result,$set[$filtertypID]);
			#########################################################
			// BootIsoID
			$filtertypID = 4;
				// get BootIsoID from client_ID from session_id from the session	
			if(!$testFilter){		
				$bootisoID = $session->getBootisoID();
			}
			try{
				$stmt = $db->query("SELECT * FROM pbs_filterentries WHERE 
								filtertypeID  = ".$filtertypID." AND
								filtervalue = ".$bootisoID." ");
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('bootisoID',$result,$set[$filtertypID]);
			#########################################################
			// MembershipID
			$filtertypID = 5;

			if(!$testFilter){		
				// get membership from the session
				//TODO: GET MEMBERSHIP from SESSION
				$membershipID = 1;
			}
			try{
				$stmt = $db->query("SELECT * FROM pbs_filterentries WHERE 
								filtertypeID  = ".$filtertypID." AND
								filtervalue = ".$membershipID." ");
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('membership',$result,$set[$filtertypID]);
			#########################################################
			// GroupID
			$filtertypID = 6;

			if(!$testFilter){		
				// get membership from the session
				//TODO: GET GROUP from SESSION
				$groupID = 1;	
			}
			try{
				$stmt = $db->query("SELECT * FROM pbs_filterentries WHERE 
								filtertypeID  = ".$filtertypID." AND
								filtervalue = ".$groupID." ");
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('membership',$result,$set[$filtertypID]);
			#########################################################
			// Time
			$filtertypID = 7;
			if(!$testFilter){
				$time = time("H:i");
			}

			$nowShort = $time;

			$nowShort = str_replace(":","",$nowShort);
			try{
				$select = $db->select()
					 ->from(array('pbs_filterentries')
						)
					->where('filtertypeID  = ?',$filtertypID)
					->where('REPLACE(filtervalue,":","") <= ? AND ? <= REPLACE(filtervalue2,":","")',$nowShort);
	
				$stmt = $select->query();
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('time',$result,$set[$filtertypID]);	
			#########################################################
			// Hardwarehash
			$filtertypID = 9;
			if(!$testFilter){
				// get hardwarehash from session
				$hardwarehash = 'aaaa';
			}

			try{
				$select = $db->select()
					 ->from(array('pbs_filterentries')
						)
					->where('filtertypeID  = ?',$filtertypID)
					->where('`filtervalue` = ?',$hardwarehash);	
				$stmt = $select->query();
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('hardwarehash',$result,$set[$filtertypID]);	
			#########################################################
			// weekday
			$filtertypID = 10;
			if(!$testFilter){
				$weekday = date('N');
			}

			try{
				$select = $db->select()
					 ->from(array('pbs_filterentries')
						)
					->where('filtertypeID  = ?',$filtertypID)
					->where('filtervalue = ? ',$weekday);
	
				$stmt = $select->query();
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('weekday',$result,$set[$filtertypID]);	
			#########################################################
			// weekday
			$filtertypID = 11;
			if(!$testFilter){
				$date = date('d.m.Y');
			}

			try{
				$select = $db->select()
					 ->from(array('pbs_filterentries')
						)
					->where('filtertypeID  = ?',$filtertypID)
					->where('REPLACE(filtervalue,".","") <= ? AND ? <= REPLACE(filtervalue2,".","")',$date);
	
				$stmt = $select->query();
				$result = $stmt->fetchAll();
				foreach($result as $r){
					$set[$filtertypID][] = $r['filterID'];	
				}
			}
			catch(Exception $e){}

			if($showPartResults)
				print_a('weekday',$result,$set[$filtertypID]);	
			########################################
			// ErgebnisSet auswerten
			print_a('the result sets of the filtertypes',$set);			
		
			// Merging of the resultsets of the filter
			$kk = array();
			foreach($set as $myset){
				$kk = array_merge($kk,$myset);
			}
			$set = $kk;
			// counting how often a filter is evaluated at database
			$a = array();
			foreach($set as $k=> $s){
				$a[$s] += 1;
			}	
			print_a('Übereinstimmungen pro Filter',$a);
			// Get the number of filtertypes every filter has
			$stmt = $db->query('SELECT filterID, COUNT(filtertypeID) as num FROM pbs_filterentries GROUP BY filterID');			 
			$resultset = $stmt->fetchAll();
			foreach($resultset as $d){
				$database[$d['filterID']] = $d['num'];
			}
			print_a('Anzahl Filterentries in Datenbank',$database);
		
			// remove all filters from resultset, which to few filtertypes satisfied
			$result = array();
			foreach($a as $i=>$b){
				if($a[$i] < $database[$i]){
					unset($a[$i]);
				}
				else{
					$result[] = $i;
				}
			}
		
			print_a('True Filters',$result);
			// now selecting the filter with the highest priority
			$query = 'SELECT filterID, bootmenuID, priority 
				FROM pbs_filter WHERE ';
			foreach($result as $e){
				$queryTmp[] = "filterID = '$e'";
			}
			$query .= implode(" OR ", $queryTmp);
			$query .= 'ORDER BY priority DESC LIMIT 0,1';
			$bootmenuID = 'null';
			try{
				$stmt = $db->query($query);
				$resultset = $stmt->fetchAll();
				$bootmenuID = $resultset[0]['bootmenuID'];
			}
			catch(Exception $e){				
			}
			if($bootmenuID != 'null'){
				$bm = new Application_Model_BootMenu();
				$bmmapper = new Application_Model_BootMenuMapper();
				$bmmapper->find($bootmenuID,$bm);
				echo "<h1><a href='/bootmenu/index/bootmenuid/".$bootmenuID."'>Goto BootmenuID: ".$bootmenuID."</a></h1>";
			}
			else{
			echo "<h1>No Result :-(</h1>";
			}
			
		}catch (Zend_Exception $e) {  
				echo "class: ".get_class($e)."<br>\n";
				echo "Error message 2: " . $e->getMessage() . "\n";
		}
    }

    public function testevaluateAction()
    {		
		$pm = new Application_Model_PoolMapper();
		$pools = $pm->fetchAll();

		$bim = new Application_Model_BootIsoMapper();
		$bootisos = $bim->fetchAll();

		$mm = new Application_Model_MembershipMapper();
		$memberships = $mm->fetchAll();

		$gm = new Application_Model_GroupMapper();
		$groups = $gm->fetchAll();

		$cm = new Application_Model_ClientMapper();
		$clients = $cm->fetchAll();

		$filterevaluate = new dev_Form_FilterEvaluate(
			array(	'pools' 		=>	$pools,
					'bootisos' 		=>	$bootisos,
					'memberships'	=>	$memberships,
					'groups'		=>	$groups,
					'clients'		=>	$clients,
					
			));
		$filterevaluate->populate(array(
							'ip'  => '132.230.5.6',
							'mac' => '08:00:20:ae:fd:7e',
							'time'=>date('d.m.Y H:i'))
							);
        $this->view->filterevaluate = $filterevaluate;
    }


}