Skip to content

Commit

Permalink
Merge pull request #512 from root-gg/disable_auth_button
Browse files Browse the repository at this point in the history
#486 disable auth button
  • Loading branch information
camathieu authored Feb 28, 2024
2 parents ef758cc + d00db09 commit e675dcb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 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
6 changes: 4 additions & 2 deletions webapp/js/ctrl/menu.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
plik.controller('MenuCtrl', ['$rootScope', '$scope', '$config',
function ($rootScope, $scope, $config) {
// Set title
$rootScope.title = TITLE;

// Static config
$rootScope.title = CONFIG.TITLE || "Plik";
$scope.auth_button = !CONFIG.DISABLE_AUTH_BUTTON;

// Get server config
$config.getConfig()
Expand Down
9 changes: 8 additions & 1 deletion webapp/js/custom.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
const TITLE = "Plik"
CONFIG = {
// Title of the tab and logo
"TITLE": "Plik",

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

0 comments on commit e675dcb

Please sign in to comment.