4 * Licensed to Jasig under one or more contributor license
5 * agreements. See the NOTICE file distributed with this work for
6 * additional information regarding copyright ownership.
8 * Jasig licenses this file to you under the Apache License,
9 * Version 2.0 (the "License"); you may not use this file except in
10 * compliance with the License. You may obtain a copy of the License at:
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 * @class CAS/ProxyTicketException.php
23 * @category Authentication
25 * @author Adam Franco <afranco@middlebury.edu>
26 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
27 * @link https://wiki.jasig.org/display/CASC/phpCAS
32 * An Exception for errors related to fetching or validating proxy tickets.
34 * @class CAS_ProxyTicketException
35 * @category Authentication
37 * @author Adam Franco <afranco@middlebury.edu>
38 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
39 * @link https://wiki.jasig.org/display/CASC/phpCAS
41 class CAS_ProxyTicketException
42 extends BadMethodCallException
43 implements CAS_Exception
49 * @param string $message Message text
50 * @param int $code Error code
54 public function __construct ($message, $code = PHPCAS_SERVICE_PT_FAILURE)
56 // Warn if the code is not in our allowed list
58 PHPCAS_SERVICE_PT_FAILURE,
59 PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE,
60 PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE,
62 if (!in_array($code, $ptCodes)) {
63 trigger_error('Invalid code '.$code.' passed. Must be one of PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, or PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE.');
66 parent::__construct($message, $code);