Project

General

Profile

« Previous | Next » 

Revision 52836

added cookie-law banner - 403 authorization via ui and new usage-stats pages

View differences:

metrics-instructions.component.ts
4 4

  
5 5
import {Component, OnInit} from '@angular/core';
6 6
import {PiwikInfo} from '../../domain/typeScriptClasses';
7
import {ActivatedRoute} from '@angular/router';
7
import {ActivatedRoute, Router} from '@angular/router';
8 8
import { PiwikService } from '../../services/piwik.service';
9
import {AuthenticationService} from "../../services/authentication.service";
9 10

  
10 11
@Component ({
11 12
  selector: 'app-metrics-instructions',
......
18 19

  
19 20
  constructor(
20 21
    private route: ActivatedRoute,
21
    private piwikService: PiwikService
22
  ) {}
22
    private router: Router,
23
    private piwikService: PiwikService,
24
    private authService: AuthenticationService) {}
23 25

  
24 26
  ngOnInit() {
25 27
    this.getPiwik();
......
29 31
    let id = this.route.snapshot.paramMap.get('id');
30 32
    this.piwikService.getPiwikInfo(id).subscribe(
31 33
      piwik => this.piwik = piwik,
32
      error => console.log(error)
34
      error => console.log(error),
35
      () => {
36
        /*if ( this.authService.getUserEmail() !== this.piwik.requestorEmail ) {
37
          this.router.navigateByUrl('/403-forbidden', { skipLocationChange: true });
38
        }*/
39
      }
33 40
    );
34 41
  }
35 42

  

Also available in: Unified diff