public static function handler(array $credentials = array()) {

		$calendar_guid = elgg_extract('calendar_guid', $credentials);
		$user_guid = elgg_extract('user_guid', $credentials);
		$token = elgg_extract('token', $credentials);

		$ia = elgg_set_ignore_access(true);
		$calendar = get_entity($calendar_guid);
		$user = get_entity($user_guid);
		elgg_set_ignore_access($ia);

		$pam = new PAM($calendar, $user);

		if (!has_access_to_entity($calendar, $user)) {
			throw new LoginException('User does not have access to this calendar');
		}

		if (!$calendar->getToken()) {
			throw new LoginException('Calendar does not allow remote access');
		}

		if (!$pam->validateToken($token)) {
			throw new LoginException('Invalid token');
		}

		return true;
	}
public static function handler(array $credentials = array()) {

		$calendar_guid = elgg_extract('calendar_guid', $credentials);
		$user_guid = elgg_extract('user_guid', $credentials);
		$token = elgg_extract('token', $credentials);

		$ia = elgg_set_ignore_access(true);
		$calendar = get_entity($calendar_guid);
		$user = get_entity($user_guid);
		elgg_set_ignore_access($ia);

		$pam = new PAM($calendar, $user);

		if (!has_access_to_entity($calendar, $user)) {
			throw new LoginException('User does not have access to this calendar');
		}

		if (!$calendar->getToken()) {
			throw new LoginException('Calendar does not allow remote access');
		}

		if (!$pam->validateToken($token)) {
			throw new LoginException('Invalid token');
		}

		return true;
	}
public static function handler ( array $ credentials = array ( ) ) { $ calendar_guid = elgg_extract ( 'calendar_guid' , $ credentials ) ; $ user_guid = elgg_extract ( 'user_guid' , $ credentials ) ; $ token = elgg_extract ( 'token' , $ credentials ) ; $ ia = elgg_set_ignore_access ( true ) ; $ calendar = get_entity ( $ calendar_guid ) ; $ user = get_entity ( $ user_guid ) ; elgg_set_ignore_access ( $ ia ) ; $ pam = new PAM ( $ calendar , $ user ) ; if ( ! has_access_to_entity ( $ calendar , $ user ) ) { throw new LoginException ( 'User does not have access to this calendar' ) ; } if ( ! $ calendar -> getToken ( ) ) { throw new LoginException ( 'Calendar does not allow remote access' ) ; } if ( ! $ pam -> validateToken ( $ token ) ) { throw new LoginException ( 'Invalid token' ) ; } return true ; }
Validates PAM credentials

@param array $credentials Credentials
@return boolean
@throws LoginException
Validates PAM credentials