PHP notice

Trying to get property of non-object

/usr/share/nginx/html/lsurveymaster/plugins/AuditLog/AuditLog.php(31)

19             $this->subscribe('beforeParticipantDelete'); 
20             $this->subscribe('beforeLogout');
21             $this->subscribe('afterSuccessfulLogin');
22             $this->subscribe('afterFailedLoginAttempt');
23         }
24 
25         /**
26         * User logout to the audit log
27         * @return unknown_type
28         */
29         public function beforeLogout()
30         {
31             $iUserID=$this->api->getCurrentUser()->uid;
32             $oAutoLog = $this->api->newModel($this, 'log');
33             $oAutoLog->uid=$iUserID;
34             $oAutoLog->entity='user';
35             $oAutoLog->entityid=$iUserID;
36             $oAutoLog->action='beforeLogout';
37             $oAutoLog->save();
38         }
39 
40         /**
41         * Successfull login to the audit log
42         * @return unknown_type
43         */

Stack Trace

#1
+
 /usr/share/nginx/html/lsurveymaster/application/libraries/PluginManager/PluginManager.php(191): call_user_func(array(AuditLog, "beforeLogout"))
186                 {
187                     if (!$event->isStopped() 
188                      && (empty($target) || in_array(get_class($subscription[0]), $target))) 
189                     {
190                         $subscription[0]->setEvent($event);
191                         call_user_func($subscription);
192                     }
193                 }
194             }
195             
196             return $event;
#2
+
 /usr/share/nginx/html/lsurveymaster/application/controllers/admin/authentication.php(121): PluginManager->dispatchEvent(PluginEvent)
116         // Fetch the current user
117         $plugin = App()->user->getState('plugin', null);    // Save for afterLogout, current user will be destroyed by then
118                  
119         /* Adding beforeLogout event */
120         $beforeLogout = new PluginEvent('beforeLogout');
121         App()->getPluginManager()->dispatchEvent($beforeLogout);
122 
123         App()->user->logout();
124         App()->user->setFlash('loginmessage', gT('Logout successful.'));
125 
126         /* Adding afterLogout event */
#5
+
 /usr/share/nginx/html/lsurveymaster/application/core/Survey_Common_Action.php(99): CAction->runWithParamsInternal(Authentication, ReflectionMethod, array("q" => "/lsurveymaster/index.php/admin/authentication/sa/logout", "sa" => "logout"))
094             $oMethod = new ReflectionMethod($this, $sDefault);
095         }
096 
097         // We're all good to go, let's execute it
098         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
099         return parent::runWithParamsInternal($this, $oMethod, $params);
100     }
101 
102     /**
103     * Some functions have different parameters, which are just an alias of the
104     * usual parameters we're getting in the url. This function just populates
2015-01-05 01:54:24 nginx/1.4.6 Yii Framework/1.1.15