public static function log($action , $username = null , $timestamp = null , $ip = null , $useragent = null)
	{
		if ( ! is_array( self::$auth ) ) throw new Exception( 'Authentication not initialized' );

		if ( ! isset( self::$auth['logs'] ) ) {
			self::$auth['logs'] = array();
		}

		if ( is_null( $username ) ) $username = self::getCurrentUsername();
		if ( is_null( $timestamp ) ) $timestamp = date("U");
		if ( is_null( $ip ) ) $ip = self::getClientIp();
		if ( is_null( $useragent ) ) $useragent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? $_SERVER['HTTP_USER_AGENT'] : '';

		self::$auth['logs'] = array_slice( array_merge( array( array( $action , $username , $timestamp , $ip , $useragent ) ) , self::$auth['logs'] ) , 0 , abs( (int) AUTH_LOG_FILE_COUNT ) );

		return true;
	}
public static function log($action , $username = null , $timestamp = null , $ip = null , $useragent = null)
	{
		if ( ! is_array( self::$auth ) ) throw new Exception( 'Authentication not initialized' );

		if ( ! isset( self::$auth['logs'] ) ) {
			self::$auth['logs'] = array();
		}

		if ( is_null( $username ) ) $username = self::getCurrentUsername();
		if ( is_null( $timestamp ) ) $timestamp = date("U");
		if ( is_null( $ip ) ) $ip = self::getClientIp();
		if ( is_null( $useragent ) ) $useragent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? $_SERVER['HTTP_USER_AGENT'] : '';

		self::$auth['logs'] = array_slice( array_merge( array( array( $action , $username , $timestamp , $ip , $useragent ) ) , self::$auth['logs'] ) , 0 , abs( (int) AUTH_LOG_FILE_COUNT ) );

		return true;
	}
public static function log ( $ action , $ username = null , $ timestamp = null , $ ip = null , $ useragent = null ) { if ( ! is_array ( self :: $ auth ) ) throw new Exception ( 'Authentication not initialized' ) ; if ( ! isset ( self :: $ auth [ 'logs' ] ) ) { self :: $ auth [ 'logs' ] = array ( ) ; } if ( is_null ( $ username ) ) $ username = self :: getCurrentUsername ( ) ; if ( is_null ( $ timestamp ) ) $ timestamp = date ( "U" ) ; if ( is_null ( $ ip ) ) $ ip = self :: getClientIp ( ) ; if ( is_null ( $ useragent ) ) $ useragent = ( isset ( $ _SERVER [ 'HTTP_USER_AGENT' ] ) ) ? $ _SERVER [ 'HTTP_USER_AGENT' ] : '' ; self :: $ auth [ 'logs' ] = array_slice ( array_merge ( array ( array ( $ action , $ username , $ timestamp , $ ip , $ useragent ) ) , self :: $ auth [ 'logs' ] ) , 0 , abs ( ( int ) AUTH_LOG_FILE_COUNT ) ) ; return true ; }
Log an action

@param string $action    the action text
@param string $username  the username or null for the current logged in user
@param int    $timestamp the action timestamp
@param string $ip        the IP address
@param string $useragent the user agent

@return bool true
Log an action