Changeset 15878
- Timestamp:
- 03/01/09 05:21:36 (4 years ago)
- Files:
-
- plugins/crJossoPlugin/trunk/lib/crJossoSecurityFilter.class.php (modified) (1 diff)
- plugins/crJossoPlugin/trunk/lib/user/crJossoUser.class.php (modified) (5 diffs)
- plugins/crJossoPlugin/trunk/modules/crJossoAuth/lib/BasecrJossoAuthActions.class.php (modified) (1 diff)
- plugins/crJossoPlugin/trunk/package.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/crJossoPlugin/trunk/lib/crJossoSecurityFilter.class.php
r15863 r15878 27 27 return; 28 28 }else{ 29 //Check if user authenticated is also authenticated in SSO Identity Manager30 if ($this->context->getUser()->isAuthenticated() &&is_null($aSession))29 //Check if user authenticated 30 if ($this->context->getUser()->isAuthenticated()) 31 31 { 32 // the user is not authenticated against SSO Identity Manager... 32 // if it is not authenticated in SSO Identity Manager then force login 33 // or 34 // if shall we relogin because SSO Session changed 35 if ( is_null($aSession) || 36 $this->context->getUser()->haveToRelogin($aSession) 37 ){ 33 38 $this->context->getUser()->setAuthenticated(false); 34 39 // Then we need to relogin on JOSSO Server 35 40 $this->forwardToLoginAction(); 41 } 36 42 } 37 43 plugins/crJossoPlugin/trunk/lib/user/crJossoUser.class.php
r15863 r15878 9 9 class crJossoUser extends sfBasicSecurityUser { 10 10 11 /**12 * User instance of JossoUser13 * @var JossoUser14 * @access private15 */16 private $user=null;17 11 18 12 /** … … 22 16 * @access public 23 17 * 24 * @param JossoUser $user18 * @param string $aSession SSO Session ID 25 19 */ 26 public function signIn( JossoUser $user)20 public function signIn($aSession) 27 21 { 22 $this->setAttribute('crJossoPluginSessionId',$aSession); 28 23 $this->setAuthenticated(true); 29 $this->user=$user;30 24 $this->loadJossoCredentials(); 25 } 26 27 28 /** 29 * Checks if the SSO Session ID has changed with our own session 30 * 31 * @return boolean 32 * 33 * @access public 34 */ 35 public function haveToRelogin($aSession) 36 { 37 return $aSession!=$this->getAttribute('crJossoPluginSessionId','-1'); 31 38 } 32 39 … … 40 47 public function getJossoUser() 41 48 { 42 if (is_null($this->user)) 43 { 44 $agent=JossoAgent::getNewInstance(); 45 try{ 46 $this->signin($agent->getUserInSession()); 47 }catch(SoapFault $e){ 48 } 49 if (!$this->user) 50 $this->signOut(); 49 $agent=JossoAgent::getNewInstance(); 50 try{ 51 return $agent->getUserInSession(); 52 }catch(SoapFault $e){ 53 return null; 51 54 } 52 return $this->user;53 55 } 54 56 … … 61 63 { 62 64 $this->setAuthenticated(false); 63 $this->user=null;64 65 } 65 66 … … 72 73 protected function loadJossoCredentials() 73 74 { 74 if (is_null($this->user))return; 75 foreach($this->user->getRoles() as $role){ 75 $user=$this->getJossoUser(); 76 if (is_null($user))return; 77 foreach($user->getRoles() as $role){ 76 78 $this->addCredential($role->getName()); 77 79 } plugins/crJossoPlugin/trunk/modules/crJossoAuth/lib/BasecrJossoAuthActions.class.php
r15863 r15878 22 22 $josso_user=$agent->getUserInSession(); 23 23 if (!is_null($josso_user)){ 24 $this->getUser()->signIn($ josso_user);24 $this->getUser()->signIn($agent->accessSession()); 25 25 $this->redirect('@homepage'); 26 26 }else{ plugins/crJossoPlugin/trunk/package.xml
r15864 r15878 22 22 <active>yes</active> 23 23 </lead> 24 <date>2009-0 2-27</date>25 <time> 20:54:35</time>24 <date>2009-03-01</date> 25 <time>02:30:00</time> 26 26 <version> 27 <release>0.1. 1</release>27 <release>0.1.2</release> 28 28 <api>1.1.0</api> 29 29 </version> … … 107 107 </notes> 108 108 </release> 109 <release> 110 <version> 111 <release>0.1.2</release> 112 <api>1.1.0</api> 113 </version> 114 <stability> 115 <release>beta</release> 116 <api>beta</api> 117 </stability> 118 <license uri="http://www.symfony-project.org/license">MIT license</license> 119 <date>2009-02-27</date> 120 <license>MIT</license> 121 <notes> 122 * Solved problem when SSO session change. It happends when other SSO enabled application logout and the login with other user/roles 123 </notes> 124 </release> 109 125 </changelog> 110 126 </package>