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
203ff8a3
Commit
203ff8a3
authored
Oct 30, 2015
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt oplog, category user added for login and logout
parent
ce319ad9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
+24
-4
xtt/lib/xtt/src/xtt_log.cpp
xtt/lib/xtt/src/xtt_log.cpp
+5
-0
xtt/lib/xtt/src/xtt_log.h
xtt/lib/xtt/src/xtt_log.h
+1
-0
xtt/lib/xtt/src/xtt_xnav.cpp
xtt/lib/xtt/src/xtt_xnav.cpp
+10
-1
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+8
-3
No files found.
xtt/lib/xtt/src/xtt_log.cpp
View file @
203ff8a3
...
@@ -165,6 +165,9 @@ void XttLog::category_to_string( xttlog_eCategory category, char *str)
...
@@ -165,6 +165,9 @@ void XttLog::category_to_string( xttlog_eCategory category, char *str)
case
xttlog_eCategory_GeConfirmCancel
:
case
xttlog_eCategory_GeConfirmCancel
:
strcpy
(
str
,
"GeConfirmCancel"
);
strcpy
(
str
,
"GeConfirmCancel"
);
break
;
break
;
case
xttlog_eCategory_User
:
strcpy
(
str
,
"User"
);
break
;
default:
default:
strcpy
(
str
,
""
);
strcpy
(
str
,
""
);
}
}
...
@@ -192,6 +195,8 @@ void XttLog::string_to_category( char *str, xttlog_eCategory *category)
...
@@ -192,6 +195,8 @@ void XttLog::string_to_category( char *str, xttlog_eCategory *category)
*
category
=
xttlog_eCategory_GeConfirmOk
;
*
category
=
xttlog_eCategory_GeConfirmOk
;
else
if
(
strcmp
(
str
,
"GeConfirmCancel"
)
==
0
)
else
if
(
strcmp
(
str
,
"GeConfirmCancel"
)
==
0
)
*
category
=
xttlog_eCategory_GeConfirmCancel
;
*
category
=
xttlog_eCategory_GeConfirmCancel
;
else
if
(
strcmp
(
str
,
"User"
)
==
0
)
*
category
=
xttlog_eCategory_User
;
else
else
*
category
=
xttlog_eCategory_
;
*
category
=
xttlog_eCategory_
;
}
}
...
...
xtt/lib/xtt/src/xtt_log.h
View file @
203ff8a3
...
@@ -54,6 +54,7 @@ typedef enum {
...
@@ -54,6 +54,7 @@ typedef enum {
xttlog_eCategory_Event
,
xttlog_eCategory_Event
,
xttlog_eCategory_GeConfirmOk
,
xttlog_eCategory_GeConfirmOk
,
xttlog_eCategory_GeConfirmCancel
,
xttlog_eCategory_GeConfirmCancel
,
xttlog_eCategory_User
,
xttlog_eCategory__
xttlog_eCategory__
}
xttlog_eCategory
;
}
xttlog_eCategory
;
...
...
xtt/lib/xtt/src/xtt_xnav.cpp
View file @
203ff8a3
...
@@ -3722,6 +3722,7 @@ int XNav::init_brow_base_cb( FlowCtx *fctx, void *client_data)
...
@@ -3722,6 +3722,7 @@ int XNav::init_brow_base_cb( FlowCtx *fctx, void *client_data)
BrowCtx
*
ctx
=
(
BrowCtx
*
)
fctx
;
BrowCtx
*
ctx
=
(
BrowCtx
*
)
fctx
;
BrowCtx
*
secondary_ctx
;
BrowCtx
*
secondary_ctx
;
int
sts
;
int
sts
;
char
msg
[
120
];
if
(
Lng
::
translatefile_coding
()
==
lng_eCoding_UTF_8
)
if
(
Lng
::
translatefile_coding
()
==
lng_eCoding_UTF_8
)
brow_SetTextCoding
(
ctx
,
flow_eTextCoding_UTF_8
);
brow_SetTextCoding
(
ctx
,
flow_eTextCoding_UTF_8
);
...
@@ -3788,6 +3789,9 @@ int XNav::init_brow_base_cb( FlowCtx *fctx, void *client_data)
...
@@ -3788,6 +3789,9 @@ int XNav::init_brow_base_cb( FlowCtx *fctx, void *client_data)
xnav
->
command
(
cmd
);
xnav
->
command
(
cmd
);
}
}
sprintf
(
msg
,
"User %s logged in"
,
xnav
->
user
);
XttLog
::
dlog
(
xttlog_eCategory_User
,
msg
,
0
,
0
);
// Execute the setup script
// Execute the setup script
xnav
->
gbl
.
setupscript_exec
(
xnav
);
xnav
->
gbl
.
setupscript_exec
(
xnav
);
...
@@ -3846,6 +3850,7 @@ int XNav::login()
...
@@ -3846,6 +3850,7 @@ int XNav::login()
char
systemgroup
[
80
];
char
systemgroup
[
80
];
pwr_sSecurity
sec
;
pwr_sSecurity
sec
;
char
username
[
80
];
char
username
[
80
];
char
msg
[
120
];
priv
=
base_priv
=
0
;
priv
=
base_priv
=
0
;
...
@@ -3865,9 +3870,13 @@ int XNav::login()
...
@@ -3865,9 +3870,13 @@ int XNav::login()
strcpy
(
user
,
username
);
strcpy
(
user
,
username
);
strcpy
(
base_user
,
username
);
strcpy
(
base_user
,
username
);
priv
=
base_priv
=
privilege
;
priv
=
base_priv
=
privilege
;
sprintf
(
msg
,
"User %s logged in"
,
username
);
XttLog
::
dlog
(
xttlog_eCategory_User
,
msg
,
0
,
0
);
return
XNAV__SUCCESS
;
return
XNAV__SUCCESS
;
}
}
priv
=
base_priv
=
sec
.
DefaultXttPriv
;
priv
=
base_priv
=
sec
.
DefaultXttPriv
;
XttLog
::
dlog
(
xttlog_eCategory_User
,
"No user logged in"
,
0
,
0
);
return
XNAV__SUCCESS
;
return
XNAV__SUCCESS
;
}
}
...
...
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
203ff8a3
...
@@ -629,10 +629,11 @@ static int xnav_define_func( void *client_data,
...
@@ -629,10 +629,11 @@ static int xnav_define_func( void *client_data,
static
void
xnav_login_success_bc
(
void
*
ctx
)
static
void
xnav_login_success_bc
(
void
*
ctx
)
{
{
XNav
*
xnav
=
(
XNav
*
)
ctx
;
XNav
*
xnav
=
(
XNav
*
)
ctx
;
char
msg
[
8
0
];
char
msg
[
12
0
];
CoLogin
::
get_login_info
(
0
,
0
,
xnav
->
user
,
(
unsigned
long
*
)
&
xnav
->
priv
,
0
);
CoLogin
::
get_login_info
(
0
,
0
,
xnav
->
user
,
(
unsigned
long
*
)
&
xnav
->
priv
,
0
);
sprintf
(
msg
,
"User %s logged in"
,
xnav
->
user
);
sprintf
(
msg
,
"User %s logged in"
,
xnav
->
user
);
XttLog
::
dlog
(
xttlog_eCategory_User
,
msg
,
0
,
0
);
xnav
->
cologin
=
0
;
xnav
->
cologin
=
0
;
xnav
->
message
(
'I'
,
msg
);
xnav
->
message
(
'I'
,
msg
);
if
(
xnav
->
op
)
if
(
xnav
->
op
)
...
@@ -653,7 +654,7 @@ static int xnav_login_func( void *client_data,
...
@@ -653,7 +654,7 @@ static int xnav_login_func( void *client_data,
char
arg2_str
[
80
];
char
arg2_str
[
80
];
char
systemgroup
[
80
];
char
systemgroup
[
80
];
unsigned
int
priv
;
unsigned
int
priv
;
char
msg
[
8
0
];
char
msg
[
12
0
];
sts
=
gdh_GetObjectInfo
(
"pwrNode-System.SystemGroup"
,
&
systemgroup
,
sts
=
gdh_GetObjectInfo
(
"pwrNode-System.SystemGroup"
,
&
systemgroup
,
sizeof
(
systemgroup
));
sizeof
(
systemgroup
));
...
@@ -682,6 +683,7 @@ static int xnav_login_func( void *client_data,
...
@@ -682,6 +683,7 @@ static int xnav_login_func( void *client_data,
strcpy
(
xnav
->
user
,
arg1_str
);
strcpy
(
xnav
->
user
,
arg1_str
);
xnav
->
priv
=
priv
;
xnav
->
priv
=
priv
;
sprintf
(
msg
,
"User %s logged in"
,
arg1_str
);
sprintf
(
msg
,
"User %s logged in"
,
arg1_str
);
XttLog
::
dlog
(
xttlog_eCategory_User
,
msg
,
0
,
0
);
xnav
->
message
(
'I'
,
msg
);
xnav
->
message
(
'I'
,
msg
);
if
(
xnav
->
op
)
if
(
xnav
->
op
)
xnav
->
op
->
set_title
(
xnav
->
user
);
xnav
->
op
->
set_title
(
xnav
->
user
);
...
@@ -693,17 +695,20 @@ static int xnav_logout_func( void *client_data,
...
@@ -693,17 +695,20 @@ static int xnav_logout_func( void *client_data,
void
*
client_flag
)
void
*
client_flag
)
{
{
XNav
*
xnav
=
(
XNav
*
)
client_data
;
XNav
*
xnav
=
(
XNav
*
)
client_data
;
char
msg
[
8
0
];
char
msg
[
12
0
];
int
window
=
ODD
(
dcli_get_qualifier
(
"/MESSAGEWINDOW"
,
0
,
0
));
int
window
=
ODD
(
dcli_get_qualifier
(
"/MESSAGEWINDOW"
,
0
,
0
));
if
(
strcmp
(
xnav
->
base_user
,
""
)
==
0
)
{
if
(
strcmp
(
xnav
->
base_user
,
""
)
==
0
)
{
sprintf
(
msg
,
"User %s logged out"
,
xnav
->
user
);
sprintf
(
msg
,
"User %s logged out"
,
xnav
->
user
);
XttLog
::
dlog
(
xttlog_eCategory_User
,
msg
,
0
,
0
);
xnav
->
message
(
'I'
,
msg
);
xnav
->
message
(
'I'
,
msg
);
if
(
window
)
if
(
window
)
xnav
->
wow
->
DisplayText
(
"Logout"
,
msg
);
xnav
->
wow
->
DisplayText
(
"Logout"
,
msg
);
}
}
else
{
else
{
sprintf
(
msg
,
"User %s logged out, returned to user %s"
,
xnav
->
user
,
xnav
->
base_user
);
XttLog
::
dlog
(
xttlog_eCategory_User
,
msg
,
0
,
0
);
sprintf
(
msg
,
"Returned to user %s"
,
xnav
->
base_user
);
sprintf
(
msg
,
"Returned to user %s"
,
xnav
->
base_user
);
xnav
->
message
(
'I'
,
msg
);
xnav
->
message
(
'I'
,
msg
);
if
(
window
)
if
(
window
)
...
...
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