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
Show 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
'&access='
+
cbAccess
.
Text
+
'&newuser='
+
edtUsername
.
Text
+
'&rights='
+
edtRights
.
Text
+
'&
Perspective='
+
''
+
'&
perspective='
+
edtPerspective
.
Text
+
'&QB='
+
edtQB
.
Text
;
console
.
log
(
editOptions
);
...
...
@@ -339,12 +339,12 @@ begin
ShowNotification('Passwords must be between 6-20 characters!');
exit;
end;
}
asm
var
confirmationModal
=
new
bootstrap
.
Modal
(
document
.
getElementById
(
'confirmation_modal'
),
{
keyboard: false }
{
);
keyboard: false }
);
confirmationModal
.
show
();
end;
}
end
;
end
;
end
.
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
ca98ee0d
...
...
@@ -242,19 +242,19 @@ function TLookupService.EditUser(const editOptions: string): string;
var
params
:
TStringList
;
user
:
string
;
first_name
:
string
;
last_name
:
string
;
password
:
string
;
full_name
:
string
;
status
:
string
;
email
:
string
;
phone
:
string
;
access
:
string
;
rights
:
string
;
perspective
:
string
;
QB
:
string
;
SQL
:
string
;
Admin
:
string
;
newUser
:
string
;
location
:
string
;
hashString
:
string
;
hashPW
:
string
;
password
:
string
;
active
:
string
;
begin
params
:=
TStringList
.
Create
;
...
...
@@ -263,51 +263,63 @@ begin
params
.
StrictDelimiter
:=
true
;
params
.
DelimitedText
:=
editOptions
;
user
:=
params
.
Values
[
'username'
];
password
:=
params
.
Values
[
'password'
];
full_name
:=
params
.
Values
[
'fullname'
];
phone
:=
params
.
Values
[
'phonenumber
'
];
status
:=
params
.
Values
[
'status
'
];
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'
];
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
);
if
callsDB
.
UniQuery1
.
IsEmpty
then
Result
:=
'No such user found'
Result
:=
'
Failure:
No such user found'
else
begin
callsDB
.
UniQuery1
.
Edit
;
//user.password := callsDB.UniQuery1.FieldByName('PASSWORD').AsString;
if
(
not
(
newUser
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
username
'
).
AsString
:=
newUser
;
callsDB
.
UniQuery1
.
FieldByName
(
'
USER_NAME
'
).
AsString
:=
newUser
;
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
callsDB
.
UniQuery1
.
FieldByName
(
'phone_number'
).
AsString
:=
phone
;
if
(
not
(
status
.
IsEmpty
))
then
begin
if
(
StrToBool
(
status
)
)
then
callsDB
.
UniQuery1
.
FieldByName
(
'STATUS'
).
AsString
:=
'ACTIVE'
else
callsDB
.
UniQuery1
.
FieldByName
(
'STATUS'
).
AsString
:=
'INACTIVE'
end
;
if
(
not
(
email
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
email
'
).
AsString
:=
email
;
callsDB
.
UniQuery1
.
FieldByName
(
'
EMAIL
'
).
AsString
:=
email
;
if
(
not
(
Admin
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
admin'
).
AsBoolean
:=
StrToBool
(
Admin
)
;
if
(
not
(
access
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
ACCESS_TYPE'
).
AsString
:=
Access
;
if
(
not
(
Active
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
active'
).
AsBoolean
:=
StrToBool
(
Active
);
if
(
not
(
rights
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
SYSTEM_RIGHTS'
).
AsInteger
:=
StrToInt
(
rights
);
if
(
not
(
Location
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
default_location'
).
asString
:=
location
;
if
(
not
(
perspective
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'
PERSPECTIVE_ID'
).
AsString
:=
perspective
;
if
((
not
(
Password
=
'hidden'
))
and
(
not
(
Password
.
IsEmpty
)))
then
if
(
not
(
access
.
IsEmpty
))
then
callsDB
.
UniQuery1
.
FieldByName
(
'QB_ID'
).
AsString
:=
QB
;
{if((not (Password = 'hidden')) and (not (Password.IsEmpty))) then
begin
hashString := callsDB.UniQuery1.FieldByName('date_created').AsString + password;
hashPW := THashSHA2.GetHashString(hashString, THashSHA2.TSHA2Version.SHA512).ToUpper;
callsDB.UniQuery1.FieldByName('password').AsString := hashPW;
end
;
end;
}
callsDB
.
UniQuery1
.
Post
;
Result
:=
'Success:Edit Successful'
;
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
ca98ee0d
[Options]
LogFileNum
=
17
LogFileNum
=
20
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