Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
690a74c6
Commit
690a74c6
authored
Jun 25, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(login): invert naming for dissallow user pass login
parent
092b6517
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
14 deletions
+17
-14
conf/defaults.ini
+3
-0
pkg/api/login.go
+1
-1
pkg/setting/setting.go
+9
-9
public/app/core/controllers/login_ctrl.js
+1
-1
public/app/partials/login.html
+3
-3
No files found.
conf/defaults.ini
View file @
690a74c6
...
...
@@ -178,6 +178,9 @@ login_hint = email or username
# Default UI theme ("dark" or "light")
default_theme
=
dark
# Allow users to sign in using username and password
allow_user_pass_login
=
true
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
...
...
pkg/api/login.go
View file @
690a74c6
...
...
@@ -29,7 +29,7 @@ func LoginView(c *middleware.Context) {
viewData
.
Settings
[
"githubAuthEnabled"
]
=
setting
.
OAuthService
.
GitHub
viewData
.
Settings
[
"disableUserSignUp"
]
=
!
setting
.
AllowUserSignUp
viewData
.
Settings
[
"loginHint"
]
=
setting
.
LoginHint
viewData
.
Settings
[
"
oauthOnly"
]
=
setting
.
Disable
UserPassLogin
viewData
.
Settings
[
"
allowUserPassLogin"
]
=
setting
.
Allow
UserPassLogin
if
!
tryLoginUsingRememberCookie
(
c
)
{
c
.
HTML
(
200
,
VIEW_INDEX
,
viewData
)
...
...
pkg/setting/setting.go
View file @
690a74c6
...
...
@@ -82,14 +82,14 @@ var (
ExternalEnabled
bool
// User settings
AllowUserSignUp
bool
AllowUserOrgCreate
bool
AutoAssignOrg
bool
AutoAssignOrgRole
string
VerifyEmailEnabled
bool
LoginHint
string
DefaultTheme
string
Disable
UserPassLogin
bool
AllowUserSignUp
bool
AllowUserOrgCreate
bool
AutoAssignOrg
bool
AutoAssignOrgRole
string
VerifyEmailEnabled
bool
LoginHint
string
DefaultTheme
string
Allow
UserPassLogin
bool
// Http auth
AdminUser
string
...
...
@@ -486,7 +486,7 @@ func NewConfigContext(args *CommandLineArgs) error {
VerifyEmailEnabled
=
users
.
Key
(
"verify_email_enabled"
)
.
MustBool
(
false
)
LoginHint
=
users
.
Key
(
"login_hint"
)
.
String
()
DefaultTheme
=
users
.
Key
(
"default_theme"
)
.
String
()
DisableUserPassLogin
=
users
.
Key
(
"disable_user_pass_login"
)
.
MustBool
(
fals
e
)
AllowUserPassLogin
=
users
.
Key
(
"allow_user_pass_login"
)
.
MustBool
(
tru
e
)
// anonymous access
AnonymousEnabled
=
Cfg
.
Section
(
"auth.anonymous"
)
.
Key
(
"enabled"
)
.
MustBool
(
false
)
...
...
public/app/core/controllers/login_ctrl.js
View file @
690a74c6
...
...
@@ -18,7 +18,7 @@ function (angular, coreModule, config) {
$scope
.
googleAuthEnabled
=
config
.
googleAuthEnabled
;
$scope
.
githubAuthEnabled
=
config
.
githubAuthEnabled
;
$scope
.
oauthEnabled
=
config
.
githubAuthEnabled
||
config
.
googleAuthEnabled
;
$scope
.
oauthOnly
=
config
.
oauthOnly
;
$scope
.
allowUserPassLogin
=
config
.
allowUserPassLogin
;
$scope
.
disableUserSignUp
=
config
.
disableUserSignUp
;
$scope
.
loginHint
=
config
.
loginHint
;
...
...
public/app/partials/login.html
View file @
690a74c6
...
...
@@ -17,7 +17,7 @@
</button>
</div>
<form
name=
"loginForm"
class=
"login-form gf-form-group"
ng-if=
"
!oauthOnly
"
>
<form
name=
"loginForm"
class=
"login-form gf-form-group"
ng-if=
"
allowUserPassLogin
"
>
<div
class=
"gf-form"
ng-if=
"loginMode"
>
<span
class=
"gf-form-label width-7"
>
User
</span>
<input
type=
"text"
name=
"username"
class=
"gf-form-input max-width-14"
required
ng-model=
'formModel.user'
placeholder=
{{loginHint}}
>
...
...
@@ -40,7 +40,7 @@
</form>
<div
ng-if=
"loginMode"
>
<div
class=
"text-center login-divider"
ng-if=
"oauthEnabled &&
!oauthOnly
"
>
<div
class=
"text-center login-divider"
ng-if=
"oauthEnabled &&
allowUserPassLogin
"
>
<div
class=
"login-divider-line"
>
<span
class=
"login-divider-text"
>
Or login with
...
...
@@ -64,7 +64,7 @@
<div
class=
"clearfix"
></div>
<div
class=
"text-center password-recovery"
ng-if=
"
!oauthOnly
"
>
<div
class=
"text-center password-recovery"
ng-if=
"
allowUserPassLogin
"
>
<div
class=
"text-center"
>
<a
href=
"user/password/send-reset-email"
>
Forgot your password?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment