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
1
Issues
1
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
Quentin Vrel
projet-cdaw
Commits
dba1827f
Commit
dba1827f
authored
Nov 24, 2020
by
Zohten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new DB
parent
bb698cdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
15 deletions
+31
-15
User.class.php
BackEnd/src/model/User.class.php
+24
-9
User.sql.php
BackEnd/src/sql/User.sql.php
+7
-6
No files found.
BackEnd/src/model/User.class.php
View file @
dba1827f
...
@@ -30,25 +30,40 @@ class User extends Model
...
@@ -30,25 +30,40 @@ class User extends Model
$stm
=
parent
::
exec
(
'USER_GET_WITH_LOGIN'
,
[
'login'
=>
$login
]);
$stm
=
parent
::
exec
(
'USER_GET_WITH_LOGIN'
,
[
'login'
=>
$login
]);
return
$stm
->
fetchAll
(
PDO
::
FETCH_CLASS
,
'User'
)[
0
];
return
$stm
->
fetchAll
(
PDO
::
FETCH_CLASS
,
'User'
)[
0
];
}
}
public
function
id
()
public
function
password
()
{
{
return
trim
(
$this
->
USER_PASSWORD
);
return
trim
(
$this
->
ID_USER
);
}
}
public
function
id
()
public
function
role
()
{
{
return
trim
(
$this
->
USER_ID
);
return
trim
(
$this
->
ID_ROLE
);
}
}
public
function
firstname
()
public
function
password
()
{
return
trim
(
$this
->
PASWORD
);
}
public
function
avatar
()
{
{
return
trim
(
$this
->
USER_FIRSTNAME
);
return
trim
(
$this
->
AVATAR
);
}
}
public
function
lastname
()
public
function
lastname
()
{
{
return
trim
(
$this
->
USER_LASTNAME
);
return
trim
(
$this
->
LASTNAME
);
}
public
function
firstname
()
{
return
trim
(
$this
->
FIRSTNAME
);
}
}
public
function
email
()
public
function
email
()
{
{
return
trim
(
$this
->
USER_EMAIL
);
return
trim
(
$this
->
MAIL
);
}
public
function
isBanned
()
{
return
trim
(
$this
->
BAN_ACCOUNT
);
}
public
function
lastIP
()
{
return
trim
(
$this
->
LAST_IP
);
}
}
}
}
BackEnd/src/sql/User.sql.php
View file @
dba1827f
...
@@ -2,30 +2,31 @@
...
@@ -2,30 +2,31 @@
User
::
addSqlQuery
(
User
::
addSqlQuery
(
'USER_LIST'
,
'USER_LIST'
,
'SELECT * FROM
USER ORDER BY USER_
LOGIN'
'SELECT * FROM
MJ_USER ORDER BY
LOGIN'
);
);
User
::
addSqlQuery
(
User
::
addSqlQuery
(
'USER_GET_WITH_LOGIN'
,
'USER_GET_WITH_LOGIN'
,
'SELECT * FROM
USER WHERE USER_
LOGIN=:login'
'SELECT * FROM
MJ_USER WHERE
LOGIN=:login'
);
);
User
::
addSqlQuery
(
User
::
addSqlQuery
(
'USER_GET_WITH_ID'
,
'USER_GET_WITH_ID'
,
'SELECT * FROM
USER WHERE USER_ID
=:id'
'SELECT * FROM
MJ_USER WHERE ID_USER
=:id'
);
);
//TODO
User
::
addSqlQuery
(
User
::
addSqlQuery
(
'USER_CREATE'
,
'USER_CREATE'
,
'INSERT INTO USER (USER_ID, USER_LOGIN, USER_EMAIL, USER_ROLE, USER_PASSWORD, USER_NAME, USER_SURNAME) VALUES (NULL, :login, :email, :role, :pwd, :name, :surname)'
'INSERT INTO
MJ_
USER (USER_ID, USER_LOGIN, USER_EMAIL, USER_ROLE, USER_PASSWORD, USER_NAME, USER_SURNAME) VALUES (NULL, :login, :email, :role, :pwd, :name, :surname)'
);
);
User
::
addSqlQuery
(
User
::
addSqlQuery
(
'USER_CONNECT'
,
'USER_CONNECT'
,
'SELECT * FROM
USER WHERE USER_LOGIN=:login and USER_PAS
SWORD=:password'
'SELECT * FROM
MJ_USER WHERE LOGIN=:login and PA
SWORD=:password'
);
);
User
::
addSqlQuery
(
User
::
addSqlQuery
(
'USER_UPDATE'
,
'USER_UPDATE'
,
'UPDATE
USER SET USER_EMAIL = :email WHERE USER_ID
= :id'
'UPDATE
MJ_USER SET MAIL = :email WHERE ID_USER
= :id'
);
);
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