Index: trunk/kernel/include/usersession.php =================================================================== diff -u -N -r2223 -r2228 --- trunk/kernel/include/usersession.php (.../usersession.php) (revision 2223) +++ trunk/kernel/include/usersession.php (.../usersession.php) (revision 2228) @@ -496,14 +496,16 @@ $this->Set('GroupId', $PersonalGroup ? $PersonalGroup : $PrimaryGroup); - $app = kApplication::Instance(); - $kSession = $app->recallObject('Session'); - $this->Set('GroupList', $extra_groups); $this->SetVariable('UserGroups', $this->Get('GroupList') ); - - $kSession->SetField('GroupList', $extra_groups); - $app->StoreVar('UserGroups', $this->Get('GroupList') ); + + if( class_exists('kApplication') ) + { + $app = kApplication::Instance(); + $kSession = $app->recallObject('Session'); + $kSession->SetField('GroupList', $extra_groups); + $app->StoreVar('UserGroups', $this->Get('GroupList') ); + } $this->Set('LastAccessed', date('U') ); $this_login = $this->GetPersistantVariable("ThisLogin"); @@ -534,16 +536,18 @@ $this->Set("GroupId", $objConfig->Get("User_GuestGroup")); #$this->SetPersistantVariable("LastLogin", time()); - $app = kApplication::Instance(); - $kSession = $app->recallObject('Session'); - $group_list = $objConfig->Get('User_GuestGroup').','.$objConfig->Get('User_LoggedInGroup'); $this->Set("GroupList", $group_list); $this->SetVariable('UserGroups', $group_list ); - $kSession->SetField('GroupList', $group_list); - $app->StoreVar('UserGroups', $group_list ); - + if( class_exists('kApplication') ) + { + $app = kApplication::Instance(); + $kSession = $app->recallObject('Session'); + $kSession->SetField('GroupList', $group_list); + $app->StoreVar('UserGroups', $group_list ); + } + $this->Set("IpAddress",$_SERVER['REMOTE_ADDR']); $this->DeleteSessionData($this->GetSessionKey());