Merge pull request #17209 from civicrm/5.25
[civicrm-core.git] / CRM / Admin / Page / Access.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Dashboard page for managing Access Control.
20 *
21 * For initial version, this page only contains static links - so this class is empty for now.
22 */
23 class CRM_Admin_Page_Access extends CRM_Core_Page {
24
25 /**
26 * @return string
27 */
28 public function run() {
29 $config = CRM_Core_Config::singleton();
30
31 switch ($config->userFramework) {
32 case 'Drupal':
33 $this->assign('ufAccessURL', url('admin/people/permissions'));
34 break;
35
36 case 'Drupal6':
37 $this->assign('ufAccessURL', url('admin/user/permissions'));
38 break;
39
40 case 'Joomla':
41 //condition based on Joomla version; <= 2.5 uses modal window; >= 3.0 uses full page with return value
42 if (version_compare(JVERSION, '3.0', 'lt')) {
43 JHTML::_('behavior.modal');
44 $url = $config->userFrameworkBaseURL . 'index.php?option=com_config&view=component&component=com_civicrm&tmpl=component';
45 $jparams = 'rel="{handler: \'iframe\', size: {x: 875, y: 550}, onClose: function() {}}" class="modal"';
46
47 $this->assign('ufAccessURL', $url);
48 $this->assign('jAccessParams', $jparams);
49 }
50 else {
51 $uri = (string) JUri::getInstance();
52 $return = urlencode(base64_encode($uri));
53 $url = $config->userFrameworkBaseURL . 'index.php?option=com_config&view=component&component=com_civicrm&return=' . $return;
54
55 $this->assign('ufAccessURL', $url);
56 $this->assign('jAccessParams', '');
57 }
58 break;
59
60 case 'WordPress':
61 $this->assign('ufAccessURL', CRM_Utils_System::url('civicrm/admin/access/wp-permissions', 'reset=1'));
62 break;
63 }
64 return parent::run();
65 }
66
67 }