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
e19c2aad
Commit
e19c2aad
authored
Mar 01, 2017
by
Open Source Developer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
translation
parent
036f923a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
drupal/modules/epal/src/Controller/CurrentUser.php
drupal/modules/epal/src/Controller/CurrentUser.php
+40
-0
drupal/modules/epal/src/Controller/Login.php
drupal/modules/epal/src/Controller/Login.php
+4
-1
drupal/modules/epal/src/Entity/EpalStudentClass.php
drupal/modules/epal/src/Entity/EpalStudentClass.php
+1
-1
No files found.
drupal/modules/epal/src/Controller/CurrentUser.php
0 → 100644
View file @
e19c2aad
<?php
/**
* @file
* Contains \Drupal\query_example\Controller\QueryExampleController.
*/
namespace
Drupal\epal\Controller
;
use
Drupal\Core\Entity\Query\QueryFactory
;
use
Drupal\Core\Entity\EntityTypeManagerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Drupal\Core\Controller\ControllerBase
;
class
CurrentUser
extends
ControllerBase
{
public
function
content
()
{
// $name = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
$name
=
"LALALA"
;
$authToken
=
"no authToken"
;
$accessKey
=
"no accessKey"
;
if
(
\
Drupal
::
request
()
->
headers
->
has
(
'X-AUTH-TOKEN'
))
{
$authToken
=
\
Drupal
::
request
()
->
headers
->
get
(
'X-AUTH-TOKEN'
);
}
if
(
\
Drupal
::
request
()
->
headers
->
has
(
'X-ACCESS-KEY'
))
{
$accessKey
=
\
Drupal
::
request
()
->
headers
->
get
(
'X-ACCESS-KEY'
);
}
$response
=
new
JsonResponse
([
$name
]);
$response
->
headers
->
set
(
'X-AUTH-TOKEN'
,
'HELLOTOKEN'
);
return
$response
;
}
}
drupal/modules/epal/src/Controller/Login.php
View file @
e19c2aad
...
...
@@ -16,7 +16,7 @@ use Drupal\Core\Controller\ControllerBase;
* Controller routines for page example routes.
*/
class
Login
extends
ControllerBase
{
protected
$query_factory
;
public
function
__construct
(
EntityTypeManagerInterface
$entityTypeManager
,
QueryFactory
$query_factory
)
{
...
...
@@ -130,3 +130,6 @@ public function helloWorld() {
}
}
drupal/modules/epal/src/Entity/EpalStudentClass.php
View file @
e19c2aad
...
...
@@ -21,7 +21,7 @@ use Drupal\user\UserInterface;
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\epal\EpalStudentClassListBuilder",
* "views_data" = "Drupal\epal\Entity\EpalStudentClassViewsData",
*
"translation" = "Drupal\epal\EpalStudentClassTranslationHandler",
*
*
* "form" = {
* "default" = "Drupal\epal\Form\EpalStudentClassForm",
...
...
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