Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
e-epal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
5a270a91
Commit
5a270a91
authored
Mar 23, 2017
by
Open Source Developer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transfer
parent
5c33da95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
drupal/modules/epal/epal.routing.yml
drupal/modules/epal/epal.routing.yml
+1
-1
drupal/modules/epal/src/Controller/SubmitedApplications.php
drupal/modules/epal/src/Controller/SubmitedApplications.php
+19
-3
No files found.
drupal/modules/epal/epal.routing.yml
View file @
5a270a91
...
...
@@ -19,7 +19,7 @@ submitedapplications:
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
_controller
:
'
\Drupal\epal\Controller\Submit
tedApplication
::getSubmittedApplications'
_controller
:
'
\Drupal\epal\Controller\Submit
edApplications
::getSubmittedApplications'
requirements
:
_user_is_logged_in
:
'
TRUE'
epal.application_submit
:
...
...
drupal/modules/epal/src/Controller/SubmitedApplications.php
View file @
5a270a91
...
...
@@ -9,7 +9,7 @@ use Drupal\Core\Controller\ControllerBase;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
class
Submit
tedApplication
extends
ControllerBase
class
Submit
edApplications
extends
ControllerBase
{
protected
$entityTypeManager
;
...
...
@@ -29,9 +29,25 @@ class SubmittedApplication extends ControllerBase
public
function
getSubmittedApplications
(
Request
$request
)
{
return
"aaaaaaaaaaaaaaaaa"
;
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$epalUsers
=
$this
->
entityTypeManager
->
getStorage
(
'epal_users'
)
->
loadByProperties
(
array
(
'authtoken'
=>
$authToken
));
$epalUser
=
reset
(
$epalUsers
);
if
(
$epalUser
)
{
return
$this
->
respondWithStatus
([
'id'
=>
$epalUser
->
entity
->
id
(),
],
Response
::
HTTP_OK
);
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"EPAL user not found"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
private
function
respondWithStatus
(
$arr
,
$s
)
{
$res
=
new
JsonResponse
(
$arr
);
$res
->
setStatusCode
(
$s
);
return
$res
;
}
}
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