Merge pull request #15523 from jamie-tillman/patch-1
[civicrm-core.git] / CRM / Contact / Page / Inline / OpenID.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 * Dummy page for details for OpenID.
20 */
21 class CRM_Contact_Page_Inline_OpenID extends CRM_Core_Page {
22
23 /**
24 * Run the page.
25 *
26 * This method is called after the page is created.
27 */
28 public function run() {
29 // get the emails for this contact
30 $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
31
32 $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', ['labelColumn' => 'display_name']);
33
34 $entityBlock = ['contact_id' => $contactId];
35 $openids = CRM_Core_BAO_OpenID::getValues($entityBlock);
36 if (!empty($openids)) {
37 foreach ($openids as $key => & $value) {
38 $value['location_type'] = $locationTypes[$value['location_type_id']];
39 }
40 }
41
42 $this->assign('contactId', $contactId);
43 $this->assign('openid', $openids);
44
45 // check logged in user permission
46 CRM_Contact_Page_View::checkUserPermission($this, $contactId);
47
48 // finally call parent
49 parent::run();
50 }
51
52 }