Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
KGOrders
Overview
Overview
Details
Activity
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
Cam Hayes
KGOrders
Commits
15e7be69
Commit
15e7be69
authored
Aug 07, 2024
by
cam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add User is now working but User ID needs to be discussed
parent
ca98ee0d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
19 deletions
+50
-19
View.EditUser.pas
kgOrdersClient/View.EditUser.pas
+9
-6
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+40
-12
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/View.EditUser.pas
View file @
15e7be69
...
...
@@ -113,13 +113,16 @@ var
xdcResponse
:
TXDataClientResponse
;
responseString
:
TJSObject
;
begin
userInfo
:=
'&username='
+
string
(
edtUsername
.
Text
).
ToLower
+
'&password='
+
edtPassword
.
Text
+
userInfo
:=
'&username='
+
Username
+
'&fullname='
+
edtFullName
.
Text
+
//'&phonenumber=' + edtPhoneNumber.Text +
'&email='
+
edtEmail
.
Text
;
//'&admin=' + BoolToStr(cbAdmin.Checked) +
//'&location=' + wcbLocation.Value;
'&password='
+
edtPassword
.
Text
+
'&status='
+
BoolToStr
(
cbStatus
.
Checked
)
+
'&email='
+
edtEmail
.
Text
+
'&access='
+
cbAccess
.
Text
+
'&newuser='
+
edtUsername
.
Text
+
'&rights='
+
edtRights
.
Text
+
'&perspective='
+
edtPerspective
.
Text
+
'&QB='
+
edtQB
.
Text
;
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.AddUser'
,
[
userInfo
]));
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
15e7be69
...
...
@@ -310,7 +310,7 @@ begin
if
(
not
(
perspective
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'PERSPECTIVE_ID'
).
AsString
:=
perspective
;
if
(
not
(
access
.
IsEmpty
))
then
if
(
not
(
QB
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'QB_ID'
).
AsString
:=
QB
;
...
...
@@ -330,9 +330,18 @@ end;
function
TLookupService
.
AddUser
(
userInfo
:
string
):
string
;
var
user
:
string
;
password
:
string
;
full_name
:
string
;
status
:
string
;
email
:
string
;
access
:
string
;
rights
:
string
;
perspective
:
string
;
QB
:
string
;
SQL
:
string
;
dateCreated
:
TDateTime
;
hashString
:
string
;
SQL
:
string
;
hashPW
:
string
;
params
:
TStringList
;
begin
...
...
@@ -342,8 +351,18 @@ begin
params
.
Delimiter
:=
'&'
;
params
.
DelimitedText
:=
userInfo
;
dateCreated
:=
now
;
hashString
:=
DateTimeToStr
(
dateCreated
)
+
params
.
Values
[
'password'
];
hashPW
:=
THashSHA2
.
GetHashString
(
hashString
,
THashSHA2
.
TSHA2Version
.
SHA512
).
ToUpper
;
user
:=
params
.
Values
[
'username'
];
password
:=
params
.
Values
[
'password'
];
full_name
:=
params
.
Values
[
'fullname'
];
status
:=
params
.
Values
[
'status'
];
email
:=
params
.
Values
[
'email'
];
access
:=
params
.
Values
[
'access'
];
rights
:=
params
.
Values
[
'rights'
];
perspective
:=
params
.
Values
[
'perspective'
];
QB
:=
params
.
Values
[
'QB'
];
//newUser := params.Values['newuser'];
//hashString := DateTimeToStr(dateCreated) + params.Values['password'];
//hashPW := THashSHA2.GetHashString(hashString, THashSHA2.TSHA2Version.SHA512).ToUpper;
SQL
:=
'select * from users where username = '
+
QuotedStr
(
params
.
Values
[
'username'
].
toLower
);
callsDB
.
UniQuery1
.
Close
;
callsDB
.
UniQuery1
.
SQL
.
Text
:=
SQL
;
...
...
@@ -352,14 +371,23 @@ begin
begin
callsDB
.
UniQuery1
.
Insert
;
callsDB
.
UniQuery1
.
FieldByName
(
'username'
).
AsString
:=
params
.
Values
[
'username'
].
toLower
;
callsDB
.
UniQuery1
.
FieldByName
(
'password'
).
AsString
:=
THashSHA2
.
GetHashString
(
hashString
,
THashSHA2
.
TSHA2Version
.
SHA512
).
ToUpper
;
callsDB
.
UniQuery1
.
FieldByName
(
'date_created'
).
AsString
:=
DateTimeToStr
(
dateCreated
);
callsDB
.
UniQuery1
.
FieldByName
(
'full_name'
).
AsString
:=
params
.
Values
[
'fullname'
];
callsDB
.
UniQuery1
.
FieldByName
(
'phone_number'
).
AsString
:=
params
.
Values
[
'phonenumber'
];
callsDB
.
UniQuery1
.
FieldByName
(
'email'
).
AsString
:=
params
.
Values
[
'email'
];
callsDB
.
UniQuery1
.
FieldByName
(
'admin'
).
AsBoolean
:=
StrToBool
(
params
.
Values
[
'admin'
]);
callsDB
.
UniQuery1
.
FieldByName
(
'USER_NAME'
).
AsString
:=
user
;
callsDB
.
UniQuery1
.
FieldByName
(
'PASSWORD'
).
AsString
:=
password
;
//THashSHA2.GetHashString(hashString, THashSHA2.TSHA2Version.SHA512).ToUpper;
//callsDB.UniQuery1.FieldByName('date_created').AsString := DateTimeToStr(dateCreated);
callsDB
.
UniQuery1
.
FieldByName
(
'NAME'
).
AsString
:=
full_name
;
if
(
StrToBool
(
status
)
)
then
callsDB
.
UniQuery1
.
FieldByName
(
'STATUS'
).
AsString
:=
'ACTIVE'
else
callsDB
.
UniQuery1
.
FieldByName
(
'STATUS'
).
AsString
:=
'INACTIVE'
;
callsDB
.
UniQuery1
.
FieldByName
(
'EMAIL'
).
AsString
:=
email
;
callsDB
.
UniQuery1
.
FieldByName
(
'ACCESS_TYPE'
).
AsString
:=
Access
;
callsDB
.
UniQuery1
.
FieldByName
(
'SYSTEM_RIGHTS'
).
AsInteger
:=
StrToInt
(
rights
);
callsDB
.
UniQuery1
.
FieldByName
(
'PERSPECTIVE_ID'
).
AsString
:=
perspective
;
callsDB
.
UniQuery1
.
FieldByName
(
'QB_ID'
).
AsString
:=
QB
;
callsDB
.
UniQuery1
.
Post
;
Result
:=
'Success:User successfully added'
;
end
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
15e7be69
[Options]
LogFileNum
=
2
0
LogFileNum
=
2
1
UpdateTimerLength
=
0
...
...
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