Projet

Général

Profil

Paste
Télécharger (2,1 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ldap / ldap_authentication / ldap_authentication.install @ 91af538d

1
<?php
2

    
3
/**
4
 * @file
5
 * Install, update and uninstall functions for the LDAP authentication module.
6
 */
7

    
8
/**
9
 * Implements hook_requirements().
10
 */
11
function ldap_authentication_requirements($phase) {
12

    
13
  $requirements = [];
14
  if ($phase != "install" && db_table_exists('ldapauth')) {
15
    $requirements['ldap_authentication_ldap_integration']['title'] = t('LDAP Integration LDAP Auth Upgrade Concern');
16
    $requirements['ldap_authentication_ldap_integration']['severity'] = REQUIREMENT_WARNING;
17
    $requirements['ldap_authentication_ldap_integration']['value'] = NULL;
18
    $requirements['ldap_authentication_ldap_integration']['description'] = t('Upgrade from Drupal 6 LDAP Auth to Drupal 7
19
      LDAP Authentication is not automatic.  LDAP Authentication will need to be configured by hand.
20
      Some harmless data will remain in the user.data field in the user table.  Records in
21
      the authmap table will cause conflicts and should be removed or changed to ldap_authentication
22
      as the module (see http://drupal.org/node/1183192).
23
      See http://drupal.org/node/1023016, http://drupal.org/node/1183192.
24
      This message will go away when the ldapauth database table is removed.');
25
  }
26
  return $requirements;
27
}
28

    
29
/**
30
 * Implements hook_install().
31
 */
32
function ldap_authentication_install() {
33
}
34

    
35
/**
36
 * Implements hook_uninstall().
37
 */
38
function ldap_authentication_uninstall() {
39
  variable_del('ldap_authentication_conf');
40
}
41

    
42
/**
43
 * Ldap_authentication and ldap_sso.  enable ldap_sso if sso was enabled in ldap_authentication previously.
44
 */
45
function ldap_authentication_update_7100() {
46
  // If sso is enabled in ldap authentication, enable module ldap_sso.
47
  module_load_include('inc', 'ldap_servers', 'ldap_servers.functions');
48
  ldap_servers_module_load_include('php', 'ldap_authentication', 'LdapAuthenticationConfAdmin.class');
49
  $sso_enabled = LdapAuthenticationConfAdmin::getSaveableProperty('ssoEnabled');
50
  if ($sso_enabled) {
51
    module_enable(['ldap_sso']);
52
    return t('Enabled new LDAP SSO module if Single Sign on was previously enabled.  Code for LDAP Single Sign On was moved to new "LDAP SSO" included module.');
53
  }
54
}