3 * Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
\r
4 * All rights reserved.
\r
6 * Redistribution and use in source and binary forms, with or without
\r
7 * modification, are permitted provided that the following conditions are met:
\r
9 * * Redistributions of source code must retain the above copyright notice,
\r
10 * this list of conditions and the following disclaimer.
\r
11 * * Redistributions in binary form must reproduce the above copyright notice,
\r
12 * this list of conditions and the following disclaimer in the documentation
\r
13 * and/or other materials provided with the distribution.
\r
14 * * Neither the name of the ESUP-Portail consortium & the JA-SIG
\r
15 * Collaborative nor the names of its contributors may be used to endorse or
\r
16 * promote products derived from this software without specific prior
\r
17 * written permission.
\r
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
\r
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
\r
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
\r
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
\r
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
\r
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
\r
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
\r
26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
\r
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
\r
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
31 * @file CAS/PGTStorage/pgt-main.php
\r
32 * Basic class for PGT storage
\r
37 * The PGTStorage class is a generic class for PGT storage. This class should
\r
38 * not be instanciated itself but inherited by specific PGT storage classes.
\r
40 * @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
\r
42 * @ingroup internalPGTStorage
\r
48 * @addtogroup internalPGTStorage
\r
52 // ########################################################################
\r
54 // ########################################################################
\r
57 * The constructor of the class, should be called only by inherited classes.
\r
59 * @param $cas_parent the CASclient instance that creates the current object.
\r
63 function PGTStorage($cas_parent)
\r
65 phpCAS::traceBegin();
\r
66 if ( !$cas_parent->isProxy() ) {
\r
67 phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
\r
72 // ########################################################################
\r
74 // ########################################################################
\r
77 * This virtual method returns an informational string giving the type of storage
\r
78 * used by the object (used for debugging purposes).
\r
82 function getStorageType()
\r
84 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
\r
88 * This virtual method returns an informational string giving informations on the
\r
89 * parameters of the storage.(used for debugging purposes).
\r
93 function getStorageInfo()
\r
95 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
\r
98 // ########################################################################
\r
100 // ########################################################################
\r
103 * string used to store an error message. Written by PGTStorage::setErrorMessage(),
\r
104 * read by PGTStorage::getErrorMessage().
\r
108 * @deprecated not used.
\r
110 var $_error_message=FALSE;
\r
113 * This method sets en error message, which can be read later by
\r
114 * PGTStorage::getErrorMessage().
\r
116 * @param $error_message an error message
\r
119 * @deprecated not used.
\r
121 function setErrorMessage($error_message)
\r
123 $this->_error_message = $error_message;
\r
127 * This method returns an error message set by PGTStorage::setErrorMessage().
\r
129 * @return an error message when set by PGTStorage::setErrorMessage(), FALSE
\r
133 * @deprecated not used.
\r
135 function getErrorMessage()
\r
137 return $this->_error_message;
\r
140 // ########################################################################
\r
142 // ########################################################################
\r
145 * a boolean telling if the storage has already been initialized. Written by
\r
146 * PGTStorage::init(), read by PGTStorage::isInitialized().
\r
151 var $_initialized = FALSE;
\r
154 * This method tells if the storage has already been intialized.
\r
156 * @return a boolean
\r
160 function isInitialized()
\r
162 return $this->_initialized;
\r
166 * This virtual method initializes the object.
\r
172 $this->_initialized = TRUE;
\r
175 // ########################################################################
\r
177 // ########################################################################
\r
180 * This virtual method stores a PGT and its corresponding PGT Iuo.
\r
181 * @note Should never be called.
\r
183 * @param $pgt the PGT
\r
184 * @param $pgt_iou the PGT iou
\r
188 function write($pgt,$pgt_iou)
\r
190 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
\r
194 * This virtual method reads a PGT corresponding to a PGT Iou and deletes
\r
195 * the corresponding storage entry.
\r
196 * @note Should never be called.
\r
198 * @param $pgt_iou the PGT iou
\r
202 function read($pgt_iou)
\r
204 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
\r
211 // include specific PGT storage classes
\r
212 include_once(dirname(__FILE__).'/pgt-file.php');
\r