Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
57c2367a
Commit
57c2367a
authored
7 months ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetic improvements to indication of user status (deleted/inactive)
This should address issue
#787
parent
4beab2c6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#6631
passed
7 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/uedit/uedit.c
+23
-7
23 additions, 7 deletions
src/sbbs3/uedit/uedit.c
with
23 additions
and
7 deletions
src/sbbs3/uedit/uedit.c
+
23
−
7
View file @
57c2367a
...
...
@@ -1674,6 +1674,16 @@ void free_opts(char **opt)
free
(
opt
);
}
const
int
user_status_len
=
8
;
const
char
*
user_status
(
user_t
*
user
)
{
if
(
user
->
misc
&
DELETED
)
return
"DELETED"
;
if
(
user
->
misc
&
INACTIVE
)
return
"INACTIVE"
;
return
"active"
;
}
int
finduser
(
scfg_t
*
cfg
,
user_t
*
user
)
{
int
i
,
j
,
last
;
...
...
@@ -1703,7 +1713,9 @@ int finduser(scfg_t *cfg, user_t *user)
FREE_AND_NULL
(
opt
[
j
]);
if
((
opt
[
j
]
=
(
struct
user_list
*
)
malloc
(
sizeof
(
struct
user_list
)))
==
NULL
)
allocfail
(
sizeof
(
struct
user_list
));
sprintf
(
opt
[
j
]
->
info
,
"%1.1s%c%1.1s%c %-25.25s %c %-25.25s"
,
user
->
misc
&
DELETED
?
"Y"
:
"N"
,
sepchar
,
user
->
misc
&
INACTIVE
?
"Y"
:
"N"
,
sepchar
,
user
->
name
,
sepchar
,
user
->
alias
);
sprintf
(
opt
[
j
]
->
info
,
"%-*s%c %-25.25s %c %-25.25s"
,
user_status_len
,
user_status
(
user
),
sepchar
,
user
->
name
,
sepchar
,
user
->
alias
);
opt
[
j
++
]
->
usernum
=
i
;
}
}
...
...
@@ -1712,7 +1724,7 @@ int finduser(scfg_t *cfg, user_t *user)
allocfail
(
sizeof
(
struct
user_list
));
opt
[
j
]
->
info
[
0
]
=
0
;
i
=
0
;
sprintf
(
title
,
"
D%cI
%c Real Name %c Alias "
,
sepchar
,
sepchar
,
sepchar
);
sprintf
(
title
,
"
Status
%c Real Name %c Alias "
,
sepchar
,
sepchar
);
switch
(
uifc
.
list
(
WIN_ORG
|
WIN_MID
|
WIN_ACT
,
0
,
0
,
0
,
&
i
,
0
,
title
,(
char
**
)
opt
))
{
case
-
1
:
done
=
1
;
...
...
@@ -1754,7 +1766,9 @@ int getuser(scfg_t *cfg, user_t *user, char* str)
FREE_AND_NULL
(
opt
[
j
]);
if
((
opt
[
j
]
=
(
struct
user_list
*
)
malloc
(
sizeof
(
struct
user_list
)))
==
NULL
)
allocfail
(
sizeof
(
struct
user_list
));
sprintf
(
opt
[
j
]
->
info
,
"%1.1s%c%1.1s%c %-25.25s %c %-25.25s"
,
user
->
misc
&
DELETED
?
"Y"
:
"N"
,
sepchar
,
user
->
misc
&
INACTIVE
?
"Y"
:
"N"
,
sepchar
,
user
->
name
,
sepchar
,
user
->
alias
);
sprintf
(
opt
[
j
]
->
info
,
"%-*s%c %-25.25s %c %-25.25s"
,
user_status_len
,
user_status
(
user
),
sepchar
,
user
->
name
,
sepchar
,
user
->
alias
);
opt
[
j
++
]
->
usernum
=
i
;
}
}
...
...
@@ -1763,7 +1777,7 @@ int getuser(scfg_t *cfg, user_t *user, char* str)
allocfail
(
sizeof
(
struct
user_list
));
opt
[
j
]
->
info
[
0
]
=
0
;
i
=
0
;
sprintf
(
title
,
"
D%cI
%c Real Name %c Alias "
,
sepchar
,
sepchar
,
sepchar
);
sprintf
(
title
,
"
Status
%c Real Name %c Alias "
,
sepchar
,
sepchar
);
switch
(
uifc
.
list
(
WIN_ORG
|
WIN_MID
|
WIN_ACT
,
0
,
0
,
0
,
&
i
,
0
,
title
,(
char
**
)
opt
))
{
case
-
1
:
done
=
1
;
...
...
@@ -2129,11 +2143,13 @@ int main(int argc, char** argv) {
for
(
i
=
1
;
i
<=
last
;
i
++
)
{
user
.
number
=
i
;
GETUSERDAT
(
&
cfg
,
&
user
);
sprintf
(
opt
[
i
-
1
],
"%1.1s%c%1.1s%c %-25.25s %c %-25.25s"
,
user
.
misc
&
DELETED
?
"Y"
:
"N"
,
sepchar
,
user
.
misc
&
INACTIVE
?
"Y"
:
"N"
,
sepchar
,
user
.
name
,
sepchar
,
user
.
alias
);
sprintf
(
opt
[
i
-
1
],
"%-*s%c %-25.25s %c %-25.25s"
,
user_status_len
,
user_status
(
&
user
)
,
sepchar
,
user
.
name
,
sepchar
,
user
.
alias
);
}
opt
[
i
-
1
][
0
]
=
0
;
i
=
0
;
sprintf
(
str
,
"
%cD%cI
%c Real Name %c Alias "
,
sepchar
,
sepchar
,
sepchar
,
sepchar
);
sprintf
(
str
,
"
Status
%c Real Name %c Alias "
,
sepchar
,
sepchar
);
switch
(
uifc
.
list
(
WIN_ORG
|
WIN_MID
|
WIN_ACT
,
0
,
0
,
0
,
&
curuser
,
&
curbar
,
str
,
opt
))
{
case
-
1
:
done
=
1
;
...
...
@@ -2158,7 +2174,7 @@ int main(int argc, char** argv) {
}
opt
[
j
][
0
]
=
0
;
i
=
0
;
sprintf
(
str
,
"Num %c Real Name %c Alias "
,
sepchar
,
sepchar
);
sprintf
(
str
,
"
Num %c Real Name %c Alias "
,
sepchar
,
sepchar
);
switch
(
uifc
.
list
(
WIN_ORG
|
WIN_MID
|
WIN_ACT
,
0
,
0
,
0
,
&
i
,
0
,
str
,
opt
))
{
case
-
1
:
done
=
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment