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