TYPO3 CMS  TYPO3_7-6
OpenidExtractionUpdate.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
25  protected $title = 'Installs extension "openid" from TER if openid is used.';
26 
30  protected $extensionKey = 'openid';
31 
35  protected $extensionDetails = [
36  'openid' => [
37  'title' => 'OpenID authentication',
38  'description' => 'Adds OpenID authentication to TYPO3',
39  'versionString' => '7.6.4',
40  ]
41  ];
42 
49  public function checkForUpdate(&$description)
50  {
51  $updateNeeded = false;
52 
53  if (!$this->isWizardDone()) {
54  $columnsExists = false;
55 
56  $columns = $this->getDatabaseConnection()->admin_get_fields('fe_users');
57  if (isset($columns['tx_openid_openid'])) {
58  $columnsExists = true;
59  }
60  $columns = $this->getDatabaseConnection()->admin_get_fields('be_users');
61  if (isset($columns['tx_openid_openid'])) {
62  $columnsExists = true;
63  }
64  if ($columnsExists) {
65  $updateNeeded = true;
66  }
67  }
68 
69  $description = 'The extension "openid" (OpenID authentication) was extracted into '
70  . 'the TYPO3 Extension Repository. This update checks if openid id used and '
71  . 'downloads the TYPO3 Extension from the TER.';
72 
73  return $updateNeeded;
74  }
75 
83  public function performUpdate(array &$databaseQueries, &$customMessages)
84  {
85  $updateSuccessful = $this->installExtension($this->extensionKey, $customMessages);
86  if ($updateSuccessful) {
87  $this->markWizardAsDone();
88  }
89  return $updateSuccessful;
90  }
91 }
performUpdate(array &$databaseQueries, &$customMessages)