Skip to content

Commit

Permalink
add config to disable register according to #586
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsgsDesign committed May 17, 2021
1 parent 53dfbb2 commit d3cd73a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ APP_BACKUP=false #Enable Scheduling Backup
APP_LOGO="" #URL for site logo
APP_DESC=

FUNC_ENABLE_REGISTER=true

BABEL_MIRROR=https://acm.njupt.edu.cn/babel #The mirror of babel marketplace

SESSION_DOMAIN=.ojsystem.com
Expand Down
5 changes: 5 additions & 0 deletions config/function.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'register' => env('FUNC_ENABLE_REGISTER', true),
];
2 changes: 2 additions & 0 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<p>{{__("account.slogan", ["name" => config("app.name")])}}</p>
</div>
<div class="card">
@if(config("function.register"))
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs nav-justified nav-tabs-material" id="accountTab" role="tablist">
<li class="nav-item">
Expand All @@ -112,6 +113,7 @@
<div class="nav-tabs-indicator" id="nav-tabs-indicator" style="left: 0px;"></div>
</ul>
</div>
@endif
<div class="tab-content" id="accountTabContent">
<div class="tab-pane fade show active" id="login" role="tabpanel" aria-labelledby="login-tab">
<form class="needs-validation" action="{{ route('login') }}" method="post" id="login_form" novalidate>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
@endif
<li class="nav-item mundb-no-shrink />">
@guest
<a class="nav-link @if ($navigation === "Account") active @endif" href="/login">{{__('navigation.account')}}</a>
<a class="nav-link @if ($navigation === "Account") active @endif" href="/login">@if(config("function.register")){{__('navigation.account')}}@else {{__("Login")}} @endif</a>
@else
<li class="nav-item dropdown mundb-btn-ucenter">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{{$greeting}}, <span id="nav-username" data-uid="{{Auth::user()->id}}">{{ Auth::user()["name"] }}</span></a>
Expand Down
6 changes: 5 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,8 @@
});
});

Auth::routes(['verify' => true]);
if(config("function.register")){
Auth::routes(['verify' => true]);
} else {
Auth::routes(['verify' => true, 'register' => false]);
}

0 comments on commit d3cd73a

Please sign in to comment.