Merge pull request #17867 from MegaphoneJon/mailing-70
[civicrm-core.git] / CRM / Utils / System / Soap.php
CommitLineData
40d837df
CW
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
40d837df 5 | |
bc77d7c0
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
40d837df 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
40d837df
CW
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
40d837df
CW
16 */
17
18/**
b8c71ffa 19 * Soap specific stuff goes here.
40d837df
CW
20 */
21class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
22
23 /**
fe482240 24 * UF container variables.
6714d8d2 25 * @var string
40d837df 26 */
6714d8d2
SL
27 public static $uf = NULL;
28 public static $ufClass = NULL;
40d837df 29
40d837df 30 /**
100fef9d 31 * Given a permission string, check for access requirements
40d837df 32 *
77855840
TO
33 * @param string $str
34 * The permission to check.
40d837df 35 *
d5cc0fc2 36 * @return bool
a6c01b45 37 * true if yes, else false
40d837df 38 */
00be9182 39 public function checkPermission($str) {
40d837df
CW
40 return TRUE;
41 }
42
43 /**
17f443df 44 * @inheritDoc
40d837df 45 */
8de2a34e 46 public function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL, $frontend = FALSE, $forceBackend = FALSE, $htmlize = TRUE) {
40d837df
CW
47 if (isset(self::$ufClass)) {
48 $className = self::$ufClass;
49 $url = $className::url($path, $query, $absolute, $fragment);
50 return $url;
51 }
52 else {
53 return NULL;
54 }
55 }
56
57 /**
17f443df
CW
58 * FIXME: Can this override be removed in favor of the parent?
59 * @inheritDoc
40d837df 60 */
00be9182 61 public function postURL($action) {
40d837df
CW
62 return NULL;
63 }
64
65 /**
fe482240 66 * Set the email address of the user.
40d837df 67 *
77855840
TO
68 * @param object $user
69 * Handle to the user object.
40d837df 70 */
e7292422
TO
71 public function setEmail(&$user) {
72 }
40d837df
CW
73
74 /**
17f443df 75 * @inheritDoc
40d837df 76 */
17f443df 77 public function authenticate($name, $pass) {
40d837df
CW
78 if (isset(self::$ufClass)) {
79 $className = self::$ufClass;
80 $result =& $className::authenticate($name, $pass);
81 return $result;
82 }
83 else {
84 return NULL;
85 }
86 }
87
88 /**
fe482240 89 * Swap the current UF for soap.
40d837df
CW
90 */
91 public function swapUF() {
92 $config = CRM_Core_Config::singleton();
93
94 self::$uf = $config->userFramework;
95 $config->userFramework = 'Soap';
96
97 self::$ufClass = $config->userFrameworkClass;
98 $config->userFrameworkClass = 'CRM_Utils_System_Soap';
99 }
100
40d837df
CW
101 /**
102 * Get user login URL for hosting CMS (method declared in each CMS system class)
103 *
77855840 104 * @param string $destination
40d837df 105 *
f4aaa82a 106 * @throws Exception
40d837df
CW
107 */
108 public function getLoginURL($destination = '') {
109 throw new Exception("Method not implemented: getLoginURL");
110 }
96025800 111
be2fb01f 112 public function loadBootStrap($params = [], $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) {
9ba02e3e
TO
113 // It makes zero sense for this class to extend CRM_Utils_System_Base.
114 throw new \RuntimeException("Not implemented");
115 }
116
40d837df 117}