Project

General

Profile

« Previous | Next » 

Revision 52836

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

View differences:

metrics-show.component.ts
1 1
import { Component, OnInit } from '@angular/core';
2
import { ActivatedRoute } from '@angular/router';
2
import {ActivatedRoute, Router} from '@angular/router';
3 3
import { MetricsInfo, PiwikInfo } from '../../domain/typeScriptClasses';
4 4
import { PiwikService } from '../../services/piwik.service';
5 5
import { RepositoryService } from '../../services/repository.service';
6 6
import { loadingMetrics, loadingMetricsError } from '../../domain/shared-messages';
7 7
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
8
import {AuthenticationService} from "../../services/authentication.service";
8 9

  
9 10
@Component ({
10 11
  selector: 'metrics-show',
......
26 27

  
27 28
  constructor(
28 29
    private route: ActivatedRoute,
30
    private router: Router,
29 31
    private sanitizer: DomSanitizer,
30 32
    private piwikService: PiwikService,
31
    private repoService: RepositoryService
32
  ) {}
33
    private repoService: RepositoryService,
34
    private authService: AuthenticationService) {}
33 35

  
34 36
  ngOnInit() {
35 37
    this.repoId = this.route.snapshot.paramMap.get('id');
......
51 53
      () => {
52 54
        this.loadingMessage = '';
53 55
        this.errorMessage = '';
54
        this.getMetrics();
56
        /*if ( this.authService.getUserEmail() !== this.piwik.requestorEmail ) {
57
          this.router.navigateByUrl('/403-forbidden', { skipLocationChange: true });
58
        } else {*/
59
          this.getMetrics();
60
        /*}*/
55 61
      }
56 62
    );
57 63
  }

Also available in: Unified diff