Commit | Line | Data |
---|---|---|
40d837df CW |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
39de6fd5 | 4 | | CiviCRM version 4.6 | |
40d837df | 5 | +--------------------------------------------------------------------+ |
06b69b18 | 6 | | Copyright CiviCRM LLC (c) 2004-2014 | |
40d837df CW |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | ||
28 | /** | |
29 | * | |
30 | * @package CRM | |
06b69b18 | 31 | * @copyright CiviCRM LLC (c) 2004-2014 |
40d837df CW |
32 | * $Id$ |
33 | * | |
34 | */ | |
35 | ||
36 | /** | |
37 | * Soap specific stuff goes here | |
38 | */ | |
39 | class CRM_Utils_System_Soap extends CRM_Utils_System_Base { | |
40 | ||
41 | /** | |
42 | * UF container variables | |
43 | */ | |
44 | static $uf = NULL; | |
45 | static $ufClass = NULL; | |
46 | ||
47 | /** | |
100fef9d | 48 | * Sets the title of the page |
40d837df | 49 | * |
77855840 TO |
50 | * @param string $title |
51 | * Title for page. | |
f4aaa82a EM |
52 | * @param $pageTitle |
53 | * | |
40d837df CW |
54 | * @paqram string $pageTitle |
55 | * | |
56 | * @return void | |
40d837df | 57 | */ |
00be9182 | 58 | public function setTitle($title, $pageTitle) { |
40d837df CW |
59 | return; |
60 | } | |
61 | ||
62 | /** | |
100fef9d | 63 | * Given a permission string, check for access requirements |
40d837df | 64 | * |
77855840 TO |
65 | * @param string $str |
66 | * The permission to check. | |
40d837df CW |
67 | * |
68 | * @return boolean true if yes, else false | |
69 | * @static | |
40d837df | 70 | */ |
00be9182 | 71 | public function checkPermission($str) { |
40d837df CW |
72 | return TRUE; |
73 | } | |
74 | ||
75 | /** | |
76 | * Append an additional breadcrumb tag to the existing breadcrumb | |
77 | * | |
78 | * @param string $title | |
79 | * @param string $url | |
80 | * | |
81 | * @return void | |
40d837df | 82 | */ |
00be9182 | 83 | public function appendBreadCrumb($title, $url) { |
40d837df CW |
84 | return; |
85 | } | |
86 | ||
87 | /** | |
88 | * Append a string to the head of the html file | |
89 | * | |
77855840 TO |
90 | * @param string $head |
91 | * The new string to be appended. | |
40d837df CW |
92 | * |
93 | * @return void | |
40d837df | 94 | */ |
00be9182 | 95 | public function addHTMLHead($head) { |
40d837df CW |
96 | return; |
97 | } | |
98 | ||
99 | /** | |
100 | * Generate an internal CiviCRM URL | |
101 | * | |
77855840 TO |
102 | * @param $path |
103 | * String The path being linked to, such as "civicrm/add". | |
104 | * @param $query | |
105 | * String A query string to append to the link. | |
106 | * @param $absolute | |
107 | * Boolean Whether to force the output to be an absolute link (beginning with http:). | |
40d837df CW |
108 | * Useful for links that will be displayed outside the site, such as in an |
109 | * RSS feed. | |
77855840 TO |
110 | * @param $fragment |
111 | * String A fragment identifier (named anchor) to append to the link. | |
40d837df CW |
112 | * |
113 | * @return string an HTML string containing a link to the given path. | |
40d837df CW |
114 | * |
115 | */ | |
00be9182 | 116 | public function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL) { |
40d837df CW |
117 | if (isset(self::$ufClass)) { |
118 | $className = self::$ufClass; | |
119 | $url = $className::url($path, $query, $absolute, $fragment); | |
120 | return $url; | |
121 | } | |
122 | else { | |
123 | return NULL; | |
124 | } | |
125 | } | |
126 | ||
127 | /** | |
100fef9d | 128 | * Figure out the post url for the form |
40d837df CW |
129 | * |
130 | * @param the default action if one is pre-specified | |
131 | * | |
132 | * @return string the url to post the form | |
40d837df | 133 | */ |
00be9182 | 134 | public function postURL($action) { |
40d837df CW |
135 | return NULL; |
136 | } | |
137 | ||
138 | /** | |
100fef9d | 139 | * Set the email address of the user |
40d837df | 140 | * |
77855840 TO |
141 | * @param object $user |
142 | * Handle to the user object. | |
40d837df CW |
143 | * |
144 | * @return void | |
40d837df | 145 | */ |
e7292422 TO |
146 | public function setEmail(&$user) { |
147 | } | |
40d837df CW |
148 | |
149 | /** | |
150 | * Authenticate a user against the real UF | |
151 | * | |
77855840 TO |
152 | * @param string $name |
153 | * Login name. | |
154 | * @param string $pass | |
155 | * Login password. | |
40d837df CW |
156 | * |
157 | * @return array Result array | |
40d837df | 158 | */ |
00be9182 | 159 | public function &authenticate($name, $pass) { |
40d837df CW |
160 | if (isset(self::$ufClass)) { |
161 | $className = self::$ufClass; | |
162 | $result =& $className::authenticate($name, $pass); | |
163 | return $result; | |
164 | } | |
165 | else { | |
166 | return NULL; | |
167 | } | |
168 | } | |
169 | ||
170 | /** | |
171 | * Swap the current UF for soap | |
172 | * | |
40d837df CW |
173 | */ |
174 | public function swapUF() { | |
175 | $config = CRM_Core_Config::singleton(); | |
176 | ||
177 | self::$uf = $config->userFramework; | |
178 | $config->userFramework = 'Soap'; | |
179 | ||
180 | self::$ufClass = $config->userFrameworkClass; | |
181 | $config->userFrameworkClass = 'CRM_Utils_System_Soap'; | |
182 | } | |
183 | ||
184 | /** | |
185 | * Get the locale set in the hosting CMS | |
186 | * | |
187 | * @return null as the language is set elsewhere | |
188 | */ | |
00be9182 | 189 | public function getUFLocale() { |
40d837df CW |
190 | return NULL; |
191 | } | |
192 | ||
193 | /** | |
194 | * Get user login URL for hosting CMS (method declared in each CMS system class) | |
195 | * | |
77855840 TO |
196 | * @param string $destination |
197 | * If present, add destination to querystring (works for Drupal only). | |
40d837df | 198 | * |
f4aaa82a | 199 | * @throws Exception |
40d837df CW |
200 | * @return string - loginURL for the current CMS |
201 | * @static | |
202 | */ | |
203 | public function getLoginURL($destination = '') { | |
204 | throw new Exception("Method not implemented: getLoginURL"); | |
205 | } | |
206 | } |