<commit_before>var toolbarApp = angular.module('toolbarApp', ['ngMaterial']);

toolbarApp.config(function ($httpProvider) {
    //Enable cross domain calls
    $httpProvider.defaults.useXDomain = true;
    //Remove the header used to identify ajax call  that would prevent CORS from working
    delete $httpProvider.defaults.headers.common['X-Requested-With'];
});

toolbarApp.controller('ToolbarCtrl', function ($scope, $rootScope, $mdDialog, $http, $location, $cookies, $mdSidenav, $mdMedia) {
    $scope.status = '';
    
    $test = $cookies.get('loggedIn');
    $rootScope.loggedIn = ($test === "true");
    
    //$scope.user.UniqId = $cookies.get('user_UniqId') === "true" ? true : false;

    $scope.erreurLogin = false;
    
    $scope.input = {
      searchText: ''  
    };

    $scope.project = {
        projectName: '',
        projectBudget: 0,
        projectDelay: 0,
        description: ''
    };

    $scope.notAgreed = false;
    $scope.captchaNotValidated = false;
    $scope.fieldMissing = false;
    $scope.description = '';
    $scope.showMobileMainHeader = true;
    $scope.screenIsSmall = $mdMedia('sm');

    $rootScope.isAdmin = $cookies.get('user_Admin') === "true" ? true : false;

    $scope.goAdmin = function() {
        $location.path('admin');
    }

    $scope.user = {
        Login: $cookies.get('user_login') || undefined,
        Password: <PASSWORD>,
        Email: undefined,
        FirstName: undefined,
        LastName: undefined,
        verif_password: <PASSWORD>,
        Developper: $cookies.get('user_Developper') === "true" ? true : false || undefined,
        Activated: undefined,
        Admin: $cookies.get('user_Admin') === "true" ? true : false || undefined,
        Description: undefined,
        UniqId: $cookies.get('user_UniqId'),
        ImageUrl: undefined,
        ProjectCreator: $cookies.get('user_ProjectCreator') === "true" ? true : false || undefined
    };

    $rootScope.user = $scope.user;

//    $scope.login = undefined;
//    $scope.password = <PASSWORD>;
//    $scope.mail = undefined;
//    $scope.firstname = undefined;
//    $scope.lastname = undefined;
//    $scope.verif_password = undefined;
//    $scope.typeaccount = undefined;
//    $scope.validated = undefined;




/////////////////////////////
////Fonctions publiques//////
/////////////////////////////

    // Connexion d'un user
    $scope.connection = function () {
        var identification = {password: <PASSWORD>, login: $scope.user.mail};
        $http.post('http://codingmarketplace.apphb.com/api/Users/Login', identification).success(function (data) {
            $scope.user = data;
            $rootScope.user = $scope.user;
            $rootScope.loggedIn = true;
            $cookies.put('loggedIn', $rootScope.loggedIn);
            $cookies.put('user_login', $scope.user.Login);
            $cookies.put('user_UniqId', $scope.user.UniqId);
            var projectCreatorStr = $scope.user.ProjectCreator === true ? "true" : "false";
            var Admin = $scope.user.Admin === true ? "true" : "false";
            var Developper = $scope.user.Developper === true ? "true" : "false";
            $cookies.put('user_ProjectCreator', projectCreatorStr);
            $cookies.put('user_Admin', Admin);
            $cookies.put('user_Developper', Developper);
            $scope.hide();
        }).error(function (data) {
            $scope.erreurLogin = true;
        });
    };

    // Déconnexion d'un user
    $scope.logOut = function () {
        $rootScope.loggedIn = false;
        $scope.user = undefined;
        $cookies.put('loggedIn', $rootScope.loggedIn);
        $cookies.put('user', $scope.user);
        $location.path('#/');
    };

    // Recherche d'un project
    $scope.search = function () {
        $location.path('search-projects/' + $scope.input.searchText);
    };

    // Accès à mon compte
    $scope.myAccount = function () {
        $location.path('user/' + $rootScope.user['UniqId']);
    };

    $scope.uploadFile = function(files) {<commit_msg>admin<commit_after>var toolbarApp = angular.module('toolbarApp', ['ngMaterial']);

toolbarApp.config(function ($httpProvider) {
    //Enable cross domain calls
    $httpProvider.defaults.useXDomain = true;
    //Remove the header used to identify ajax call  that would prevent CORS from working
    delete $httpProvider.defaults.headers.common['X-Requested-With'];
});

toolbarApp.controller('ToolbarCtrl', function ($scope, $rootScope, $mdDialog, $http, $location, $cookies, $mdSidenav, $mdMedia) {
    $scope.status = '';
    
    $test = $cookies.get('loggedIn');
    $rootScope.loggedIn = ($test === "true");
    
    //$scope.user.UniqId = $cookies.get('user_UniqId') === "true" ? true : false;

    $scope.erreurLogin = false;
    
    $scope.input = {
      searchText: ''  
    };

    $scope.project = {
        projectName: '',
        projectBudget: 0,
        projectDelay: 0,
        description: ''
    };

    $scope.notAgreed = false;
    $scope.captchaNotValidated = false;
    $scope.fieldMissing = false;
    $scope.description = '';
    $scope.showMobileMainHeader = true;
    $scope.screenIsSmall = $mdMedia('sm');

    $rootScope.isAdmin = $cookies.get('user_Admin') === "true" ? true : false;

    $scope.goAdmin = function() {
        $location.path('admin');
    }

    $scope.user = {
        Login: $cookies.get('user_login') || undefined,
        Password: <PASSWORD>,
        Email: undefined,
        FirstName: undefined,
        LastName: undefined,
        verif_password: undefined,
        Developper: $cookies.get('user_Developper') === "true" ? true : false || undefined,
        Activated: undefined,
        Admin: $cookies.get('user_Admin') === "true" ? true : false || undefined,
        Description: undefined,
        UniqId: $cookies.get('user_UniqId'),
        ImageUrl: undefined,
        ProjectCreator: $cookies.get('user_ProjectCreator') === "true" ? true : false || undefined
    };

    $rootScope.user = $scope.user;

//    $scope.login = undefined;
//    $scope.password = <PASSWORD>;
//    $scope.mail = undefined;
//    $scope.firstname = undefined;
//    $scope.lastname = undefined;
//    $scope.verif_password = <PASSWORD>;
//    $scope.typeaccount = undefined;
//    $scope.validated = undefined;




/////////////////////////////
////Fonctions publiques//////
/////////////////////////////

    // Connexion d'un user
    $scope.connection = function () {
        var identification = {password: $<PASSWORD>, login: $scope.user.mail};
        $http.post('http://codingmarketplace.apphb.com/api/Users/Login', identification).success(function (data) {
            $scope.user = data;
            $rootScope.user = $scope.user;
            $rootScope.loggedIn = true;
            $cookies.put('loggedIn', $rootScope.loggedIn);
            $cookies.put('user_login', $scope.user.Login);
            $cookies.put('user_UniqId', $scope.user.UniqId);
            var projectCreatorStr = $scope.user.ProjectCreator === true ? "true" : "false";
            var Admin = $scope.user.Admin === true ? "true" : "false";
            var Developper = $scope.user.Developper === true ? "true" : "false";
            $cookies.put('user_ProjectCreator', projectCreatorStr);
            $cookies.put('user_Admin', Admin);
            $cookies.put('user_Developper', Developper);
            $rootScope.isAdmin = $cookies.get('user_Admin') === "true" ? true : false;
            $scope.hide();
        }).error(function (data) {
            $scope.erreurLogin = true;
        });
    };

    // Déconnexion d'un user
    $scope.logOut = function () {
        $rootScope.loggedIn = false;
        $scope.user = undefined;
        $cookies.put('loggedIn', $rootScope.loggedIn);
        $cookies.put('user', $scope.user);
        $rootScope.isAdmin = false;
        $location.path('#/');
    };

    // Recherche d'un project
    $scope.search = function () {
        $location.path('search-projects/' + $scope.input.searchText);
    };

    // Accès à mon compte
    $scope.myAccount = function () {
        $location.path('user/' + $rootScope.user['UniqId']);
    };

    $scope.uploadFile = function(files) {
{'fraction_non_alphanumeric': 0.17408312958435207, 'fraction_numerical': 0.0004889975550122249, 'mean_word_length': 2.469465648854962, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '608441', 'n_tokens_mistral': 2537, 'n_tokens_neox': 2505, 'n_words': 457}