CAS_Client::setPostAuthenticateCallback PHP Method

setPostAuthenticateCallback() public method

The callback function will be passed a $logoutTicket as its first parameter, followed by any $additionalArgs you pass. The $logoutTicket parameter is an opaque string that can be used to map a session-id to the logout request in order to support single-signout in applications that manage their own sessions (rather than letting phpCAS start the session). phpCAS::forceAuthentication() will always exit and forward client unless they are already authenticated. To perform an action at the moment the user logs in (such as registering an account, performing logging, etc), register a callback function here.
public setPostAuthenticateCallback ( string $function, array $additionalArgs = [] ) : void
$function string callback function to call
$additionalArgs array optional array of arguments
return void
    public function setPostAuthenticateCallback($function, array $additionalArgs = array())
    {
        $this->_postAuthenticateCallbackFunction = $function;
        $this->_postAuthenticateCallbackArgs = $additionalArgs;
    }

Usage Example

示例#1
0
文件: CAS.php 项目: DCUnit711/Demeter
 /**
  * Set a callback function to be run when a user authenticates.
  *
  * The callback function will be passed a $logoutTicket as its first
  * parameter, followed by any $additionalArgs you pass. The $logoutTicket
  * parameter is an opaque string that can be used to map the session-id to
  * logout request in order to support single-signout in applications that
  * manage their own sessions (rather than letting phpCAS start the session).
  *
  * phpCAS::forceAuthentication() will always exit and forward client unless
  * they are already authenticated. To perform an action at the moment the user
  * logs in (such as registering an account, performing logging, etc), register
  * a callback function here.
  *
  * @param string $function       Callback function
  * @param array  $additionalArgs optional array of arguments
  *
  * @return void
  */
 public static function setPostAuthenticateCallback($function, array $additionalArgs = array())
 {
     phpCAS::_validateClientExists();
     self::$_PHPCAS_CLIENT->setPostAuthenticateCallback($function, $additionalArgs);
 }
CAS_Client