Projet

Général

Profil

Révision 5136ce55

Ajouté par Assos Assos il y a plus de 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.inc
121 121
/**
122 122
 * Replaces the email address in $ldap_user with one from the template in
123 123
 * $auth_conf.
124
 * 
124
 *
125 125
 * @param array $ldap_user
126 126
 *   LDAP user entry
127 127
 * @param LdapAuthenticationConf $auth_conf
......
156 156

  
157 157
  // Default to name
158 158
  $entered_name = $form_state['values']['name'];
159
  $authname_drupal_property = 'name';
159
  $authname_drupal_property = $form_field_name = 'name';
160 160

  
161 161
  // Email registration module populates name even though user entered email
162 162
  if (!empty($form_state['values']['email'])) {
163 163
    $entered_name = $form_state['values']['email'];
164 164
    $authname_drupal_property = 'mail';
165
    $form_field_name = 'email';
165 166
  }
166 167

  
167 168
  // $authname is the name the user is authenticated with from the logon form // patch 1599632
168 169
  $authname = $entered_name;
169 170

  
171
  if (empty($form_state['values']['pass']) || empty ($form_state['values'][$form_field_name])) {
172
    return FALSE;
173
  }
170 174
  /*
171 175
   * If a fake form state was passed into this function from
172 176
   * _ldap_authentication_user_login_sso(), there will be a value outside of the
......
266 270
  $email_template_tokens = array(
267 271
    '@username' => $drupal_accountname,
268 272
  );
269
  
273

  
270 274
  $email_template_used = FALSE;
271
  
275

  
272 276
  /**
273 277
   * Ensures that we respect the email template handling settings.
274 278
   */
......
288 292
        break;
289 293
    }
290 294
  }
291
  
295

  
292 296
  /**
293 297
   * VI. Find or create corresponding drupal account and set authmaps
294 298
   *
......
354 358
   * VI.C: existing Drupal account with incorrect email.  fix email if appropriate
355 359
   *
356 360
   */
