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