Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
7095b3a0
Commit
7095b3a0
authored
12 years ago
by
Michael Göhler
Browse files
Options
Downloads
Patches
Plain Diff
extend logon page to display multiple error messages
parent
9f9206cd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/templates/login.php
+13
-2
13 additions, 2 deletions
core/templates/login.php
lib/base.php
+5
-5
5 additions, 5 deletions
lib/base.php
lib/util.php
+4
-2
4 additions, 2 deletions
lib/util.php
with
22 additions
and
9 deletions
core/templates/login.php
+
13
−
2
View file @
7095b3a0
...
...
@@ -2,9 +2,20 @@
<form
method=
"post"
>
<fieldset>
<?php
if
(
!
empty
(
$_
[
'redirect'
]))
{
echo
'<input type="hidden" name="redirect_url" value="'
.
$_
[
'redirect'
]
.
'" />'
;
}
?>
<?php
if
(
$_
[
'display_lostpassword'
])
:
?>
<a
href=
"./core/lostpassword/"
>
<?php
echo
$l
->
t
(
'Lost your password?'
);
?>
</a>
<ul>
<?php
if
(
$_
[
'invalidcookie'
])
:
?>
<li
class=
"errors"
>
<?php
echo
$l
->
t
(
'Automatic logon rejected!'
);
?>
<br>
<small>
<?php
echo
$l
->
t
(
'If you did not change your password recently, your account may be compromised!'
);
?>
</small><br>
<small>
<?php
echo
$l
->
t
(
'Please change your password to secure your account again.'
);
?>
</small>
</li>
<?php
endif
;
?>
<?php
if
(
$_
[
'invalidpassword'
])
:
?>
<a
href=
"./core/lostpassword/"
><li
class=
"errors"
>
<?php
echo
$l
->
t
(
'Lost your password?'
);
?>
</li></a>
<?php
endif
;
?>
</ul>
<p
class=
"infield"
>
<label
for=
"user"
class=
"infield"
>
<?php
echo
$l
->
t
(
'Username'
);
?>
</label>
<input
type=
"text"
name=
"user"
id=
"user"
value=
"
<?php
echo
$_
[
'username'
];
?>
"
<?php
echo
$_
[
'user_autofocus'
]
?
' autofocus'
:
''
;
?>
autocomplete=
"on"
required
/>
...
...
This diff is collapsed.
Click to expand it.
lib/base.php
+
5
−
5
View file @
7095b3a0
...
...
@@ -494,20 +494,20 @@ class OC{
protected
static
function
handleLogin
()
{
OC_App
::
loadApps
(
array
(
'prelogin'
));
$error
=
false
;
$error
=
array
()
;
// remember was checked after last login
if
(
OC
::
tryRememberLogin
())
{
// nothing more to do
$error
[]
=
'invalidcookie'
;
// Someone wants to log in :
}
elseif
(
OC
::
tryFormLogin
())
{
$error
=
true
;
$error
[]
=
'invalidpassword'
;
// The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
}
elseif
(
OC
::
tryBasicAuthLogin
())
{
$error
=
true
;
$error
[]
=
'invalidpassword'
;
}
OC_Util
::
displayLoginPage
(
$error
);
OC_Util
::
displayLoginPage
(
array_unique
(
$error
)
)
;
}
protected
static
function
tryRememberLogin
()
{
...
...
This diff is collapsed.
Click to expand it.
lib/util.php
+
4
−
2
View file @
7095b3a0
...
...
@@ -308,9 +308,11 @@ class OC_Util {
return
$errors
;
}
public
static
function
displayLoginPage
(
$
display_lostpassword
)
{
public
static
function
displayLoginPage
(
$
errors
=
array
()
)
{
$parameters
=
array
();
$parameters
[
'display_lostpassword'
]
=
$display_lostpassword
;
foreach
(
$errors
as
$key
=>
$value
)
{
$parameters
[
$value
]
=
true
;
}
if
(
!
empty
(
$_POST
[
'user'
]))
{
$parameters
[
"username"
]
=
OC_Util
::
sanitizeHTML
(
$_POST
[
'user'
])
.
'"'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment