Projet

Général

Profil

Révision 147616a8

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/piwik/README.txt
48 48
Value: [current-user:piwik-role-ids]
49 49
Scope: Visitor
50 50

  
51
More details about custom variables can be found in the Piwik API documentation at
52
http://piwik.org/docs/javascript-tracking/#toc-custom-variables.
51
More details about custom variables can be found in the Piwik API documentation
52
at http://piwik.org/docs/javascript-tracking/#toc-custom-variables.
53 53

  
54 54

  
55 55
Advanced Settings
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-08-09
9
version = "7.x-2.9"
8
; Information added by Drupal.org packaging script on 2017-11-11
9
version = "7.x-2.10"
10 10
core = "7.x"
11 11
project = "piwik"
12
datestamp = "1470779970"
12
datestamp = "1510404811"
13 13

  
drupal7/sites/all/modules/piwik/piwik.module
188 188
      $set_document_title = '"404/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)';
189 189
    }
190 190

  
191
    // #2693595: User has entered an invalid login and clicked on forgot
192
    // password link. This link contains the username or email address and may
193
    // get send to Google if we do not override it. Override only if 'name'
194
    // query param exists. Last custom url condition, this need to win.
195
    //
196
    // URLs to protect are:
197
    // - user/password?name=username
198
    // - user/password?name=foo@example.com
199
    if (arg(0) == 'user' && arg(1) == 'password' && array_key_exists('name', drupal_get_query_parameters())) {
200
      $set_custom_url = drupal_json_encode(url('user/password'));
201
    }
202

  
191 203
    // Add custom variables.
192 204
    $piwik_custom_vars = variable_get('piwik_custom_var', array());
193 205
    $custom_variable = '';
......
486 498
        if ($data_hash_local != $data_hash_remote && file_prepare_directory($path)) {
487 499
          // Save updated tracking code file to disk.
488 500
          file_unmanaged_save_data($result->data, $file_destination, FILE_EXISTS_REPLACE);
501
          // Based on Drupal Core drupal_build_css_cache().
502
          if (variable_get('css_gzip_compression', TRUE) && variable_get('clean_url', 0) && extension_loaded('zlib')) {
503
            file_unmanaged_save_data(gzencode($result->data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
504
          }
489 505
          watchdog('piwik', 'Locally cached tracking code file has been updated.', array(), WATCHDOG_INFO);
490 506

  
491 507
          // Change query-strings on css/js files to enforce reload for all users.
......
498 514
          // There is no need to flush JS here as core refreshes JS caches
499 515
          // automatically, if new files are added.
500 516
          file_unmanaged_save_data($result->data, $file_destination, FILE_EXISTS_REPLACE);
517
          if (variable_get('css_gzip_compression', TRUE) && variable_get('clean_url', 0) && extension_loaded('zlib')) {
518
            file_unmanaged_save_data(gzencode($result->data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
519
          }
501 520
          watchdog('piwik', 'Locally cached tracking code file has been saved.', array(), WATCHDOG_INFO);
502 521

  
503 522
          // Return the local JS file path.
drupal7/sites/all/modules/piwik/piwik.test
109 109

  
110 110
    // Test whether 403 forbidden tracking code is shown if user has no access.
111 111
    $this->drupalGet('admin');
112
    $this->assertRaw('"403/URL = "', '[testPiwikPageVisibility]: 403 Forbidden tracking code shown if user has no access.');
112
    $this->assertRaw('403/URL = "', '[testPiwikPageVisibility]: 403 Forbidden tracking code shown if user has no access.');
113 113

  
114 114
    // Test whether 404 not found tracking code is shown on non-existent pages.
115 115
    $this->drupalGet($this->randomName(64));
116
    $this->assertRaw('"404/URL = "', '[testPiwikPageVisibility]: 404 Not Found tracking code shown on non-existent page.');
116
    $this->assertRaw('404/URL = "', '[testPiwikPageVisibility]: 404 Not Found tracking code shown on non-existent page.');
117 117
  }
118 118

  
119 119
  function testPiwikTrackingCode() {
......
310 310
  }
311 311
}
312 312

  
313
/**
314
 * Test custom url functionality of Google Analytics module.
315
 */
316
class PiwikCustomUrls extends DrupalWebTestCase {
317

  
318
  public static function getInfo() {
319
    return array(
320
      'name' => 'Piwik custom url tests',
321
      'description' => 'Test custom url functionality of Piwik module.',
322
      'group' => 'Piwik',
323
    );
324
  }
325

  
326
  function setUp() {
327
    parent::setUp('piwik');
328

  
329
    $permissions = array(
330
      'access administration pages',
331
      'administer piwik',
332
    );
333

  
334
    // User to set up piwik.
335
    $this->admin_user = $this->drupalCreateUser($permissions);
336
  }
337

  
338
  /**
339
   * Tests if user password page urls are overridden.
340
   */
341
  public function testPiwikUserPasswordPage() {
342
    $base_path = base_path();
343
    $ua_code = '1';
344
    variable_set('piwik_site_id', $ua_code);
345
    variable_get('piwik_url_http', 'http://example.com/piwik/');
346
    variable_get('piwik_url_https', 'https://example.com/piwik/');
347

  
348
    $this->drupalGet('user/password', array('query' => array('name' => 'foo')));
349
    $this->assertRaw('_paq.push(["setCustomUrl", ' . drupal_json_encode(url('user/password')) . ']);');
350

  
351
    $this->drupalGet('user/password', array('query' => array('name' => 'foo@example.com')));
352
    $this->assertRaw('_paq.push(["setCustomUrl", ' . drupal_json_encode(url('user/password')) . ']);');
353

  
354
    $this->drupalGet('user/password');
355
    $this->assertNoRaw('_paq.push(["setCustomUrl", "', '[testPiwikCustomUrls]: Custom url not set.');
356
  }
357

  
358
}
359

  
313 360
class PiwikStatusMessagesTest extends DrupalWebTestCase {
314 361

  
315 362
  public static function getInfo() {

Formats disponibles : Unified diff