Commit | Line | Data |
---|---|---|
40d837df CW |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
fee14197 | 4 | | CiviCRM version 5 | |
40d837df | 5 | +--------------------------------------------------------------------+ |
6b83d5bd | 6 | | Copyright CiviCRM LLC (c) 2004-2019 | |
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 | +--------------------------------------------------------------------+ | |
d25dd0ee | 26 | */ |
40d837df CW |
27 | |
28 | /** | |
29 | * | |
30 | * @package CRM | |
6b83d5bd | 31 | * @copyright CiviCRM LLC (c) 2004-2019 |
40d837df CW |
32 | */ |
33 | ||
34 | /** | |
b8c71ffa | 35 | * Soap specific stuff goes here. |
40d837df CW |
36 | */ |
37 | class CRM_Utils_System_Soap extends CRM_Utils_System_Base { | |
38 | ||
39 | /** | |
fe482240 | 40 | * UF container variables. |
6714d8d2 | 41 | * @var string |
40d837df | 42 | */ |
6714d8d2 SL |
43 | public static $uf = NULL; |
44 | public static $ufClass = NULL; | |
40d837df | 45 | |
40d837df | 46 | /** |
100fef9d | 47 | * Given a permission string, check for access requirements |
40d837df | 48 | * |
77855840 TO |
49 | * @param string $str |
50 | * The permission to check. | |
40d837df | 51 | * |
d5cc0fc2 | 52 | * @return bool |
a6c01b45 | 53 | * true if yes, else false |
40d837df | 54 | */ |
00be9182 | 55 | public function checkPermission($str) { |
40d837df CW |
56 | return TRUE; |
57 | } | |
58 | ||
59 | /** | |
17f443df | 60 | * @inheritDoc |
40d837df | 61 | */ |
00be9182 | 62 | public function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL) { |
40d837df CW |
63 | if (isset(self::$ufClass)) { |
64 | $className = self::$ufClass; | |
65 | $url = $className::url($path, $query, $absolute, $fragment); | |
66 | return $url; | |
67 | } | |
68 | else { | |
69 | return NULL; | |
70 | } | |
71 | } | |
72 | ||
73 | /** | |
17f443df CW |
74 | * FIXME: Can this override be removed in favor of the parent? |
75 | * @inheritDoc | |
40d837df | 76 | */ |
00be9182 | 77 | public function postURL($action) { |
40d837df CW |
78 | return NULL; |
79 | } | |
80 | ||
81 | /** | |
fe482240 | 82 | * Set the email address of the user. |
40d837df | 83 | * |
77855840 TO |
84 | * @param object $user |
85 | * Handle to the user object. | |
40d837df | 86 | */ |
e7292422 TO |
87 | public function setEmail(&$user) { |
88 | } | |
40d837df CW |
89 | |
90 | /** | |
17f443df | 91 | * @inheritDoc |
40d837df | 92 | */ |
17f443df | 93 | public function authenticate($name, $pass) { |
40d837df CW |
94 | if (isset(self::$ufClass)) { |
95 | $className = self::$ufClass; | |
96 | $result =& $className::authenticate($name, $pass); | |
97 | return $result; | |
98 | } | |
99 | else { | |
100 | return NULL; | |
101 | } | |
102 | } | |
103 | ||
104 | /** | |
fe482240 | 105 | * Swap the current UF for soap. |
40d837df CW |
106 | */ |
107 | public function swapUF() { | |
108 | $config = CRM_Core_Config::singleton(); | |
109 | ||
110 | self::$uf = $config->userFramework; | |
111 | $config->userFramework = 'Soap'; | |
112 | ||
113 | self::$ufClass = $config->userFrameworkClass; | |
114 | $config->userFrameworkClass = 'CRM_Utils_System_Soap'; | |
115 | } | |
116 | ||
40d837df CW |
117 | /** |
118 | * Get user login URL for hosting CMS (method declared in each CMS system class) | |
119 | * | |
77855840 | 120 | * @param string $destination |
40d837df | 121 | * |
f4aaa82a | 122 | * @throws Exception |
40d837df CW |
123 | */ |
124 | public function getLoginURL($destination = '') { | |
125 | throw new Exception("Method not implemented: getLoginURL"); | |
126 | } | |
96025800 | 127 | |
be2fb01f | 128 | public function loadBootStrap($params = [], $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { |
9ba02e3e TO |
129 | // It makes zero sense for this class to extend CRM_Utils_System_Base. |
130 | throw new \RuntimeException("Not implemented"); | |
131 | } | |
132 | ||
40d837df | 133 | } |