357
  if ((!($auth_conf->templateUsageNeverUpdate && $email_template_used)) && 
358
      $drupal_account_exists && 
359
      $drupal_account->mail != $ldap_user['mail'] && 
361
  if ((!($auth_conf->templateUsageNeverUpdate && $email_template_used)) &&
362
      $drupal_account_exists &&
363
      $drupal_account->mail != $ldap_user['mail'] &&
360 364
      (
361 365
        $auth_conf->emailUpdate == LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE_NOTIFY ||
362 366
        $auth_conf->emailUpdate == LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE
......
448 452
    else {
449 453
      $user_edit = array('name' => $drupal_accountname, 'status' => 1);
450 454
    }
451
    
455

  
452 456
    // If the email template was used, we want to pass in the email that was
453 457
    // generated so that its not overridden by the provisioner.
454 458
    if ($email_template_used) {
drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.info
14 14
files[] = ldap_authentication.admin.inc
15 15
files[] = tests/ldap_authentication.test
16 16

  
17
; Information added by Drupal.org packaging script on 2014-01-08
18
version = "7.x-2.0-beta8"
17
; Information added by Drupal.org packaging script on 2016-08-07
18
version = "7.x-2.0-beta11"
19 19
core = "7.x"
20 20
project = "ldap"
21
datestamp = "1389150511"
21
datestamp = "1470608343"
22 22

  
drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.module
220 220
 */
221 221
function ldap_authentication_init() {
222 222
  $auth_conf = ldap_authentication_get_valid_conf();
223
  if ($auth_conf->templateUsagePromptUser) {
223
  if ($auth_conf && $auth_conf->templateUsagePromptUser) {
224 224
    ldap_authentication_check_for_email_template();
225 225
  }
226 226
}
......
342 342

  
343 343
  if ($user->uid == 0) {
344 344
    // hide reset password for anonymous users if ldap only authentication and password updates are disabled, otherwise show
345
    if ($auth_conf->authenticationMode != LDAP_AUTHENTICATION_EXCLUSIVE) {
345
    if ($auth_conf->authenticationMode == LDAP_AUTHENTICATION_EXCLUSIVE) {
346 346
      if ($auth_conf->passwordOption == LDAP_AUTHENTICATION_PASSWORD_FIELD_ALLOW) {
347 347
        return TRUE;
348 348
      }
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.info
18 18
files[] = tests/Og2Tests.test
19 19
configure = admin/config/people/ldap/authorization
20 20

  
21
; Information added by Drupal.org packaging script on 2014-01-08
22
version = "7.x-2.0-beta8"
21
; Information added by Drupal.org packaging script on 2016-08-07
22
version = "7.x-2.0-beta11"
23 23
core = "7.x"
24 24
project = "ldap"
25
datestamp = "1389150511"
25
datestamp = "1470608343"
26 26

  
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_drupal_role/ldap_authorization_drupal_role.info
9 9
files[] = ldap_authorization_drupal_role.module
10 10
files[] = ldap_authorization_drupal_role.inc
11 11

  
12
; Information added by Drupal.org packaging script on 2014-01-08
13
version = "7.x-2.0-beta8"
12
; Information added by Drupal.org packaging script on 2016-08-07
13
version = "7.x-2.0-beta11"
14 14
core = "7.x"
15 15
project = "ldap"
16
datestamp = "1389150511"
16
datestamp = "1470608343"
17 17

  
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php
583 583
      $this->og2Revokes($og_actions, $user, $user_auth_data); 
584 584
    }
585 585

  
586
    $user_edit = array('data' => $user->data);
586 587
    $user_edit['data']['ldap_authorizations'][$this->consumerType] = $user_auth_data;
587 588
    $user = user_save($user, $user_edit);
588 589
    $user_auth_data = $user->data['ldap_authorizations'][$this->consumerType];  // reset this variable because user save hooks can impact it.
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/ldap_authorization_og.info
13 13

  
14 14
core = "7.x"
15 15

  
16
; Information added by Drupal.org packaging script on 2014-01-08
17
version = "7.x-2.0-beta8"
16
; Information added by Drupal.org packaging script on 2016-08-07
17
version = "7.x-2.0-beta11"
18 18
core = "7.x"
19 19
project = "ldap"
20
datestamp = "1389150511"
20
datestamp = "1470608343"
21 21

  
drupal7/sites/all/modules/ldap/ldap_authorization/tests/Og2Tests.test
10 10
 *  - logon and make sure memberships revoked
11 11
 */
12 12

  
13
drupal_load('module', 'ldap_test');
13 14
module_load_include('php', 'ldap_test', 'LdapTestCase.class');
14 15
require_once(drupal_get_path('module', 'ldap_authorization_og') . '/LdapAuthorizationConsumerOG.class.php');
15 16

  
drupal7/sites/all/modules/ldap/ldap_feeds/FeedsLdapEntryParser.inc
34 34
          if ($ldap_attributes[$source_lcase]['count'] == 1 && is_scalar($ldap_attributes[$source_lcase][0])) {
35 35
            $parsed_item[$source] = (string)$ldap_attributes[$source_lcase][0];
36 36
          }
37
          else {
38
            unset($ldap_attributes[$source_lcase]['count']);
39
            $parsed_item[$source] = $ldap_attributes[$source_lcase];
40
          }
37 41
        }
38 42
        else {
39 43
          $parsed_item[$source] = '';
drupal7/sites/all/modules/ldap/ldap_feeds/ldap_feeds.info
12 12
core = 7.x
13 13
php = 5.2
14 14

  
15
; Information added by Drupal.org packaging script on 2014-01-08
16
version = "7.x-2.0-beta8"
15
; Information added by Drupal.org packaging script on 2016-08-07
16
version = "7.x-2.0-beta11"
17 17
core = "7.x"
18 18
project = "ldap"
19
datestamp = "1389150511"
19
datestamp = "1470608343"
20 20

  
drupal7/sites/all/modules/ldap/ldap_help/ldap_help.info
5 5

  
6 6
dependencies[] = ldap_servers
7 7
dependencies[] = ldap_test
8
; Information added by Drupal.org packaging script on 2014-01-08
9
version = "7.x-2.0-beta8"
8
; Information added by Drupal.org packaging script on 2016-08-07
9
version = "7.x-2.0-beta11"
10 10
core = "7.x"
11 11
project = "ldap"
12
datestamp = "1389150511"
12
datestamp = "1470608343"
13 13

  
drupal7/sites/all/modules/ldap/ldap_query/ldap_query.info
17 17

  
18 18
configure = admin/config/people/ldap/query
19 19

  
20
; Information added by Drupal.org packaging script on 2014-01-08
21
version = "7.x-2.0-beta8"
20
; Information added by Drupal.org packaging script on 2016-08-07
21
version = "7.x-2.0-beta11"
22 22
core = "7.x"
23 23
project = "ldap"
24
datestamp = "1389150511"
24
datestamp = "1470608343"
25 25

  
drupal7/sites/all/modules/ldap/ldap_servers/LdapServer.class.php
234 234
    }
235 235

  
236 236
    if ($bindpw) {
237
      $this->bindpw = ldap_servers_decrypt($bindpw);
237
      $this->bindpw = ($bindpw == '') ? '' : ldap_servers_decrypt($bindpw);
238 238
    }
239 239

  
240 240
    $this->paginationEnabled = (boolean)(ldap_servers_php_supports_pagination() && $this->searchPagination);
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.functions.inc
379 379
    */
380 380

  
381 381
    function ldap_pear_hex2asc($string) {
382

  
383
      if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
382 384
        $string = preg_replace_callback(
383 385
          "/\\\([0-9A-Fa-f]{2})/",
384 386
          function ($m){
385 387
            return chr(hexdec($m[1]));
386 388
          },
387 389
          $string);
390
      }
391
      else {
392
        $string = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $string);
393
      }
388 394

  
389
        return $string;
395
      return $string;
390 396
    }
391 397

  
392 398
    /**
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.info
9 9
files[] = ldap_servers.admin.inc
10 10
files[] = ldap_servers.encryption.inc
11 11
files[] = ldap_servers.functions.inc
12
files[] = ldap_servers.inc
13 12
files[] = ldap_servers.install
14 13
files[] = ldap_servers.module
15 14
files[] = ldap_servers.settings.inc
......
18 17
files[] = tests/ldap_servers.test
19 18
configure = admin/config/people/ldap/servers
20 19

  
21
; Information added by Drupal.org packaging script on 2014-01-08
22
version = "7.x-2.0-beta8"
20
; Information added by Drupal.org packaging script on 2016-08-07
21
version = "7.x-2.0-beta11"
23 22
core = "7.x"
24 23
project = "ldap"
25
datestamp = "1389150511"
24
datestamp = "1470608343"
26 25

  
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.install
28 28
 */
29 29
function ldap_servers_requirements($phase) {
30 30
  $requirements = array();
31
  $t = get_t();
31 32

  
32 33
  if ($phase == 'install') {
33 34
    $requirements['ldap_extension_loaded']['title'] = t('LDAP Extension Loaded');
......
55 56
      See http://drupal.org/node/1023016. This message will go away when the ldapauth database table is removed.');
56 57
  }
57 58
  // check that ldapauth not installed.
59

  
60
  // Check enabled LDAP servers are configured and Drupal can connect to them.
61
  if ($phase == 'runtime') {
62
    $requirements['ldap_servers_enabled'] = array(
63
      'title' => $t('LDAP Server status'),
64
      'value' =>  $t('Disabled'),
65
      'severity' => REQUIREMENT_WARNING,
66
    );
67

  
68
    $servers = ldap_servers_get_servers(NULL, 'enabled');
69
    if (!empty($servers)) {
70
      unset($requirements['ldap_servers_enabled']);
71

  
72
      foreach ($servers as $server) {
73
        $server_req_key = 'ldap_servers_sid_' . $server->sid;
74
        $server_tokens = array(
75
          '@host' => $server->address,
76
          '@sid' => $server->sid,
77
        );
78
        $requirements[$server_req_key] = array(
79
          'title' => $t('LDAP Server status: @sid (@host)', $server_tokens),
80
          'value' =>  $t('Connection: Failed, check logs for details.', $server_tokens),
81
          'severity' => REQUIREMENT_ERROR,
82
        );
83

  
84
        try {
85
          $connect_result = $server->connect();
86
          if ($connect_result == LDAP_SUCCESS) {
87
            $bind_result = $server->bind();
88
            if ($bind_result == LDAP_SUCCESS) {
89
              $requirements[$server_req_key]['value'] = $t('Connection: Success, Bind: Success', $server_tokens);
90
              $requirements[$server_req_key]['severity'] = REQUIREMENT_OK;
91
            }
92
          }
93
          $server->disconnect();
94
        }
95
        catch (Exception $e) {
96
        }
97
      }
98
    }
99
  }
100

  
58 101
  return $requirements;
59 102
}
60 103

  
......
287 330

  
288 331

  
289 332
function ldap_servers_db_field_exists($table, $field_name) {
290
  if (!ldap_servers_db_field_exists($table, $field_name) && !ldap_servers_db_field_exists($table, drupal_strtolower($field_name)) ) {
333
  if (!db_field_exists($table, $field_name) && !db_field_exists($table, drupal_strtolower($field_name)) ) {
291 334
    return false;
292 335
  }
293 336
  else {
......
300 343
function ldap_servers_update_7108() {
301 344

  
302 345
  foreach (array('groupFunctionalityUnused', 'groupNested', 'groupSearchAll', 'groupUserMembershipsAttrExists', 'groupDeriveFromDn', 'groupUserMembershipsAttrExists') as $tinyint_field_name) {
303
    if (!ldap_servers_ldap_servers_db_field_exists('ldap_servers', $tinyint_field_name))  {
346
    if (!ldap_servers_db_field_exists('ldap_servers', $tinyint_field_name))  {
304 347
      db_add_field('ldap_servers', $tinyint_field_name, array(
305 348
        'type' => 'int',
306 349
        'size' => 'tiny',
......
796 839
}
797 840

  
798 841

  
799

  
800 842
/**
801 843
 * Add LDAP Referrals fields in schema
802 844
 */
803 845
function ldap_servers_update_7206() {
804
  db_add_field(
805
    'ldap_servers',
806
    'followrefs',
807
    array(
808
      'type' => 'int',
809
      'size' => 'tiny',
810
      'not null' => FALSE,
811
      'default' => 0,
812
    )
813
  );
846
  if (!ldap_servers_db_field_exists('ldap_servers', 'followrefs')) {
847
    db_add_field(
848
      'ldap_servers',
849
      'followrefs',
850
      array(
851
        'type' => 'int',
852
        'size' => 'tiny',
853
        'not null' => FALSE,
854
        'default' => 0,
855
      )
856
    );
857
  }
814 858
}
815 859

  
816 860
function ldap_servers_install_update_schema($schema, &$change_log) {
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.module
32 32
define('LDAP_SERVERS_ENC_TYPE_SALTED_SHA', 9);
33 33
define('LDAP_SERVERS_ENC_TYPE_CLEARTEXT', 10);
34 34

  
35
define('LDAP_SERVERS_CYPHER_MODE', 'cfb', 12);
35
define('LDAP_SERVERS_CYPHER_MODE', 'cfb');
36 36

  
37 37
define('LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT', 1);
38 38
define('LDAP_SERVERS_BIND_METHOD_USER', 2);
......
93 93

  
94 94
define('LDAP_IS_LEAF', 0x23);
95 95
define('LDAP_ALIAS_DEREF_PROBLEM', 0x24);
96
if ( ! defined('LDAP_DEREF_NEVER') )
97
  define('LDAP_DEREF_NEVER', 0x25);
96 98

  
97 99
define('LDAP_INAPPROPRIATE_AUTH', 0x30);
98 100
define('LDAP_INVALID_CREDENTIALS', 0x31);
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.settings.inc
71 71
    if ($new_encyption != $old_encyption) {
72 72
      $servers = db_query("SELECT sid, bindpw FROM {ldap_servers} WHERE bindpw is not NULL AND bindpw <> ''")->fetchAllAssoc('sid');
73 73
      foreach ($servers as $sid => $server) {
74
        $decrypted_bind_pwd = ldap_servers_decrypt($server->bindpw, $old_encyption);
75
        $rencrypted = ldap_servers_encrypt($decrypted_bind_pwd, $new_encyption);
74
        if ($server->bindpw != '') {
75
          $decrypted_bind_pwd = ldap_servers_decrypt($server->bindpw, $old_encyption);
76
          $rencrypted = ldap_servers_encrypt($decrypted_bind_pwd, $new_encyption);
77
        }
78
        else {
79
          $rencrypted = '';
80
        }
76 81
        db_query("UPDATE {ldap_servers} SET bindpw = :bindpw WHERE sid = :sid", array(':bindpw' => $rencrypted, ':sid' => $sid));
77 82
      }
78 83
    }
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.test_form.inc
330 330
      $results_tables['groupfromDN'][] = array("Groups from DN", theme('item_list', array('items' => $groups_from_dn, 'type' => 'ul')));
331 331
    }
332 332

  
333
    list($has_errors, $more_results, $ldap_user) = ldap_servers_test_user_mapping($values['testing_drupal_username'], $ldap_server);
333
  }
334 334

  
335
    $tokens = ($ldap_user && isset($ldap_user['attr'])) ? ldap_servers_token_tokenize_entry($ldap_user['attr'], 'all') : array();
336
    foreach ($tokens as $key => $value) {
337
      $results_tables['tokens'][] = array($key, $value);
338
    }
339
    $form_state['ldap_server_test_data'] = array(
340
      'username' => $values['testing_drupal_username'],
341
      'group_entry' => $group_entry,
342
      'results_tables' => $results_tables,
343
    );
344
    if (isset($ldap_user)) {
345
      $form_state['ldap_server_test_data']['ldap_user'] = $ldap_user;
346
    }
335
  list($has_errors, $more_results, $ldap_user) = ldap_servers_test_user_mapping($values['testing_drupal_username'], $ldap_server);
336

  
337
  $tokens = ($ldap_user && isset($ldap_user['attr'])) ? ldap_servers_token_tokenize_entry($ldap_user['attr'], 'all') : array();
338
  foreach ($tokens as $key => $value) {
339
    $results_tables['tokens'][] = array($key, $value);
340
  }
341
  $form_state['ldap_server_test_data'] = array(
342
    'username' => $values['testing_drupal_username'],
343
    'results_tables' => $results_tables,
344
  );
345

  
346
  if (isset($ldap_user)) {
347
    $form_state['ldap_server_test_data']['ldap_user'] = $ldap_user;
348
  }
349

  
350
  if ( isset($group_entry) ) {
351
    $form_state['ldap_server_test_data']['group_entry'] = $group_entry;
347 352
  }
353
  
348 354
}
349 355

  
350 356
/**
drupal7/sites/all/modules/ldap/ldap_servers/ldap_types/LdapTypeOpenLdap.class.php
1
  <?php
1
<?php
2 2

  
3 3
/**
4 4
 * @file
drupal7/sites/all/modules/ldap/ldap_sso/ldap_sso.info
6 6
core = 7.x
7 7
configure = admin/config/people/ldap/authentication
8 8

  
9
; Information added by Drupal.org packaging script on 2014-01-08
10
version = "7.x-2.0-beta8"
9
; Information added by Drupal.org packaging script on 2016-08-07
10
version = "7.x-2.0-beta11"
11 11
core = "7.x"
12 12
project = "ldap"
13
datestamp = "1389150511"
13
datestamp = "1470608343"
14 14

  
drupal7/sites/all/modules/ldap/ldap_sso/ldap_sso.module
66 66
        }
67 67

  
68 68
        require_once DRUPAL_ROOT . '/includes/common.inc';
69
        require_once DRUPAL_ROOT . '/includes/path.inc';
69
        require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc');
70 70
        $ldap_authentication_conf = variable_get('ldap_authentication_conf', array());
71 71

  
72 72
        if (isset($ldap_authentication_conf['seamlessLogin']) && $ldap_authentication_conf['seamlessLogin'] == 1 && ($login_attempted != 'true')) {
......
286 286
    global $user;
287 287
    $user = ldap_authentication_user_login_authenticate_validate(array(), $fake_form_state, TRUE);
288 288

  
289
    // Reload the account to ensure we have a fully populated user object.
290
    $user = user_load($user->uid);
291 289

  
292 290
    if ($detailed_watchdog_log) {
293 291
      $watchdog_tokens['!uid'] = is_object($user) ? $user->uid : NULL;
......
295 293
    }
296 294

  
297 295
    if ($user && $user->uid > 0) {
296
      // Reload the account to ensure we have a fully populated user object.
297
      $user = user_load($user->uid);
298

  
298 299
      if ($auth_conf->seamlessLogin == 1) {
299 300
        if ($detailed_watchdog_log) {
300 301
          watchdog('ldap_authentication', 'ldap_sso_user_login_sso.remote_user.user_success.seamlessLogin', $watchdog_tokens, WATCHDOG_DEBUG);
drupal7/sites/all/modules/ldap/ldap_test/ldap_test.info
18 18
files[] = LdapTestFunctions.class.php
19 19
files[] = LdapUserTestCase.class.php
20 20

  
21
; Information added by Drupal.org packaging script on 2014-01-08
22
version = "7.x-2.0-beta8"
21
; Information added by Drupal.org packaging script on 2016-08-07
22
version = "7.x-2.0-beta11"
23 23
core = "7.x"
24 24
project = "ldap"
25
datestamp = "1389150511"
25
datestamp = "1470608343"
26 26

  
drupal7/sites/all/modules/ldap/ldap_user/LdapUserConf.class.php
606 606
        if (!$ldap_user_prov_entry_exists) {
607 607
          $user_entity->ldap_user_prov_entries['und'][] = array(
608 608
            'value' =>  $ldap_user_prov_entry,
609
            'format' => NULL,
610
            'save_value' => $ldap_user_prov_entry,
611 609
          );
612
          $edit = array(
613
            'ldap_user_prov_entries' => $user_entity->ldap_user_prov_entries,
614
          );
615
          $account = user_load($account->uid);
616
          $account = user_save($account, $edit);
610

  
611
          // Save the field without calling user_save()
612
          field_attach_presave('user', $user_entity);
613
          field_attach_update('user', $user_entity);
617 614
        }
618 615

  
619 616
      }
drupal7/sites/all/modules/ldap/ldap_user/LdapUserConfAdmin.class.php
288 288
    );
289 289
*/
290 290

  
291
    $form['server_mapping_preamble'] = array(
291
    $form['basic_to_drupal']['server_mapping_preamble'] = array(
292 292
      '#type' => 'markup',
293 293
      '#markup' => t('
294 294
The relationship between a Drupal user and an LDAP entry is defined within the LDAP server configurations.
......
300 300
mappings need to be setup for each server.  If no tables are listed below, you have not enabled any provisioning servers at
301 301
the top of this form.
302 302
'),
303

  
304 303
    );
305 304

  
306 305
    foreach (array(LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER, LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY) as $direction) {
drupal7/sites/all/modules/ldap/ldap_user/ldap_user.cron.inc
134 134
            'ldap server %sid had error while querying to
135 135
            deal with orphaned ldap user entries.  Please check that the ldap
136 136
            server is configured correctly.  Query; %query',
137
            array('%sid' => $sid, '%query' => $query),
137
            array('%sid' => $sid, '%query' => serialize($query)),
138 138
            WATCHDOG_ERROR);
139 139
          continue;
140 140
        }
......
156 156
      foreach ($puid_x_puid_attrs as $puid_attr => $puids) {
157 157
        foreach ($puids as $puid => $user_data) {
158 158

  
159
          $account = $accounts[$user_data['uid']];
160
          $user_edit['ldap_user_last_checked'][LANGUAGE_NONE][0]['value'] = $check_time;
161
          $account = user_save($account, $user_edit, 'ldap_user');
162
          if (!$user_data['exists']) {
163
              /**
164
            * $ldap_user_conf->orphanedDrupalAcctBehavior will either be
165
             *  'ldap_user_orphan_email' or one of the user module options:
166
             *     user_cancel_block, user_cancel_block_unpublish,
167
             *     user_cancel_reassign, user_cancel_delete
168
             */
169
            if ($ldap_user_conf->orphanedDrupalAcctBehavior == 'ldap_user_orphan_email') {
170
               $email_list[] = $account->name . "," . $account->mail . "," . $base_url . "/user/$uid/edit";
171
            }
172
            else {
173
               _user_cancel(array(), $account, $ldap_user_conf->orphanedDrupalAcctBehavior);
159
          if ($account = $accounts[$user_data['uid']]) {
160
            $user_edit['ldap_user_last_checked'][LANGUAGE_NONE][0]['value'] = $check_time;
161
            $account = user_save($account, $user_edit, 'ldap_user');
162
            if (!$user_data['exists']) {
163
                /**
164
              * $ldap_user_conf->orphanedDrupalAcctBehavior will either be
165
               *  'ldap_user_orphan_email' or one of the user module options:
166
               *     user_cancel_block, user_cancel_block_unpublish,
167
               *     user_cancel_reassign, user_cancel_delete
168
               */
169
              if ($ldap_user_conf->orphanedDrupalAcctBehavior == 'ldap_user_orphan_email') {
170
                 $email_list[] = $account->name . "," . $account->mail . "," . $base_url . "/user/$uid/edit";
171
              }
172
              else {
173
                 _user_cancel(array(), $account, $ldap_user_conf->orphanedDrupalAcctBehavior);
174
              }
174 175
            }
175 176
          }
176 177
        }
drupal7/sites/all/modules/ldap/ldap_user/ldap_user.info
23 23
stylesheets[all][] = ldap_user.css
24 24
configure = admin/config/people/ldap/user
25 25

  
26
; Information added by Drupal.org packaging script on 2014-01-08
27
version = "7.x-2.0-beta8"
26
; Information added by Drupal.org packaging script on 2016-08-07
27
version = "7.x-2.0-beta11"
28 28
core = "7.x"
29 29
project = "ldap"
30
datestamp = "1389150511"
30
datestamp = "1470608343"
31 31

  
drupal7/sites/all/modules/ldap/ldap_user/ldap_user.module
225 225
      case 'ldap_user_insert_drupal_user':
226 226
      case 'ldap_user_update_drupal_user':
227 227
      case 'ldap_user_ldap_associate':
228
      case 'all':
228 229
        $attributes[$ldap_server->user_attr] = ldap_servers_set_attribute_map(@$attributes[$ldap_server->user_attr]); // array($ldap_server->user_attr, 0, NULL);
229 230
        $attributes[$ldap_server->mail_attr] = ldap_servers_set_attribute_map(@$attributes[$ldap_server->mail_attr]);
230 231
        $attributes[$ldap_server->picture_attr] = ldap_servers_set_attribute_map(@$attributes[$ldap_server->picture_attr]);
......
528 529
  }
529 530
  $ldap_user_conf = ldap_user_conf();
530 531
  if ($ldap_user_conf->disableAdminPasswordField == TRUE) {
531
    $form['account']['pass']['#required'] = FALSE;
532
    $form['account']['pass']['#disabled'] = TRUE;
532
    $form['account']['pass']['#type'] = 'value';
533 533
    $form['account']['pass']['#value'] = user_password(20);
534
    $form['account']['pass']['#description'] = t('An LDAP setting at /admin/config/people/ldap/user has disabled the password fields. Drupal will store a 20 character random password in the Drupal "users" table, and the user will login with their LDAP password.');
534
    $form['account']['pass_disabled']['#type'] = 'fieldset';
535
    $form['account']['pass_disabled']['#title'] = t('Password');
536
    $form['account']['pass_disabled'][]['#markup'] = t('An LDAP setting at /admin/config/people/ldap/user has disabled the password fields. Drupal will store a 20 character random password in the Drupal "users" table, and the user will login with their LDAP password.');
535 537
  }
536 538

  
537 539
  $ldap_fieldset = array();
drupal7/sites/all/modules/ldap/ldap_views/ldap_views.info
21 21
files[] = handlers/ldap_views_handler_filter_attribute.inc
22 22
files[] = handlers/ldap_views_handler_sort.inc
23 23
files[] = handlers/ldap_views_handler_sort_attribute.inc
24
; Information added by Drupal.org packaging script on 2014-01-08
25
version = "7.x-2.0-beta8"
24
; Information added by Drupal.org packaging script on 2016-08-07
25
version = "7.x-2.0-beta11"
26 26
core = "7.x"
27 27
project = "ldap"
28
datestamp = "1389150511"
28
datestamp = "1470608343"
29 29

  
drupal7/sites/all/modules/piwik/piwik.admin.inc
235 235
    '#type' => 'checkboxes',
236 236
    '#title' => t('Track messages of type'),
237 237
    '#default_value' => variable_get('piwik_trackmessages', array()),
238
    '#description' => t('This will track the selected message types shown to users. Tracking of form validation errors may help you identifying usability issues in your site. Every message is tracked as one individual event. Messages from excluded pages cannot tracked.'),
238
    '#description' => t('This will track the selected message types shown to users. Tracking of form validation errors may help you identifying usability issues in your site. Every message is tracked as one individual event. Messages from excluded pages cannot be tracked.'),
239 239
    '#options' => array(
240 240
      'status' => t('Status message'),
241 241
      'warning' => t('Warning message'),
......
387 387
  }
388 388

  
389 389
  // Code snippet settings.
390
  $user_access_add_js_snippets = !user_access('add JS snippets for piwik');
391
  $user_access_add_js_snippets_permission_warning = $user_access_add_js_snippets ? ' <em>' . t('This field has been disabled because you do not have sufficient permissions to edit it.') . '</em>' : '';
390 392
  $form['advanced']['codesnippet'] = array(
391 393
    '#type' => 'fieldset',
392 394
    '#title' => t('Custom JavaScript code'),
......
398 400
    '#type' => 'textarea',
399 401
    '#title' => t('Code snippet (before)'),
400 402
    '#default_value' => variable_get('piwik_codesnippet_before', ''),
403
    '#disabled' => $user_access_add_js_snippets,
401 404
    '#rows' => 5,
402 405
    '#description' => t('Code in this textarea will be added <strong>before</strong> _paq.push(["trackPageView"]).')
403 406
  );
......
405 408
    '#type' => 'textarea',
406 409
    '#title' => t('Code snippet (after)'),
407 410
    '#default_value' => variable_get('piwik_codesnippet_after', ''),
411
    '#disabled' => $user_access_add_js_snippets,
408 412
    '#rows' => 5,
409 413
    '#description' => t('Code in this textarea will be added <strong>after</strong> _paq.push(["trackPageView"]). This is useful if you\'d like to track a site in two accounts.')
410 414
  );
drupal7/sites/all/modules/piwik/piwik.info
5 5
configure = admin/config/system/piwik
6 6
files[] = piwik.test
7 7
test_dependencies[] = token
8
; Information added by Drupal.org packaging script on 2016-04-23
9
version = "7.x-2.8"
8
; Information added by Drupal.org packaging script on 2016-08-09
9
version = "7.x-2.9"
10 10
core = "7.x"
11 11
project = "piwik"
12
datestamp = "1461442443"
12
datestamp = "1470779970"
13 13

  
drupal7/sites/all/modules/piwik/piwik.module
60 60
      'description' => t('Enter PHP code in the field for tracking visibility settings.'),
61 61
      'restrict access' => TRUE,
62 62
    ),
63
    'add JS snippets for piwik' => array(
64
      'title' => t('Add JavaScript snippets'),
65
      'description' => 'Enter JavaScript code snippets for advanced Piwik functionality.',
66
      'restrict access' => TRUE,
67
    ),
63 68
  );
64 69
}
65 70

  
......
112 117
    $link_settings = array();
113 118
    $link_settings['trackMailto'] = variable_get('piwik_trackmailto', 1);
114 119

  
115
    if (module_exists('colorbox') && ($track_colorbox = variable_get('googleanalytics_trackcolorbox', 1))) {
120
    if (module_exists('colorbox') && ($track_colorbox = variable_get('piwik_trackcolorbox', 1))) {
116 121
      $link_settings['trackColorbox'] = $track_colorbox;
117 122
    }
118 123

  
drupal7/sites/all/modules/piwik/piwik.test
6 6
 */
7 7
class PiwikBasicTest extends DrupalWebTestCase {
8 8

  
9
  /**
10
   * User without permissions to edit snippets.
11
   *
12
   * @var \StdClass
13
   */
14
  protected $noSnippetUser;
15

  
9 16
  public static function getInfo() {
10 17
    return array(
11 18
      'name' => t('Piwik basic tests'),
......
23 30
    );
24 31

  
25 32
    // User to set up piwik.
33
    $this->noSnippetUser = $this->drupalCreateUser($permissions);
34
    $permissions[] = 'add JS snippets for piwik';
26 35
    $this->admin_user = $this->drupalCreateUser($permissions);
27 36
    $this->drupalLogin($this->admin_user);
28 37
  }
......
36 45
    $edit['piwik_site_id'] = $this->randomName(2);
37 46
    $this->drupalPost('admin/config/system/piwik', $edit, 'Save configuration');
38 47
    $this->assertRaw(t('A valid Piwik site ID is an integer only.'), '[testPiwikConfiguration]: Invalid Piwik site ID number validated.');
48

  
49
    // User should have access to code snippets.
50
    $this->assertFieldByName('piwik_codesnippet_before');
51
    $this->assertFieldByName('piwik_codesnippet_after');
52
    $this->assertNoFieldByXPath("//textarea[@name='piwik_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is enabled.');
53
    $this->assertNoFieldByXPath("//textarea[@name='piwik_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is enabled.');
54

  
55
    // Login as user without JS permissions.
56
    $this->drupalLogin($this->noSnippetUser);
57
    $this->drupalGet('admin/config/system/piwik');
58

  
59
    // User should *not* have access to snippets, but create fields.
60
    $this->assertFieldByName('piwik_codesnippet_before');
61
    $this->assertFieldByName('piwik_codesnippet_after');
62
    $this->assertFieldByXPath("//textarea[@name='piwik_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is disabled.');
63
    $this->assertFieldByXPath("//textarea[@name='piwik_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is disabled.');
39 64
  }
40 65

  
41 66
  function testPiwikPageVisibility() {

Formats disponibles : Unified diff