projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9eeafab
)
Further hacks to CtdlRoomAccess() to support guest mode
author
Art Cancro
<ajc@citadel.org>
Fri, 3 Sep 2010 14:51:50 +0000
(10:51 -0400)
committer
Art Cancro
<ajc@citadel.org>
Fri, 3 Sep 2010 14:51:50 +0000
(10:51 -0400)
citadel/room_ops.c
patch
|
blob
|
history
diff --git
a/citadel/room_ops.c
b/citadel/room_ops.c
index f450fe2539c890b3a861fb8400f45a4827dfba50..de180edf35bd8e9cc9f7a9c45896c0153fd23eec 100644
(file)
--- a/
citadel/room_ops.c
+++ b/
citadel/room_ops.c
@@
-53,19
+53,15
@@
void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
int retval = 0;
visit vbuf;
int is_me = 0;
int retval = 0;
visit vbuf;
int is_me = 0;
+ int is_guest = 0;
if (userbuf == &CC->user) {
is_me = 1;
}
if (userbuf == &CC->user) {
is_me = 1;
}
- /*** temporary ObviousLog(tm) -- disregard this
- if (is_me) {
- CtdlLogPrintf(CTDL_DEBUG, "\033[32muserbuf==CC\033[0m\n");
+ if ((is_me) && (config.c_guest_logins) && (!CC->logged_in)) {
+ is_guest = 1;
}
}
- else {
- CtdlLogPrintf(CTDL_DEBUG, "\033[31muserbuf!=CC\033[0m\n");
- }
- ***/
/* for internal programs, always do everything */
if (((CC->internal_pgm)) && (roombuf->QRflags & QR_INUSE)) {
/* for internal programs, always do everything */
if (((CC->internal_pgm)) && (roombuf->QRflags & QR_INUSE)) {
@@
-75,19
+71,19
@@
void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
}
/* If guest mode is enabled, always grant access to the Lobby */
}
/* If guest mode is enabled, always grant access to the Lobby */
- if (
- (is_me)
- && (!CC->logged_in)
- && (config.c_guest_logins)
- && (!strcasecmp(roombuf->QRname, BASEROOM))
- ) {
+ if ((is_guest) && (!strcasecmp(roombuf->QRname, BASEROOM))) {
retval = (UA_KNOWN | UA_GOTOALLOWED);
vbuf.v_view = 0;
goto SKIP_EVERYTHING;
}
/* Locate any applicable user/room relationships */
retval = (UA_KNOWN | UA_GOTOALLOWED);
vbuf.v_view = 0;
goto SKIP_EVERYTHING;
}
/* Locate any applicable user/room relationships */
- CtdlGetRelationship(&vbuf, userbuf, roombuf);
+ if (is_guest) {
+ memset(&vbuf, 0, sizeof vbuf);
+ }
+ else {
+ CtdlGetRelationship(&vbuf, userbuf, roombuf);
+ }
/* Force the properties of the Aide room */
if (!strcasecmp(roombuf->QRname, config.c_aideroom)) {
/* Force the properties of the Aide room */
if (!strcasecmp(roombuf->QRname, config.c_aideroom)) {