admin: add a route and buttons to generate/delete fichtpasswd, if needed
This commit is contained in:
parent
590522e7ed
commit
e945071a10
3 changed files with 36 additions and 0 deletions
|
|
@ -682,6 +682,20 @@ angular.module("FICApp")
|
|||
$rootScope.newBox('danger', 'An error occurs when generating certificate:', response.data.errmsg);
|
||||
});
|
||||
};
|
||||
$scope.generateHtpasswd = function() {
|
||||
$http.post("/api/htpasswd").then(function() {
|
||||
$rootScope.newBox('success', 'Fichier htpasswd généré avec succès');
|
||||
}, function(response) {
|
||||
$rootScope.newBox('danger', 'An error occurs when generating htpasswd file:', response.data.errmsg);
|
||||
});
|
||||
};
|
||||
$scope.removeHtpasswd = function() {
|
||||
$http.delete("/api/htpasswd").then(function() {
|
||||
$rootScope.newBox('success', 'Fichier htpasswd supprimé avec succès');
|
||||
}, function(response) {
|
||||
$rootScope.newBox('danger', 'An error occurs when deleting htpasswd file:', response.data.errmsg);
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
.controller("PublicController", function($scope, $rootScope, $routeParams, $location, Scene, Theme, Teams, Exercice) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
<h2>
|
||||
Certificats clients
|
||||
<button type="button" ng-click="generateCert()" class="float-right btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Générer un certificat</button>
|
||||
<div class="float-right btn-group mr-1" role="group">
|
||||
<button type="button" ng-click="generateHtpasswd()" class="btn btn-sm btn-secondary"><span class="glyphicon glyphicon-save-file" aria-hidden="true"></span> Générer <code>fichtpasswd</code></button>
|
||||
<button type="button" ng-click="removeHtpasswd()" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
</h2>
|
||||
|
||||
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
|
||||
|
|
|
|||
Reference in a new issue