Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Access Check - Account manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
edugain
eduGAIN Access Check - Account manager
Commits
8a9d21b4
Commit
8a9d21b4
authored
7 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
pass title, subtitle and action to the templates
parent
b672b10f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/IdPAccountManager/WebRequest.pm
+28
-19
28 additions, 19 deletions
lib/IdPAccountManager/WebRequest.pm
with
28 additions
and
19 deletions
lib/IdPAccountManager/WebRequest.pm
+
28
−
19
View file @
8a9d21b4
...
...
@@ -12,6 +12,7 @@ use IdPAccountManager::Data::AuthenticationToken;
use
IdPAccountManager::Data::
ServiceProvider
;
use
IdPAccountManager::
Logger
;
use
IdPAccountManager::
SAMLMetadata
;
use
IdPAccountManager::
Tools
;
## Defining parameters format
my
$urn_or_url_regex
=
'
(http(s?):\/\/|urn:)[^
\\
\$\*\"
\'
\`\^\|\<\>\n\s]+
'
...
...
@@ -87,23 +88,6 @@ sub execute {
my
$status
;
# initialize output parameters
$self
->
{
out
}
=
{
env
=>
{
REMOTE_HOST
=>
$ENV
{
REMOTE_HOST
},
REMOTE_ADDR
=>
$ENV
{
REMOTE_ADDR
},
SCRIPT_NAME
=>
$ENV
{
SCRIPT_NAME
}
},
conf
=>
{
accounts_validity_period
=>
$self
->
{
configuration
}
->
{
accounts_validity_period
},
app_name
=>
$self
->
{
configuration
}
->
{
app_name
},
app_url
=>
$self
->
{
configuration
}
->
{
app_url
},
idp_scope
=>
$self
->
{
configuration
}
->
{
idp_scope
},
idp_displayname
=>
$self
->
{
configuration
}
->
{
idp_displayname
},
support_email
=>
$self
->
{
configuration
}
->
{
support_email
},
version
=>
$self
->
{
configuration
}
->
{
version
},
}
};
# process input parameters
my
%parameters
=
$self
->
{
cgi
}
->
Vars
();
...
...
@@ -142,9 +126,29 @@ sub execute {
};
}
# Check the requested action
my
$action
=
$parameters
{
action
}
||
'
home
';
# initialize output parameters
$self
->
{
out
}
=
{
env
=>
{
REMOTE_HOST
=>
$ENV
{
REMOTE_HOST
},
REMOTE_ADDR
=>
$ENV
{
REMOTE_ADDR
},
SCRIPT_NAME
=>
$ENV
{
SCRIPT_NAME
}
},
conf
=>
{
accounts_validity_period
=>
$self
->
{
configuration
}
->
{
accounts_validity_period
},
app_name
=>
$self
->
{
configuration
}
->
{
app_name
},
app_url
=>
$self
->
{
configuration
}
->
{
app_url
},
idp_scope
=>
$self
->
{
configuration
}
->
{
idp_scope
},
idp_displayname
=>
$self
->
{
configuration
}
->
{
idp_displayname
},
support_email
=>
$self
->
{
configuration
}
->
{
support_email
},
version
=>
$self
->
{
configuration
}
->
{
version
},
},
action
=>
$action
,
title
=>
$self
->
{
configuration
}
->
{
app_name
}
};
# process requested action
if
(
$actions
{
$action
})
{
my
$method
=
$actions
{
$action
};
$status
=
$self
->
$method
();
...
...
@@ -183,7 +187,7 @@ sub respond {
my
$template
;
## nobanner is used to do AJAX to get only pieces of HTML to load in the web client
if
(
$self
->
{
in
}
->
{
style
}
eq
'
nobanner
')
{
if
(
$self
->
{
in
}
->
{
style
}
&&
$self
->
{
in
}
->
{
style
}
eq
'
nobanner
')
{
$template
=
'
web/index-nobanner.tt2.html
';
}
else
{
$template
=
'
web/index.tt2.html
';
...
...
@@ -255,6 +259,8 @@ sub req_account_wizard {
return
undef
;
}
$self
->
{
out
}
->
{
subtitle
}
=
'
Select your Service Provider
';
return
1
;
}
...
...
@@ -362,6 +368,7 @@ sub req_select_sp {
$self
->
{
out
}
->
{
sp_metadata_as_hashref
}
=
$federation_metadata
->
{
federation_metadata_as_hashref
}
->
[
0
];
$self
->
{
out
}
->
{
serviceprovider
}
=
$service_provider
;
$self
->
{
out
}
->
{
subtitle
}
=
'
Select your Service Provider
';
return
1
;
}
...
...
@@ -477,6 +484,7 @@ sub req_generate_token {
$self
->
{
out
}
->
{
to
}
=
$self
->
{
in
}
->
{
email_address
};
$self
->
{
out
}
->
{
authentication_token
}
=
$authentication_token
->
get
('
token
');
$self
->
{
out
}
->
{
subtitle
}
=
'
Generate an authentication token
';
## Send the challenge email with the token
IdPAccountManager::Tools::
mail_notice
(
...
...
@@ -607,6 +615,7 @@ sub req_validate_token {
$self
->
{
out
}
->
{
sp_entityid
}
=
$self
->
{
in
}
->
{
sp_entityid
};
$self
->
{
out
}
->
{
test_accounts
}
=
\
@test_accounts
;
$self
->
{
out
}
->
{
subtitle
}
=
'
Complete Email Challenge
';
return
1
;
}
...
...
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