hajtest
Current file: D:\websites\haj\application\views\helpers\LoggedInUser.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 2
0.00%0.00%
0.00% 0 / 18
 
Zend_View_Helper_LoggedInUser
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 2
0.00%0.00%
0.00% 0 / 17
 function setView($view)
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 2
 function loggedInUser()
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 14


       1                 :                                                                                                
       2               0 : <?php                                                                                          
       3                 :                                                                                                
       4                 : class Zend_View_Helper_LoggedInUser                                                            
       5               0 : {                                                                                              
       6                 :                                                                                                
       7                 :     public $view;                                                                              
       8                 :                                                                                                
       9                 :     function setView($view)                                                                    
      10                 :     {                                                                                          
      11               0 :         $this->view = $view;                                                                   
      12               0 :     }                                                                                          
      13                 :                                                                                                
      14                 :     function loggedInUser()                                                                    
      15                 :     {                                                                                          
      16               0 :         $auth = Zend_Auth::getInstance();                                                      
      17               0 :         if ($auth->hasIdentity()) {                                                            
      18               0 :             $logoutUrl = $this->view->url(array('controller' => 'auth', 'action' => 'logout'));
					
      19               0 :             $user = $auth->getIdentity();                                                      
      20               0 :             $username = $this->view->escape($user->email);                                     
      21                 :                                                                                                
      22               0 :             $string = 'Logged in as ' . $username;                                             
      23               0 :             $string .= ' | <a href="' . $logoutUrl . '">Log out</a>';                          
      24               0 :         } else {                                                                               
      25                 : //            $loginUrl = $this->view->url(array('controller'=>'auth', 'action'=>'login'));    
      26                 : //            $string = '<a href="'. $loginUrl . '">Log in</a>';                               
      27               0 :             $string = "<h3>Login</h3>";                                                        
      28               0 :             $login = new Application_Form_UserLogin();                                         
      29               0 :             $login->getElement('user')->setLabel('Email: ');                                   
      30               0 :             $login->getElement('pass')->setLabel('Pass: ');                                    
      31               0 :             $string = $login;                                                                  
      32                 :         }                                                                                      
      33               0 :         return $string;                                                                        
      34                 :     }                                                                                          
      35                 :                                                                                                

Generated by PHPUnit 3.4.15 and Xdebug 2.1.0rc1 using PHP 5.3.1 at Mon Jan 17 15:42:18 PST 2011.