Skip to content

Commit

Permalink
#486 disable auth button
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Antoine Mathieu committed Feb 27, 2024
1 parent ef758cc commit 26082f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1><a href="#/_">{{title}}</a></h1>
</div>
<!-- TOP MENU -->
<div class="col-sm-9 text-right hidden-xs">
<a ng-if="isFeatureEnabled('authentication') && !user" href="#/login"><i class="fa fa-lock"></i> Authentication</a>
<a ng-if="auth_button && isFeatureEnabled('authentication') && !user" href="#/login"><i class="fa fa-lock"></i> Authentication</a>
<a ng-if="isFeatureEnabled('authentication') && user" href="#/login">{{user.login}}</a>
&nbsp;
<a ng-if="isFeatureEnabled('authentication') && user && user.admin" href="#/admin"><i class="fa fa-wrench"></i> Admin&nbsp;</a>
Expand Down
2 changes: 2 additions & 0 deletions webapp/js/ctrl/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plik.controller('MenuCtrl', ['$rootScope', '$scope', '$config',
// Set title
$rootScope.title = TITLE;

$scope.auth_button = !DISABLE_AUTH_BUTTON;

// Get server config
$config.getConfig()
.then(function (config) {
Expand Down
6 changes: 5 additions & 1 deletion webapp/js/custom.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
const TITLE = "Plik"
const TITLE = "Plik"

// Disable the authentication button
// Authentication page can still be accessed at https://plik.tld/#/login if enabled
const DISABLE_AUTH_BUTTON = false

0 comments on commit 26082f7

Please sign in to comment.