Extension.php
4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_OpenId
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Extension.php 23775 2011-03-01 17:25:24Z ralph $
*/
/**
* Abstract extension class for Zend_OpenId
*
* @category Zend
* @package Zend_OpenId
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_OpenId_Extension
{
/**
* Calls given function with given argument for all extensions
*
* @param mixed $extensions list of extensions or one extension
* @param string $func function to be called
* @param mixed &$params argument to pass to given funcion
* @return bool
*/
static public function forAll($extensions, $func, &$params)
{
if ($extensions !== null) {
if (is_array($extensions)) {
foreach ($extensions as $ext) {
if ($ext instanceof Zend_OpenId_Extension) {
if (!$ext->$func($params)) {
return false;
}
} else {
return false;
}
}
} else if (!is_object($extensions) ||
!($extensions instanceof Zend_OpenId_Extension) ||
!$extensions->$func($params)) {
return false;
}
}
return true;
}
/**
* Method to add additional data to OpenId 'checkid_immediate' or
* 'checkid_setup' request. This method addes nothing but inherited class
* may add additional data into request.
*
* @param array &$params request's var/val pairs
* @return bool
*/
public function prepareRequest(&$params)
{
return true;
}
/**
* Method to parse OpenId 'checkid_immediate' or 'checkid_setup' request
* and initialize object with passed data. This method parses nothing but
* inherited class may override this method to do somthing.
*
* @param array $params request's var/val pairs
* @return bool
*/
public function parseRequest($params)
{
return true;
}
/**
* Method to add additional data to OpenId 'id_res' response. This method
* addes nothing but inherited class may add additional data into response.
*
* @param array &$params response's var/val pairs
* @return bool
*/
public function prepareResponse(&$params)
{
return true;
}
/**
* Method to parse OpenId 'id_res' response and initialize object with
* passed data. This method parses nothing but inherited class may override
* this method to do somthing.
*
* @param array $params response's var/val pairs
* @return bool
*/
public function parseResponse($params)
{
return true;
}
/**
* Method to prepare data to store it in trusted servers database.
*
* @param array &$data data to be stored in tusted servers database
* @return bool
*/
public function getTrustData(&$data)
{
return true;
}
/**
* Method to check if data from trusted servers database is enough to
* sutisfy request.
*
* @param array $data data from tusted servers database
* @return bool
*/
public function checkTrustData($data)
{
return true;
}
}