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
ca98ee0d
Commit
ca98ee0d
authored
Aug 05, 2024
by
cam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
You can now edit users
parent
1eb5d96c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
32 deletions
+44
-32
View.EditUser.pas
kgOrdersClient/View.EditUser.pas
+4
-4
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+39
-27
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/View.EditUser.pas
View file @
ca98ee0d
...
@@ -157,7 +157,7 @@ begin
...
@@ -157,7 +157,7 @@ begin
'&access='
+
cbAccess
.
Text
+
'&access='
+
cbAccess
.
Text
+
'&newuser='
+
edtUsername
.
Text
+
'&newuser='
+
edtUsername
.
Text
+
'&rights='
+
edtRights
.
Text
+
'&rights='
+
edtRights
.
Text
+
'&
Perspective='
+
''
+
'&
perspective='
+
edtPerspective
.
Text
+
'&QB='
+
edtQB
.
Text
;
'&QB='
+
edtQB
.
Text
;
console
.
log
(
editOptions
);
console
.
log
(
editOptions
);
...
@@ -339,12 +339,12 @@ begin
...
@@ -339,12 +339,12 @@ begin
ShowNotification('Passwords must be between 6-20 characters!');
ShowNotification('Passwords must be between 6-20 characters!');
exit;
exit;
end;
end;
}
asm
asm
var
confirmationModal
=
new
bootstrap
.
Modal
(
document
.
getElementById
(
'confirmation_modal'
),
{
var
confirmationModal
=
new
bootstrap
.
Modal
(
document
.
getElementById
(
'confirmation_modal'
),
{
keyboard: false }
{
);
keyboard: false }
);
confirmationModal
.
show
();
confirmationModal
.
show
();
end;
}
end
;
end
;
end
;
end
.
end
.
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
ca98ee0d
...
@@ -242,19 +242,19 @@ function TLookupService.EditUser(const editOptions: string): string;
...
@@ -242,19 +242,19 @@ function TLookupService.EditUser(const editOptions: string): string;
var
var
params
:
TStringList
;
params
:
TStringList
;
user
:
string
;
user
:
string
;
first_name
:
string
;
password
:
string
;
last_name
:
string
;
full_name
:
string
;
full_name
:
string
;
status
:
string
;
email
:
string
;
email
:
string
;
phone
:
string
;
access
:
string
;
rights
:
string
;
perspective
:
string
;
QB
:
string
;
SQL
:
string
;
SQL
:
string
;
Admin
:
string
;
newUser
:
string
;
newUser
:
string
;
location
:
string
;
hashString
:
string
;
hashString
:
string
;
hashPW
:
string
;
hashPW
:
string
;
password
:
string
;
active
:
string
;
begin
begin
params
:=
TStringList
.
Create
;
params
:=
TStringList
.
Create
;
...
@@ -263,51 +263,63 @@ begin
...
@@ -263,51 +263,63 @@ begin
params
.
StrictDelimiter
:=
true
;
params
.
StrictDelimiter
:=
true
;
params
.
DelimitedText
:=
editOptions
;
params
.
DelimitedText
:=
editOptions
;
user
:=
params
.
Values
[
'username'
];
user
:=
params
.
Values
[
'username'
];
password
:=
params
.
Values
[
'password'
];
full_name
:=
params
.
Values
[
'fullname'
];
full_name
:=
params
.
Values
[
'fullname'
];
phone
:=
params
.
Values
[
'phonenumber
'
];
status
:=
params
.
Values
[
'status
'
];
email
:=
params
.
Values
[
'email'
];
email
:=
params
.
Values
[
'email'
];
Admin
:=
params
.
Values
[
'admin'
];
access
:=
params
.
Values
[
'access'
];
rights
:=
params
.
Values
[
'rights'
];
perspective
:=
params
.
Values
[
'perspective'
];
QB
:=
params
.
Values
[
'QB'
];
newUser
:=
params
.
Values
[
'newuser'
];
newUser
:=
params
.
Values
[
'newuser'
];
password
:=
params
.
Values
[
'password'
];
active
:=
params
.
Values
[
'active'
];
location
:=
params
.
Values
[
'location'
];
SQL
:=
'select * from users where
username
= '
+
QuotedStr
(
user
);
SQL
:=
'select * from users where
USER_NAME
= '
+
QuotedStr
(
user
);
doQuery
(
callsDB
.
UniQuery1
,
SQL
);
doQuery
(
callsDB
.
UniQuery1
,
SQL
);
if
callsDB
.
UniQuery1
.
IsEmpty
then
if
callsDB
.
UniQuery1
.
IsEmpty
then
Result
:=
'No such user found'
Result
:=
'
Failure:
No such user found'
else
else
begin
begin
callsDB
.
UniQuery1
.
Edit
;
callsDB
.
UniQuery1
.
Edit
;
//user.password := callsDB.UniQuery1.FieldByName('PASSWORD').AsString;
if
(
not
(
newUser
.
IsEmpty
))
then
if
(
not
(
newUser
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
username
'
).
AsString
:=
newUser
;
callsDB
.
UniQuery1
.
FieldByName
(
'
USER_NAME
'
).
AsString
:=
newUser
;
if
(
not
(
full_name
.
IsEmpty
))
then
if
(
not
(
full_name
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
full_name
'
).
AsString
:=
full_name
;
callsDB
.
UniQuery1
.
FieldByName
(
'
NAME
'
).
AsString
:=
full_name
;
if
(
not
(
phone
.
IsEmpty
))
then
if
(
not
(
status
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'phone_number'
).
AsString
:=
phone
;
begin
if
(
StrToBool
(
status
)
)
then
callsDB
.
UniQuery1
.
FieldByName
(
'STATUS'
).
AsString
:=
'ACTIVE'
else
callsDB
.
UniQuery1
.
FieldByName
(
'STATUS'
).
AsString
:=
'INACTIVE'
end
;
if
(
not
(
email
.
IsEmpty
))
then
if
(
not
(
email
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'email'
).
AsString
:=
email
;
callsDB
.
UniQuery1
.
FieldByName
(
'EMAIL'
).
AsString
:=
email
;
if
(
not
(
access
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'ACCESS_TYPE'
).
AsString
:=
Access
;
if
(
not
(
Admin
.
IsEmpty
))
then
if
(
not
(
rights
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
admin'
).
AsBoolean
:=
StrToBool
(
Admin
);
callsDB
.
UniQuery1
.
FieldByName
(
'
SYSTEM_RIGHTS'
).
AsInteger
:=
StrToInt
(
rights
);
if
(
not
(
A
ctive
.
IsEmpty
))
then
if
(
not
(
perspe
ctive
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
active'
).
AsBoolean
:=
StrToBool
(
Active
)
;
callsDB
.
UniQuery1
.
FieldByName
(
'
PERSPECTIVE_ID'
).
AsString
:=
perspective
;
if
(
not
(
Location
.
IsEmpty
))
then
if
(
not
(
access
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
default_location'
).
asString
:=
location
;
callsDB
.
UniQuery1
.
FieldByName
(
'
QB_ID'
).
AsString
:=
QB
;
if
((
not
(
Password
=
'hidden'
))
and
(
not
(
Password
.
IsEmpty
)))
then
{if((not (Password = 'hidden')) and (not (Password.IsEmpty))) then
begin
begin
hashString := callsDB.UniQuery1.FieldByName('date_created').AsString + password;
hashString := callsDB.UniQuery1.FieldByName('date_created').AsString + password;
hashPW := THashSHA2.GetHashString(hashString, THashSHA2.TSHA2Version.SHA512).ToUpper;
hashPW := THashSHA2.GetHashString(hashString, THashSHA2.TSHA2Version.SHA512).ToUpper;
callsDB.UniQuery1.FieldByName('password').AsString := hashPW;
callsDB.UniQuery1.FieldByName('password').AsString := hashPW;
end
;
end;
}
callsDB
.
UniQuery1
.
Post
;
callsDB
.
UniQuery1
.
Post
;
Result
:=
'Success:Edit Successful'
;
Result
:=
'Success:Edit Successful'
;
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
ca98ee0d
[Options]
[Options]
LogFileNum
=
17
LogFileNum
=
20
UpdateTimerLength
=
0
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