Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app-monitorul-oficial
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
romania-libera
app-monitorul-oficial
Commits
3b2b4c4d
Commit
3b2b4c4d
authored
Mar 11, 2019
by
Munteanu Petrisor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add register post route
parent
1726d487
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
api.php
src/api.php
+4
-0
routes.php
src/routes.php
+29
-0
No files found.
src/api.php
View file @
3b2b4c4d
...
...
@@ -870,6 +870,10 @@ class API
3
=>
'UNEJ'
];
}
function
RegisterUser
(
$params
)
{
die
(
$params
);
}
}
?>
src/routes.php
View file @
3b2b4c4d
...
...
@@ -196,6 +196,35 @@ $app->get('/inregistrare', function ($request, $response, $args) {
})
->
setName
(
'inregistrare'
);
$app
->
post
(
'/inregistrare'
,
function
(
$request
,
$response
,
$args
)
{
if
(
!
$this
->
session
->
exists
(
'user_id'
))
{
$api
=
new
API
(
$this
);
if
(
empty
(
$args
))
{
$args
=
array
();
}
$params
=
$request
->
getParsedBody
();
if
(
!
empty
(
$params
))
{
$res
=
$api
->
RegisterUser
(
$params
);
if
(
!
empty
(
$res
))
{
if
(
$res
[
'info'
][
'http_code'
]
!==
200
)
{
$this
->
flash
->
addMessage
(
"error"
,
"Inregistrarea a esuat"
);
return
$response
->
withRedirect
(
$this
->
router
->
pathFor
(
'inregistrare'
),
303
);
}
else
{
return
$response
->
withRedirect
(
$this
->
router
->
pathFor
(
'home'
),
303
);
}
}
}
}
return
$response
->
withRedirect
(
$this
->
router
->
pathFor
(
'home'
),
303
);
})
->
setName
(
'inregistrare'
);
$app
->
post
(
'/autentificare'
,
function
(
$request
,
$response
,
$args
)
{
$api
=
new
API
(
$this
);
...
...
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