INFRA-132 - CRM/ - PHPStorm cleanup
[civicrm-core.git] / CRM / Utils / System / Soap.php
CommitLineData
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 */
39class 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 67 *
a6c01b45
CW
68 * @return boolean
69 * true if yes, else false
40d837df 70 * @static
40d837df 71 */
00be9182 72 public function checkPermission($str) {
40d837df
CW
73 return TRUE;
74 }
75
76 /**
77 * Append an additional breadcrumb tag to the existing breadcrumb
78 *
79 * @param string $title
80 * @param string $url
81 *
82 * @return void
40d837df 83 */
00be9182 84 public function appendBreadCrumb($title, $url) {
40d837df
CW
85 return;
86 }
87
88 /**
89 * Append a string to the head of the html file
90 *
77855840
TO
91 * @param string $head
92 * The new string to be appended.
40d837df
CW
93 *
94 * @return void
40d837df 95 */
00be9182 96 public function addHTMLHead($head) {
40d837df
CW
97 return;
98 }
99
100 /**
101 * Generate an internal CiviCRM URL
102 *
5a4f6742
CW
103 * @param string $path
104 * The path being linked to, such as "civicrm/add".
105 * @param string $query
106 * A query string to append to the link.
107 * @param bool $absolute
108 * Whether to force the output to be an absolute link (beginning with http:).
40d837df
CW
109 * Useful for links that will be displayed outside the site, such as in an
110 * RSS feed.
5a4f6742
CW
111 * @param string $fragment
112 * A fragment identifier (named anchor) to append to the link.
40d837df 113 *
a6c01b45
CW
114 * @return string
115 * an HTML string containing a link to the given path.
40d837df 116 */
00be9182 117 public function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL) {
40d837df
CW
118 if (isset(self::$ufClass)) {
119 $className = self::$ufClass;
120 $url = $className::url($path, $query, $absolute, $fragment);
121 return $url;
122 }
123 else {
124 return NULL;
125 }
126 }
127
128 /**
100fef9d 129 * Figure out the post url for the form
40d837df
CW
130 *
131 * @param the default action if one is pre-specified
132 *
a6c01b45
CW
133 * @return string
134 * the url to post the form
40d837df 135 */
00be9182 136 public function postURL($action) {
40d837df
CW
137 return NULL;
138 }
139
140 /**
100fef9d 141 * Set the email address of the user
40d837df 142 *
77855840
TO
143 * @param object $user
144 * Handle to the user object.
40d837df
CW
145 *
146 * @return void
40d837df 147 */
e7292422
TO
148 public function setEmail(&$user) {
149 }
40d837df
CW
150
151 /**
152 * Authenticate a user against the real UF
153 *
77855840
TO
154 * @param string $name
155 * Login name.
156 * @param string $pass
157 * Login password.
40d837df 158 *
a6c01b45
CW
159 * @return array
160 * Result array
40d837df 161 */
00be9182 162 public function &authenticate($name, $pass) {
40d837df
CW
163 if (isset(self::$ufClass)) {
164 $className = self::$ufClass;
165 $result =& $className::authenticate($name, $pass);
166 return $result;
167 }
168 else {
169 return NULL;
170 }
171 }
172
173 /**
174 * Swap the current UF for soap
40d837df
CW
175 */
176 public function swapUF() {
177 $config = CRM_Core_Config::singleton();
178
179 self::$uf = $config->userFramework;
180 $config->userFramework = 'Soap';
181
182 self::$ufClass = $config->userFrameworkClass;
183 $config->userFrameworkClass = 'CRM_Utils_System_Soap';
184 }
185
186 /**
187 * Get the locale set in the hosting CMS
188 *
a6c01b45
CW
189 * @return null
190 * as the language is set elsewhere
40d837df 191 */
00be9182 192 public function getUFLocale() {
40d837df
CW
193 return NULL;
194 }
195
196 /**
197 * Get user login URL for hosting CMS (method declared in each CMS system class)
198 *
77855840
TO
199 * @param string $destination
200 * If present, add destination to querystring (works for Drupal only).
40d837df 201 *
f4aaa82a 202 * @throws Exception
a6c01b45
CW
203 * @return string
204 * loginURL for the current CMS
40d837df
CW
205 * @static
206 */
207 public function getLoginURL($destination = '') {
208 throw new Exception("Method not implemented: getLoginURL");
209 }
210}