Projet

Général

Profil

Révision d756b39a

Ajouté par Assos Assos il y a environ 8 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/piwik/piwik.module
112 112
    $link_settings = array();
113 113
    $link_settings['trackMailto'] = variable_get('piwik_trackmailto', 1);
114 114

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

  
115 119
    drupal_add_js(array('piwik' => $link_settings), 'setting');
116 120
    drupal_add_js(drupal_get_path('module', 'piwik') . '/piwik.js');
117 121

  
......
132 136

  
133 137
      if (!empty($titles)) {
134 138
        // Encode title, at least to keep "/" intact.
135
        $titles = array_map('urlencode', $titles);
139
        $titles = array_map('rawurlencode', $titles);
136 140

  
137 141
        $set_document_title = drupal_json_encode(implode('/', $titles));
138 142
      }
......
231 235
      // The USER_ID value should be a unique, persistent, and non-personally
232 236
      // identifiable string identifier that represents a user or signed-in
233 237
      // account across devices.
234
      $script .= '_paq.push(["setUserId", ' . drupal_json_encode(drupal_hmac_base64($user->uid, drupal_get_private_key() . drupal_get_hash_salt())) . ']);';
238
      $script .= '_paq.push(["setUserId", ' . drupal_json_encode(piwik_user_id_hash($user->uid)) . ']);';
235 239
    }
236 240

  
237 241
    // Set custom data.
......
348 352
  }
349 353
}
350 354

  
355
/**
356
 * Generate user id hash to implement USER_ID.
357
 *
358
 * The USER_ID value should be a unique, persistent, and non-personally
359
 * identifiable string identifier that represents a user or signed-in
360
 * account across devices.
361
 *
362
 * @param int $uid
363
 *   User id.
364
 *
365
 * @return string
366
 *   User id hash.
367
 */
368
function piwik_user_id_hash($uid) {
369
  return drupal_hmac_base64($uid, drupal_get_private_key() . drupal_get_hash_salt());
370
}
371

  
351 372
/**
352 373
 * Implements hook_field_extra_fields().
353 374
 */

Formats disponibles : Unified diff