00001 <?php 00002 /* 00003 * Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative. 00004 * All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions are met: 00008 * 00009 * * Redistributions of source code must retain the above copyright notice, 00010 * this list of conditions and the following disclaimer. 00011 * * Redistributions in binary form must reproduce the above copyright notice, 00012 * this list of conditions and the following disclaimer in the documentation 00013 * and/or other materials provided with the distribution. 00014 * * Neither the name of the ESUP-Portail consortium & the JA-SIG 00015 * Collaborative nor the names of its contributors may be used to endorse or 00016 * promote products derived from this software without specific prior 00017 * written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00020 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00021 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00022 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 00023 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00026 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00028 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00029 */ 00030 00031 require_once(dirname(__FILE__).'/Exception.php'); 00032 00036 class CAS_ProxyTicketException 00037 extends BadMethodCallException 00038 implements CAS_Exception 00039 { 00040 00049 public function __construct ($message, $code = PHPCAS_SERVICE_PT_FAILURE) { 00050 // Warn if the code is not in our allowed list 00051 $ptCodes = array( 00052 PHPCAS_SERVICE_PT_FAILURE, 00053 PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, 00054 PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, 00055 ); 00056 if (!in_array($code, $ptCodes)) { 00057 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.'); 00058 } 00059 00060 parent::__construct($message, $code); 00061 } 00062 }