Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
2cb411b7
Commit
2cb411b7
authored
Jun 24, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User database layout changed
parent
7f3a3efe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
18 deletions
+59
-18
src/lib/rt/src/rt_pvd_udb.cpp
src/lib/rt/src/rt_pvd_udb.cpp
+56
-17
src/lib/rt/src/rt_pvd_udb.h
src/lib/rt/src/rt_pvd_udb.h
+3
-1
No files found.
src/lib/rt/src/rt_pvd_udb.cpp
View file @
2cb411b7
/*
* Proview $Id: rt_pvd_udb.cpp,v 1.
1 2006-09-15 09:33:20
claes Exp $
* Proview $Id: rt_pvd_udb.cpp,v 1.
2 2008-06-24 07:15:31
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -47,7 +47,7 @@ void rt_pvd_udb::save( pwr_tStatus *sts)
case
pwr_cClass_SystemGroupReg
:
{
pwr_sClass_SystemGroupReg
*
body
=
(
pwr_sClass_SystemGroupReg
*
)
m_list
[
i
].
body
;
*
sts
=
gu
->
add_system
(
groupname
(
longname
(
m_list
[
i
].
oix
)),
body
->
Attributes
);
*
sts
=
gu
->
add_system
(
groupname
(
longname
(
m_list
[
i
].
oix
)),
body
->
Attributes
,
body
->
Description
,
m_list
[
i
].
oix
-
1
);
if
(
EVEN
(
*
sts
))
return
;
break
;
}
...
...
@@ -61,7 +61,8 @@ void rt_pvd_udb::save( pwr_tStatus *sts)
*
s
=
0
;
*
sts
=
gu
->
add_user
(
groupname
(
gname
),
m_list
[
i
].
name
,
body
->
Password
,
body
->
Privileges
);
body
->
Privileges
,
body
->
FullName
,
body
->
Description
,
body
->
Email
,
body
->
Phone
,
body
->
Sms
,
m_list
[
i
].
oix
-
1
);
if
(
EVEN
(
*
sts
))
return
;
break
;
}
...
...
@@ -143,7 +144,19 @@ void rt_pvd_udb::load_systemgroup( SystemList *systemgroup)
char
sname
[
120
];
char
*
s
;
item
.
oix
=
next_oix
++
;
body
=
(
pwr_sClass_SystemGroupReg
*
)
calloc
(
1
,
sizeof
(
pwr_sClass_SystemGroupReg
));
item
.
body
=
body
;
gu
->
get_system_name
(
systemgroup
,
sname
);
if
((
s
=
strrchr
(
sname
,
'.'
)))
strcpy
(
item
.
name
,
s
+
1
);
else
strcpy
(
item
.
name
,
sname
);
gu
->
get_system_data
(
sname
,
&
body
->
Attributes
,
&
item
.
oix
,
body
->
Description
);
item
.
oix
++
;
if
(
next_oix
<=
item
.
oix
)
next_oix
=
item
.
oix
+
1
;
item
.
cid
=
pwr_cClass_SystemGroupReg
;
item
.
fthoix
=
menu_stack
[
menu_cnt
-
1
];
item
.
bwsoix
=
m_list
[
item
.
fthoix
].
lchoix
;
...
...
@@ -154,18 +167,12 @@ void rt_pvd_udb::load_systemgroup( SystemList *systemgroup)
m_list
[
item
.
fthoix
].
lchoix
=
item
.
oix
;
item
.
body_size
=
sizeof
(
pwr_sClass_SystemGroupReg
);
body
=
(
pwr_sClass_SystemGroupReg
*
)
calloc
(
1
,
item
.
body_size
);
item
.
body
=
body
;
gu
->
get_system_name
(
systemgroup
,
sname
);
if
((
s
=
strrchr
(
sname
,
'.'
)))
strcpy
(
item
.
name
,
s
+
1
);
else
strcpy
(
item
.
name
,
sname
);
gu
->
get_system_data
(
sname
,
&
body
->
Attributes
);
menu_stack
[
menu_cnt
]
=
item
.
oix
;
menu_cnt
++
;
m_list
.
push_back
(
item
);
if
(
m_list
.
size
()
<=
item
.
oix
+
1
)
m_list
.
resize
(
item
.
oix
+
1
);
m_list
[
item
.
oix
]
=
item
;
UserList
*
user
=
systemgroup
->
first_user
();
while
(
user
)
{
...
...
@@ -187,7 +194,14 @@ void rt_pvd_udb::load_user( UserList *user, SystemList *sg)
procom_obj
item
;
pwr_sClass_UserReg
*
body
;
item
.
oix
=
next_oix
++
;
body
=
(
pwr_sClass_UserReg
*
)
calloc
(
1
,
sizeof
(
pwr_sClass_UserReg
));
user
->
get_data
(
body
->
Password
,
&
body
->
Privileges
,
&
item
.
oix
,
body
->
FullName
,
body
->
Description
,
body
->
Email
,
body
->
Phone
,
body
->
Sms
);
item
.
oix
++
;
if
(
next_oix
<=
item
.
oix
)
next_oix
=
item
.
oix
+
1
;
item
.
cid
=
pwr_cClass_UserReg
;
item
.
fthoix
=
menu_stack
[
menu_cnt
-
1
];
item
.
bwsoix
=
m_list
[
item
.
fthoix
].
lchoix
;
...
...
@@ -198,16 +212,41 @@ void rt_pvd_udb::load_user( UserList *user, SystemList *sg)
m_list
[
item
.
fthoix
].
lchoix
=
item
.
oix
;
item
.
body_size
=
sizeof
(
pwr_sClass_UserReg
);
body
=
(
pwr_sClass_UserReg
*
)
calloc
(
1
,
item
.
body_size
);
item
.
body
=
body
;
strcpy
(
item
.
name
,
user
->
get_name
());
user
->
get_data
(
body
->
Password
,
&
body
->
Privileges
);
m_list
.
push_back
(
item
);
if
(
m_list
.
size
()
<=
item
.
oix
+
1
)
m_list
.
resize
(
item
.
oix
+
1
);
m_list
[
item
.
oix
]
=
item
;
// m_list.push_back( item);
}
void
rt_pvd_udb
::
writeAttribute
(
co_procom
*
pcom
,
pwr_tOix
oix
,
unsigned
int
offset
,
unsigned
int
size
,
char
*
buffer
)
{
if
(
oix
>=
m_list
.
size
()
||
oix
<=
0
)
{
pcom
->
provideStatus
(
LDH__NOSUCHOBJ
);
return
;
}
if
(
offset
+
size
>
m_list
[
oix
].
body_size
)
{
pcom
->
provideStatus
(
LDH__NOSUCHATTR
);
return
;
}
// Crypt password
if
(
m_list
[
oix
].
cid
==
pwr_cClass_UserReg
&&
(
int
)
offset
==
(
char
*
)((
pwr_sClass_UserReg
*
)
m_list
[
oix
].
body
)
->
Password
-
(
char
*
)
m_list
[
oix
].
body
)
{
pwr_tString40
pw
;
strncpy
(
pw
,
UserList
::
pwcrypt
(
buffer
),
sizeof
(
pw
));
memcpy
(
(
void
*
)((
unsigned
long
)
m_list
[
oix
].
body
+
(
unsigned
long
)
offset
),
pw
,
size
);
}
else
memcpy
(
(
void
*
)((
unsigned
long
)
m_list
[
oix
].
body
+
(
unsigned
long
)
offset
),
buffer
,
size
);
pcom
->
provideStatus
(
1
);
}
...
...
src/lib/rt/src/rt_pvd_udb.h
View file @
2cb411b7
/*
* Proview $Id: rt_pvd_udb.h,v 1.
1 2006-09-15 09:33:20
claes Exp $
* Proview $Id: rt_pvd_udb.h,v 1.
2 2008-06-24 07:15:31
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -37,6 +37,8 @@ public:
void
load_user
(
UserList
*
user
,
SystemList
*
sg
);
void
save
(
pwr_tStatus
*
sts
);
char
*
groupname
(
char
*
name
);
void
writeAttribute
(
co_procom
*
pcom
,
pwr_tOix
oix
,
unsigned
int
offset
,
unsigned
int
size
,
char
*
buffer
);
GeUser
*
gu
;
int
menu_stack
[
100
];
...
...
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