original_string: public function postlogout_hook($user) {
          global $CFG;
          // Only redirect to CAS logout if the user is logged as a CAS user.
          if (!empty($this->config->logoutcas) && $user->auth == $this->authtype) {
              $backurl = !empty($this->config->logout_return_url) ? $this->config->logout_return_url : $CFG->wwwroot;
              $this->connectCAS();
              phpCAS::logoutWithRedirectService($backurl);
          }
      }
code: public function postlogout_hook($user) {
          global $CFG;
          // Only redirect to CAS logout if the user is logged as a CAS user.
          if (!empty($this->config->logoutcas) && $user->auth == $this->authtype) {
              $backurl = !empty($this->config->logout_return_url) ? $this->config->logout_return_url : $CFG->wwwroot;
              $this->connectCAS();
              phpCAS::logoutWithRedirectService($backurl);
          }
      }
code_tokens: public function postlogout_hook ( $ user ) { global $ CFG ; // Only redirect to CAS logout if the user is logged as a CAS user. if ( ! empty ( $ this -> config -> logoutcas ) && $ user -> auth == $ this -> authtype ) { $ backurl = ! empty ( $ this -> config -> logout_return_url ) ? $ this -> config -> logout_return_url : $ CFG -> wwwroot ; $ this -> connectCAS ( ) ; phpCAS :: logoutWithRedirectService ( $ backurl ) ; } }
docstring: Post logout hook.
  
  Note: this method replace the prelogout_hook method to avoid redirect to CAS logout
  before the event userlogout being triggered.
  
  @param stdClass $user clone of USER object object before the user session was terminated
docstring_tokens: Post logout hook .