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
0d6758a9
Commit
0d6758a9
authored
Mar 13, 2019
by
Munteanu Petrisor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add register functionality without confirmation and without validation
parent
3b2b4c4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-9
api.php
src/api.php
+27
-2
routes.php
src/routes.php
+1
-1
inregistrare.phtml
templates/inregistrare.phtml
+6
-6
No files found.
src/api.php
View file @
0d6758a9
...
...
@@ -167,6 +167,9 @@ class API
}
}
// var_dump($response);
// die();
if
(
$info
[
'http_code'
]
!=
200
)
{
throw
new
Exception
(
'Internal API error'
);
}
...
...
@@ -871,8 +874,30 @@ class API
];
}
function
RegisterUser
(
$params
)
{
die
(
$params
);
function
RegisterUser
(
$params
)
{
// TODO validation on backend
$data
=
[
"active"
=>
true
,
"admin"
=>
false
,
"password"
=>
$params
[
"password"
],
"email"
=>
$params
[
"email"
],
// TODO get the group id from config file
"groupID"
=>
32
,
"contactID"
=>
0
,
"contact"
=>
[
"active"
=>
true
,
"address"
=>
$params
[
"address"
],
"mobile"
=>
$params
[
"phone"
],
"email"
=>
$params
[
"email"
],
"firstName"
=>
$params
[
"firstName"
],
"lastName"
=>
$params
[
"lastName"
],
"nin"
=>
$params
[
"nin"
],
"type"
=>
1
]
];
return
$this
->
Request
(
'POST'
,
'/users'
,
$data
);
}
}
...
...
src/routes.php
View file @
0d6758a9
...
...
@@ -215,7 +215,7 @@ $app->post('/inregistrare', function ($request, $response, $args) {
$this
->
flash
->
addMessage
(
"error"
,
"Inregistrarea a esuat"
);
return
$response
->
withRedirect
(
$this
->
router
->
pathFor
(
'inregistrare'
),
303
);
}
else
{
return
$response
->
withRedirect
(
$this
->
router
->
pathFor
(
'
hom
e'
),
303
);
return
$response
->
withRedirect
(
$this
->
router
->
pathFor
(
'
autentificar
e'
),
303
);
}
}
}
...
...
templates/inregistrare.phtml
View file @
0d6758a9
...
...
@@ -40,12 +40,12 @@
<div
class=
"card-content login-card-content"
>
<div
class=
"row"
>
<div
class=
"input-field col s12"
>
<input
placeholder=
"Nume"
id=
"name"
name=
"
n
ame"
type=
"text"
/>
<label
for=
"
n
ame"
>
Nume
</label>
<input
placeholder=
"Nume"
id=
"name"
name=
"
lastN
ame"
type=
"text"
/>
<label
for=
"
lastN
ame"
>
Nume
</label>
</div>
<div
class=
"input-field col s12"
>
<input
placeholder=
"Prenume"
id=
"surname"
name=
"
surn
ame"
type=
"text"
/>
<label
for=
"
surn
ame"
>
Prenume
</label>
<input
placeholder=
"Prenume"
id=
"surname"
name=
"
firstN
ame"
type=
"text"
/>
<label
for=
"
firstN
ame"
>
Prenume
</label>
</div>
<div
class=
"input-field col s12"
>
<input
placeholder=
"Adresa"
id=
"address"
name=
"address"
type=
"text"
/>
...
...
@@ -58,8 +58,8 @@
</div>
<div
class=
"input-field col s12"
>
<input
placeholder=
"CNP"
id=
"cnp"
name=
"
cnp
"
type=
"text"
/>
<label
for=
"
cnp
"
>
CNP
</label>
<input
placeholder=
"CNP"
id=
"cnp"
name=
"
nin
"
type=
"text"
/>
<label
for=
"
nin
"
>
CNP
</label>
</div>
<div
class=
"input-field col s12"
>
...
...
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