Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Maxime Besson
lemonldap-ng
Commits
a3866bc1
Commit
a3866bc1
authored
Apr 11, 2016
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Login template in progress (#595)
parent
132de79b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
13 deletions
+49
-13
e2e-tests/lemonldap-ng.ini
e2e-tests/lemonldap-ng.ini
+1
-1
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
+11
-11
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
+36
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
+1
-1
No files found.
e2e-tests/lemonldap-ng.ini
View file @
a3866bc1
...
...
@@ -21,7 +21,7 @@ notification = 0
checkXSS
=
0
portalSkin
=
bootstrap
staticPrefix
=
/
templateDir
=
__pwd__/lemonldap-ng-portal/example/skin
templateDir
=
__pwd__/lemonldap-ng-portal/example/skin
s
[handler]
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
View file @
a3866bc1
...
...
@@ -85,15 +85,15 @@ sub display {
#utf8::decode($auth_user);
%templateParams
=
(
AUTH_USER
=>
$auth_user
,
NEWWINDOW
=>
$self
->
conf
->
{
portalOpenLinkInNewWindow
},
AUTH_ERROR
=>
$req
->
errorString
(
$req
->
{
menuError
}
),
AUTH_ERROR_TYPE
=>
$req
->
error_type
(
$req
->
{
menuError
}
),
DISPLAY_TAB
=>
$self
->
conf
->
{
menuDisplayTab
},
LOGOUT_URL
=>
$self
->
conf
->
{
portal
}
.
"
?logout=1
",
AUTH_USER
=>
$auth_user
,
NEWWINDOW
=>
$self
->
conf
->
{
portalOpenLinkInNewWindow
},
AUTH_ERROR
=>
$req
->
errorString
(
$req
->
{
menuError
}
),
AUTH_ERROR_TYPE
=>
$req
->
error_type
(
$req
->
{
menuError
}
),
DISPLAY_TAB
=>
$self
->
conf
->
{
menuDisplayTab
},
LOGOUT_URL
=>
$self
->
conf
->
{
portal
}
.
"
?logout=1
",
DISPLAY_MODULES
=>
$self
->
conf
->
{
menuDisplayModules
}
||
[]
,
APPSLIST_ORDER
=>
$req
->
{
sessionInfo
}
->
{'
appsListOrder
'},
PING
=>
$self
->
conf
->
{
portalPingInterval
},
APPSLIST_ORDER
=>
$req
->
{
sessionInfo
}
->
{'
appsListOrder
'},
PING
=>
$self
->
conf
->
{
portalPingInterval
},
);
}
...
...
@@ -109,7 +109,7 @@ sub display {
AUTH_ERROR_TYPE
=>
$req
->
error_type
,
NOTIFICATION
=>
$notif
,
HIDDEN_INPUTS
=>
$self
->
buildHiddenForm
(),
AUTH_URL
=>
$
self
->
get
_url
,
AUTH_URL
=>
$
req
->
{
datas
}
->
{
_url
}
,
CHOICE_PARAM
=>
$self
->
conf
->
{
authChoiceParam
},
CHOICE_VALUE
=>
$req
->
{
_authChoice
},
);
...
...
@@ -122,7 +122,7 @@ sub display {
%templateParams
=
(
AUTH_ERROR
=>
$req
->
error
,
AUTH_ERROR_TYPE
=>
$req
->
error_type
,
AUTH_URL
=>
$
self
->
get
_url
,
AUTH_URL
=>
$
req
->
{
datas
}
->
{
_url
}
,
MSG
=>
$req
->
info
,
HIDDEN_INPUTS
=>
$self
->
buildHiddenForm
(),
ACTIVE_TIMER
=>
$self
->
conf
->
{
activeTimer
},
...
...
@@ -181,7 +181,7 @@ sub display {
%templateParams
=
(
AUTH_ERROR
=>
$req
->
error
,
AUTH_ERROR_TYPE
=>
$req
->
error_type
,
AUTH_URL
=>
$
self
->
get
_url
,
AUTH_URL
=>
$
req
->
{
datas
}
->
{
_url
}
,
LOGIN
=>
$login
,
CHECK_LOGINS
=>
$self
->
conf
->
{
portalCheckLogins
},
ASK_LOGINS
=>
$self
->
conf
->
{
checkLogins
},
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
View file @
a3866bc1
...
...
@@ -5,6 +5,7 @@ package Lemonldap::NG::Portal::Main::Request;
use
strict
;
use
Mouse
;
use
Lemonldap::NG::Portal::Main::
Constants
;
extends
'
Lemonldap::NG::Common::PSGI::Request
';
...
...
@@ -49,6 +50,41 @@ sub wantJSON {
# Error type
sub
error_type
{
my
$req
=
shift
;
my
$code
=
shift
||
$req
->
error
;
# Positive errors
return
"
positive
"
if
(
scalar
(
grep
{
/^$code$/
}
(
PE_REDIRECT
,
PE_DONE
,
PE_OK
,
PE_PASSWORD_OK
,
PE_MAILOK
,
PE_LOGOUT_OK
,
PE_MAILFIRSTACCESS
,
PE_PASSWORDFIRSTACCESS
,
PE_MAILCONFIRMOK
,
PE_REGISTERFIRSTACCESS
,
)
)
);
# Warning errors
return
"
warning
"
if
(
scalar
(
grep
{
/^$code$/
}
(
PE_INFO
,
PE_SESSIONEXPIRED
,
PE_FORMEMPTY
,
PE_FIRSTACCESS
,
PE_PP_GRACE
,
PE_PP_EXP_WARNING
,
PE_NOTIFICATION
,
PE_BADURL
,
PE_CONFIRM
,
PE_MAILFORMEMPTY
,
PE_MAILCONFIRMATION_ALREADY_SENT
,
PE_PASSWORDFORMEMPTY
,
PE_CAPTCHAEMPTY
,
PE_REGISTERFORMEMPTY
,
)
)
);
# Negative errors (default)
return
"
negative
";
#TODO
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
View file @
a3866bc1
...
...
@@ -92,7 +92,7 @@ sub authenticatedRequest {
sub
do
{
my
(
$self
,
$req
,
$steps
)
=
@_
;
$req
->
steps
(
$steps
);
my
$err
=
$self
->
process
(
$req
);
my
$err
=
$req
->
error
(
$self
->
process
(
$req
)
)
;
# TODO: updateStatus
if
(
!
$self
->
conf
->
{
noAjaxHook
}
and
$req
->
wantJSON
)
{
...
...
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