Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Raphaël PEIM
projet-cdaw
Commits
3f5a8a8c
Commit
3f5a8a8c
authored
Nov 19, 2020
by
raphael.peim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish backend tp4
parent
3f469b49
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
45 additions
and
61 deletions
+45
-61
Response.class.php
Classes/BackEnd/tp4/classes/Response.class.php
+5
-0
UserController.class.php
Classes/BackEnd/tp4/controller/UserController.class.php
+16
-27
game.php
Project/FrontEnd/game.php
+1
-5
gameCreate.php
Project/FrontEnd/gameCreate.php
+1
-5
gameJoin.php
Project/FrontEnd/gameJoin.php
+1
-5
head.php
Project/FrontEnd/head.php
+4
-0
index.php
Project/FrontEnd/index.php
+2
-5
infos.php
Project/FrontEnd/infos.php
+3
-0
js.php
Project/FrontEnd/js.php
+7
-0
signup.js
Project/FrontEnd/js/signup.js
+1
-0
login.php
Project/FrontEnd/login.php
+2
-5
rules.php
Project/FrontEnd/rules.php
+1
-5
signup.php
Project/FrontEnd/signup.php
+1
-4
No files found.
Classes/BackEnd/tp4/classes/Response.class.php
View file @
3f5a8a8c
...
@@ -22,6 +22,11 @@
...
@@ -22,6 +22,11 @@
return
new
Response
(
400
,
$message
);
return
new
Response
(
400
,
$message
);
}
}
public
static
function
unauthorizedResponse
(
$message
=
""
)
{
return
new
Response
(
401
,
$message
);
}
public
static
function
notFoundResponse
(
$message
=
""
)
public
static
function
notFoundResponse
(
$message
=
""
)
{
{
return
new
Response
(
404
,
$message
);
return
new
Response
(
404
,
$message
);
...
...
Classes/BackEnd/tp4/controller/UserController.class.php
View file @
3f5a8a8c
...
@@ -74,33 +74,22 @@
...
@@ -74,33 +74,22 @@
protected
function
updateUser
(
$put
,
$id
)
{
protected
function
updateUser
(
$put
,
$id
)
{
$user
=
User
::
getWithId
(
$id
);
$user
=
User
::
getWithId
(
$id
);
// var_dump(Request::getCurrentRequest());
if
(
!
empty
(
$put
)
&&
!
empty
(
$user
))
{
$jwt_token
=
$this
->
request
->
getJwtToken
();
// if (!empty($put) && !empty($user)) {
$jwt
=
JWT
::
decode
(
$jwt_token
,
JWT_BACKEND_KEY
,
array
(
'HS256'
));
// try {
// $jwt_token = $this->request->getJwtToken();
if
(
$jwt
->
data
->
id
==
$id
)
{
// $decodedJWT = JWT::decode($jwt_token, JWT_BACKEND_KEY, array('HS256'));
User
::
update
(
$put
,
$id
);
$response
=
Response
::
okResponse
(
"Utilisateur modifié"
);
// var_dump($decodedJWT->data);
return
$response
;
// }
}
// catch (Exception $e){
else
{
// header('WWW-Authenticate: Bearer realm="' . JWT_ISSUER . '"');
return
Response
::
unauthorizedResponse
(
"Modification non autorisée"
);
}
// $jsonResult = json_encode(array(
}
// "message" => "Access denied.",
else
{
// "error" => $e->getMessage()
return
Response
::
notFoundResponse
(
"Aucun utilisateur modifié"
);
// ));
}
// return Response::unauthorizedResponse($jsonResult);
// }
// }
// else {
// return Response::notFoundResponse("Aucun utilisateur modifié");
// }
// User::update($put, $id);
// $response = Response::okResponse("Utilisateur modifié");
// return $response;
}
}
protected
function
deleteUser
(
$id
)
{
protected
function
deleteUser
(
$id
)
{
...
...
Project/FrontEnd/game.php
View file @
3f5a8a8c
...
@@ -32,10 +32,6 @@
...
@@ -32,10 +32,6 @@
<i
class=
"fas fa-angle-up"
></i>
<i
class=
"fas fa-angle-up"
></i>
</a>
</a>
<script
src=
"vendor/jquery/jquery.js"
></script>
<?php
require_once
(
'js.php'
);
?>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
<script
src=
"vendor/chart.js/Chart.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
Project/FrontEnd/gameCreate.php
View file @
3f5a8a8c
...
@@ -46,10 +46,6 @@
...
@@ -46,10 +46,6 @@
<i
class=
"fas fa-angle-up"
></i>
<i
class=
"fas fa-angle-up"
></i>
</a>
</a>
<script
src=
"vendor/jquery/jquery.js"
></script>
<?php
require_once
(
'js.php'
);
?>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
<script
src=
"vendor/chart.js/Chart.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
Project/FrontEnd/gameJoin.php
View file @
3f5a8a8c
...
@@ -53,10 +53,6 @@
...
@@ -53,10 +53,6 @@
<i
class=
"fas fa-angle-up"
></i>
<i
class=
"fas fa-angle-up"
></i>
</a>
</a>
<script
src=
"vendor/jquery/jquery.js"
></script>
<?php
require_once
(
'js.php'
);
?>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
<script
src=
"vendor/chart.js/Chart.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
Project/FrontEnd/head.php
View file @
3f5a8a8c
<?php
$page
=
explode
(
'.php'
,
end
(
explode
(
'/'
,
$_SERVER
[
'REQUEST_URI'
])))[
0
];
$page
=
$page
==
""
?
"index"
:
$page
;
?>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
...
...
Project/FrontEnd/index.php
View file @
3f5a8a8c
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<span
class=
"icon text-white-50"
>
<span
class=
"icon text-white-50"
>
<i
class=
"fas fa-book-open"
></i>
<i
class=
"fas fa-book-open"
></i>
</span>
</span>
<!-- <span class="text">Découvrez le mahjong</span> -->
<span
class=
"text"
>
Découvrez le mahjong
</span>
<span
class=
"text"
>
Découvrez le mahjong
</span>
</a>
</a>
<a
href=
"login.php"
class=
"btn btn-primary btn-icon-split btn-lg"
style=
"display: flex;"
>
<a
href=
"login.php"
class=
"btn btn-primary btn-icon-split btn-lg"
style=
"display: flex;"
>
...
@@ -43,10 +44,6 @@
...
@@ -43,10 +44,6 @@
<i
class=
"fas fa-angle-up"
></i>
<i
class=
"fas fa-angle-up"
></i>
</a>
</a>
<script
src=
"vendor/jquery/jquery.js"
></script>
<?php
require_once
(
'js.php'
);
?>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
<script
src=
"vendor/chart.js/Chart.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
Project/FrontEnd/infos.php
0 → 100644
View file @
3f5a8a8c
<?php
phpinfo
();
?>
\ No newline at end of file
Project/FrontEnd/js.php
0 → 100644
View file @
3f5a8a8c
<script
src=
"vendor/jquery/jquery.js"
></script>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
<script
src=
"vendor/chart.js/Chart.js"
></script>
<script
<?php
echo
"src=
\"
js/
$page
.js
\"
"
?>
></script>
\ No newline at end of file
Project/FrontEnd/js/signup.js
0 → 100644
View file @
3f5a8a8c
console
.
log
(
"Hey !"
);
\ No newline at end of file
Project/FrontEnd/login.php
View file @
3f5a8a8c
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<hr>
<hr>
</form>
</form>
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<a
class=
"small"
href=
"
register
.php"
>
Créer un compte
</a>
<a
class=
"small"
href=
"
signup
.php"
>
Créer un compte
</a>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -41,9 +41,6 @@
...
@@ -41,9 +41,6 @@
</div>
</div>
</div>
</div>
<script
src=
"vendor/jquery/jquery.js"
></script>
<?php
require_once
(
'js.php'
);
?>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
Project/FrontEnd/rules.php
View file @
3f5a8a8c
...
@@ -32,10 +32,6 @@
...
@@ -32,10 +32,6 @@
<i
class=
"fas fa-angle-up"
></i>
<i
class=
"fas fa-angle-up"
></i>
</a>
</a>
<script
src=
"vendor/jquery/jquery.js"
></script>
<?php
require_once
(
'js.php'
);
?>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
<script
src=
"vendor/chart.js/Chart.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
Project/FrontEnd/
register
.php
→
Project/FrontEnd/
signup
.php
View file @
3f5a8a8c
...
@@ -53,9 +53,6 @@
...
@@ -53,9 +53,6 @@
</div>
</div>
</div>
</div>
<script
src=
"vendor/jquery/jquery.js"
></script>
<?php
require_once
(
'js.php'
);
?>
<script
src=
"vendor/bootstrap/js/bootstrap.bundle.js"
></script>
<script
src=
"vendor/jquery-easing/jquery.easing.js"
></script>
<script
src=
"js/sb-admin-2.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
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