return(-1);
}
- if (CC->user.axlevel >= 6) return(0);
+ if (CC->user.axlevel >= AxAideU) return(0);
if (required_level >= ac_aide) {
cprintf("%d This command requires Aide access.\n",
ERROR + HIGHER_ACCESS_REQUIRED);
if (session_num == ccptr->cs_pid) {
ret |= TERM_FOUND;
if ((ccptr->user.usernum == CC->user.usernum)
- || (CC->user.axlevel >= 6)) {
+ || (CC->user.axlevel >= AxAideU)) {
ret |= TERM_ALLOWED;
ccptr->kill_me = 1;
}
}
}
- if (CC->user.axlevel >= 6) {
+ if (CC->user.axlevel >= AxAideU) {
snprintf(CC->upl_path, sizeof CC->upl_path,
"%s/%s",
ctdl_image_dir,
}
if ((!strcasecmp(basenm, "_floorpic_"))
- && (CC->user.axlevel >= 6)) {
+ && (CC->user.axlevel >= AxAideU)) {
which_floor = extract_int(cmdbuf, 2);
snprintf(CC->upl_path, sizeof CC->upl_path,
"%s/floor.%d.gif",
}
GenerateRoomDisplay(roomname, ccptr, CC);
- if ((CC->user.axlevel < 6) && (!IsEmptyStr(ccptr->fake_roomname))) {
+ if ((CC->user.axlevel < AxAideU) && (!IsEmptyStr(ccptr->fake_roomname))) {
strcpy(roomname, ccptr->fake_roomname);
}
for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
GenerateRoomDisplay(roomname, ccptr, CC);
- if ((CC->user.axlevel < 6)
+ if ((CC->user.axlevel < AxAideU)
&& (!IsEmptyStr(ccptr->fake_roomname))) {
strcpy(roomname, ccptr->fake_roomname);
}
|| (!strcasecmp(x_user, "broadcast")))
&& (ccptr->can_receive_im)
&& ((ccptr->disable_exp == 0)
- || (CC->user.axlevel >= 6)) ) {
+ || (CC->user.axlevel >= AxAideU)) ) {
if (do_send) {
newmsg = (struct ExpressMessage *) malloc(sizeof (struct ExpressMessage));
memset(newmsg, 0, sizeof (struct ExpressMessage));
cprintf("%d You were not previously paged.\n", ERROR + NO_SUCH_USER);
return;
}
- if ((!strcasecmp(x_user, "broadcast")) && (CC->user.axlevel < 6)) {
+ if ((!strcasecmp(x_user, "broadcast")) && (CC->user.axlevel < AxAideU)) {
cprintf("%d Higher access required to send a broadcast.\n",
ERROR + HIGHER_ACCESS_REQUIRED);
return;
return;
}
- aide = CC->user.axlevel >= 6;
+ aide = CC->user.axlevel >= AxAideU;
cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
for (i=0; i<nContexts; i++)
#ifdef VCARD_SAVES_BY_AIDES_ONLY
/* Prevent non-aides from performing registration changes */
- if (CC->user.axlevel < 6) {
+ if (CC->user.axlevel < AxAideU) {
return(1);
}
#endif
if (v == NULL) return(0); /* no vCards were found in this message */
/* If users cannot create their own accounts, they cannot re-register either. */
- if ( (yes_my_citadel_config) && (config.c_disable_newu) && (CC->user.axlevel < 6) ) {
+ if ( (yes_my_citadel_config) && (config.c_disable_newu) && (CC->user.axlevel < AxAideU) ) {
return(1);
}
* But if the user was an Aide or was edited by an Aide then we can
* Assume they don't need validating.
*/
- if (CC->user.axlevel >= 6) {
+ if (CC->user.axlevel >= AxAideU) {
CtdlGetUserLock(&CC->user, CC->curr_user);
CC->user.flags |= US_REGIS;
CtdlPutUserLock(&CC->user);
}
/* If users cannot create their own accounts, they cannot re-register either. */
- if ( (config.c_disable_newu) && (CC->user.axlevel < 6) ) {
+ if ( (config.c_disable_newu) && (CC->user.axlevel < AxAideU) ) {
cprintf("%d Self-service registration is not allowed here.\n",
ERROR + HIGHER_ACCESS_REQUIRED);
}
if (!strcasecmp(who,"_SELF_")) strcpy(who,CC->curr_user);
- if ((CC->user.axlevel < 6) && (strcasecmp(who,CC->curr_user))) {
+ if ((CC->user.axlevel < AxAideU) && (strcasecmp(who,CC->curr_user))) {
cprintf("%d Higher access required.\n",
ERROR + HIGHER_ACCESS_REQUIRED);
return;
struct CitContext *cptr = NULL;
int nContexts, i;
- int aide = (CC->user.axlevel >= 6);
+ int aide = (CC->user.axlevel >= AxAideU);
cptr = CtdlGetContextArray(&nContexts);
if (!cptr) {
static int unsolicited_id;
int visible_sessions = 0;
int nContexts, i;
- int aide = (CC->user.axlevel >= 6);
+ int aide = (CC->user.axlevel >= AxAideU);
if (IsEmptyStr(presence_jid)) return;
if (CC->kill_me) return;
{
struct CitContext *cptr;
int nContexts, i;
- int aide = (CC->user.axlevel >= 6);
+ int aide = (CC->user.axlevel >= AxAideU);
cptr = CtdlGetContextArray(&nContexts);
if (cptr) {
{
struct CitContext *cptr;
int nContexts, i;
- int aide = (CC->user.axlevel >= 6);
+ int aide = (CC->user.axlevel >= AxAideU);
cprintf("<query xmlns=\"jabber:iq:roster\">");
/* If the user is a twit, move to the twit room for posting */
if (TWITDETECT) {
- if (CCC->user.axlevel == 2) {
+ if (CCC->user.axlevel == AxProbU) {
strcpy(hold_rm, actual_rm);
strcpy(actual_rm, config.c_twitroom);
CtdlLogPrintf(CTDL_DEBUG, "Diverting to twit room\n");
}
- if ((CC->user.axlevel < 2)
+ if ((CC->user.axlevel < AxProbU)
&& ((CC->room.QRflags & QR_MAILBOX) == 0)) {
snprintf(errmsgbuf, n, "Need to be validated to enter "
"(except in %s> to sysop)", MAILROOM);
int CtdlCheckInternetMailPermission(struct ctdluser *who) {
/* Do not allow twits to send Internet mail */
- if (who->axlevel <= 2) return(0);
+ if (who->axlevel <= AxProbU) return(0);
/* Globally enabled? */
if (config.c_restrict == 0) return(1);
if (who->flags & US_INTERNET) return(2);
/* Aide level access? */
- if (who->axlevel >= 6) return(3);
+ if (who->axlevel >= AxAideU) return(3);
/* No mail for you! */
return(0);
if (IsEmptyStr(newusername)) {
strcpy(newusername, CC->user.fullname);
}
- if ( (CC->user.axlevel < 6)
+ if ( (CC->user.axlevel < AxAideU)
&& (strcasecmp(newusername, CC->user.fullname))
&& (strcasecmp(newusername, CC->cs_inet_fn))
) {
if ( ( (CC->room.QRflags & QR_MAILBOX) && (!strcasecmp(&CC->room.QRname[11], MAILROOM)) )
|| ( (CC->room.QRflags & QR_MAILBOX) && (CC->curr_view == VIEW_MAILBOX) )
) {
- if (CC->user.axlevel < 2) {
+ if (CC->user.axlevel < AxProbU) {
strcpy(recp, "sysop");
strcpy(cc, "");
strcpy(bcc, "");
}
if ( ( (valid_to->num_internet + valid_to->num_ignet + valid_cc->num_internet + valid_cc->num_ignet + valid_bcc->num_internet + valid_bcc->num_ignet) > 0)
- && (CC->user.axlevel < 4) ) {
+ && (CC->user.axlevel < AxNetU) ) {
cprintf("%d Higher access required for network mail.\n",
ERROR + HIGHER_ACCESS_REQUIRED);
free_recipients(valid_to);
permit = 0;
/* Aides can move/copy */
- if (CC->user.axlevel >= 6) permit = 1;
+ if (CC->user.axlevel >= AxAideU) permit = 1;
/* Room aides can move/copy */
if (CC->user.usernum == CC->room.QRroomaide) permit = 1;
return;
}
- if (CC->user.axlevel < 6) {
+ if (CC->user.axlevel < AxAideU) {
cprintf("%d Higher access required.\n",
ERROR + HIGHER_ACCESS_REQUIRED);
return;
/* Force the properties of the Aide room */
if (!strcasecmp(roombuf->QRname, config.c_aideroom)) {
- if (userbuf->axlevel >= 6) {
+ if (userbuf->axlevel >= AxAideU) {
retval = UA_KNOWN | UA_GOTOALLOWED | UA_POSTALLOWED | UA_DELETEALLOWED;
} else {
retval = 0;
/* If this is a preferred users only room, check access level */
if (roombuf->QRflags & QR_PREFONLY) {
- if (userbuf->axlevel < 5) {
+ if (userbuf->axlevel < AxPrefU) {
retval = retval & ~UA_KNOWN & ~UA_GOTOALLOWED;
}
}
* - It is a read-only room
*/
int post_allowed = 1;
- if (CC->user.axlevel < 2) post_allowed = 0;
- if ((CC->user.axlevel < 4) && (CC->room.QRflags & QR_NETWORK)) post_allowed = 0;
+ if (CC->user.axlevel < AxProbU) post_allowed = 0;
+ if ((CC->user.axlevel < AxNetU) && (CC->room.QRflags & QR_NETWORK)) post_allowed = 0;
if (roombuf->QRflags & QR_READONLY) post_allowed = 0;
if (post_allowed) {
retval = retval | UA_POSTALLOWED;
}
/* Aides get access to all private rooms */
- if ( (userbuf->axlevel >= 6)
+ if ( (userbuf->axlevel >= AxAideU)
&& ((roombuf->QRflags & QR_MAILBOX) == 0) ) {
if (vbuf.v_flags & V_FORGET) {
retval = retval | UA_GOTOALLOWED | UA_POSTALLOWED;
/* Aides can gain access to mailboxes as well, but they don't show
* by default.
*/
- if ( (userbuf->axlevel >= 6)
+ if ( (userbuf->axlevel >= AxAideU)
&& (roombuf->QRflags & QR_MAILBOX) ) {
retval = retval | UA_GOTOALLOWED | UA_POSTALLOWED;
}
/* Aides and Room Aides have admin privileges */
- if ( (userbuf->axlevel >= 6)
+ if ( (userbuf->axlevel >= AxAideU)
|| (userbuf->usernum == roombuf->QRroomaide)
) {
retval = retval | UA_ADMINALLOWED | UA_DELETEALLOWED | UA_POSTALLOWED;
rmailflag = 0;
if ((CC->room.QRroomaide == CC->user.usernum)
- || (CC->user.axlevel >= 6))
+ || (CC->user.axlevel >= AxAideU))
raideflag = 1;
else
raideflag = 0;
} else if ((QRscratch.QRflags & QR_PASSWORDED) &&
((ra & UA_KNOWN) == 0) &&
(strcasecmp(QRscratch.QRpasswd, password)) &&
- (CC->user.axlevel < 6)
+ (CC->user.axlevel < AxAideU)
) {
cprintf("%d wrong or missing passwd\n",
ERROR + PASSWORD_REQUIRED);
((QRscratch.QRflags & QR_PASSWORDED) == 0) &&
((QRscratch.QRflags & QR_GUESSNAME) == 0) &&
((ra & UA_KNOWN) == 0) &&
- (CC->user.axlevel < 6)
+ (CC->user.axlevel < AxAideU)
) {
CtdlLogPrintf(CTDL_DEBUG, "Failed to acquire private room\n");
} else {
return;
}
if (((CC->room.QRflags & QR_VISDIR) == 0)
- && (CC->user.axlevel < 6)
+ && (CC->user.axlevel < AxAideU)
&& (CC->user.usernum != CC->room.QRroomaide)) {
cprintf("%d not here.\n", ERROR + HIGHER_ACCESS_REQUIRED);
return;
ret = crr_room_not_found;
}
- else if ( (CC->user.axlevel < 6) && (!CC->internal_pgm)
+ else if ( (CC->user.axlevel < AxAideU) && (!CC->internal_pgm)
&& (CC->user.usernum != qrbuf.QRroomaide)
&& ( (((qrbuf.QRflags & QR_MAILBOX) == 0) || (atol(qrbuf.QRname) != CC->user.usernum))) ) {
ret = crr_access_denied;
}
if (new_room_type == 5) {
- if (CC->user.axlevel < 6) {
+ if (CC->user.axlevel < AxAideU) {
cprintf("%d Higher access required\n",
ERROR + HIGHER_ACCESS_REQUIRED);
return;
#define IFEXPERT if (userflags&US_EXPERT)
#define IFNEXPERT if ((userflags&US_EXPERT)==0)
-#define IFAIDE if (axlevel>=6)
-#define IFNAIDE if (axlevel<6)
+#define IFAIDE if (axlevel>=AxAideU)
+#define IFNAIDE if (axlevel<AxAideU)
int rordercmp(struct ctdlroomlisting *r1, struct ctdlroomlisting *r2);
long uglistlsn[UGLISTLEN]; /* current read position for all the ungoto's. Not going to make any friends with this one. */
int uglistsize = 0;
char is_mail = 0; /* nonzero when we're in a mail room */
-char axlevel = 0; /* access level */
+char axlevel = AxDeleted; /* access level */
char is_room_aide = 0; /* boolean flag, 1 if room aide */
int timescalled;
int posted;
rv = system(rc_gotmail_cmd);
}
}
- if ((axlevel >= 6) && (chek.needvalid > 0)) {
+ if ((axlevel >= AxAideU) && (chek.needvalid > 0)) {
scr_printf("*** Users need validation\n");
}
if (chek.needregis > 0) {
/* Handle the selection of a recipient, if necessary. */
strcpy(buf, "");
if (need_recp == 1) {
- if (axlevel >= 2) {
+ if (axlevel >= AxProbU) {
if (is_reply) {
strcpy(buf, reply_to);
} else {
#include "citadel_decls.h"
#include "routines2.h"
-#define IFAIDE if(axlevel>=6)
-#define IFNAIDE if (axlevel<6)
+#define IFAIDE if(axlevel>=AxAideU)
+#define IFNAIDE if (axlevel<AxAideU)
extern unsigned userflags;
//extern char *axdefs[8];
free(user);
return;
}
- user->axlevel = 0;
+ user->axlevel = AxDeleted;
}
r = CtdlIPCAideSetUserParameters(ipc, user, buf);
*/
int is_aide(void)
{
- if (CC->user.axlevel >= 6)
+ if (CC->user.axlevel >= AxAideU)
return (1);
else
return (0);
return (0);
}
- if ((CC->user.axlevel >= 6)
+ if ((CC->user.axlevel >= AxAideU)
|| (CC->room.QRroomaide == CC->user.usernum)) {
return (1);
} else {
/* Did we find something? */
if (found_user == 0) {
- if (((CC->nologin)) && (CC->user.axlevel < 6)) {
+ if (((CC->nologin)) && (CC->user.axlevel < AxAideU)) {
return login_too_many_users;
} else {
safestrncpy(CC->curr_user, CC->user.fullname,
* (as specified in setup), automatically assign access level 6.
*/
if (!strcasecmp(CC->user.fullname, config.c_sysadm)) {
- CC->user.axlevel = 6;
+ CC->user.axlevel = AxAideU;
}
/* If we're authenticating off the host system, automatically give
*/
if (config.c_auth_mode == AUTHMODE_HOST) {
if (CC->user.uid == 0) {
- CC->user.axlevel = 6;
+ CC->user.axlevel = AxAideU;
}
}
CCC->logged_in = 0;
/* Check to see if the user was deleted whilst logged in and purge them if necessary */
- if ((CCC->user.axlevel == 0) && (CCC->user.usernum))
+ if ((CCC->user.axlevel == AxDeleted) && (CCC->user.usernum))
purge_user(CCC->user.fullname);
/* Free any output buffers */
*/
if (CtdlIsUserLoggedInByNum(usbuf.usernum)) {
CtdlLogPrintf(CTDL_WARNING, "User <%s> is logged in; not deleting.\n", pname);
- usbuf.axlevel = 0;
+ usbuf.axlevel = AxDeleted;
CtdlPutUser(&usbuf);
return (1);
}
sizeof(struct ctdluser) : cdbus->len));
cdb_free(cdbus);
if ((usbuf.flags & US_NEEDVALID)
- && (usbuf.axlevel > 0)) {
+ && (usbuf.axlevel > AxDeleted)) {
cprintf("%d %s\n", MORE_DATA, usbuf.fullname);
cdb_close_cursor(CDB_USERS);
return;
extract_token(user, v_args, 0, '|', sizeof user);
newax = extract_int(v_args, 1);
- if (CtdlAccessCheck(ac_aide)) {
+ if (CtdlAccessCheck(ac_aide) ||
+ (newax > AxAideU) ||
+ (newax < AxDeleted)) {
return;
}
return;
}
- if (usbuf->axlevel > 0) {
- if ((CC->user.axlevel >= 6)
+ if (usbuf->axlevel > AxDeleted) {
+ if ((CC->user.axlevel >= AxAideU)
|| ((usbuf->flags & US_UNLISTED) == 0)
|| ((CC->internal_pgm))) {
cprintf("%s|%d|%ld|%ld|%ld|%ld||\n",
if ((REGISCALL != 0) && ((CC->user.flags & US_REGIS) == 0))
regis = 1;
- if (CC->user.axlevel >= 6) {
+ if (CC->user.axlevel >= AxAideU) {
get_control();
if (CitControl.MMflags & MM_VALID)
vali = 1;
usbuf.posted = extract_int(cmdbuf, 4);
if (np > 5) {
newax = extract_int(cmdbuf, 5);
- if ((newax >= 0) && (newax <= 6)) {
- usbuf.axlevel = extract_int(cmdbuf, 5);
+ if ((newax >= AxDeleted) && (newax <= AxAideU)) {
+ usbuf.axlevel = newax;
}
}
if (np > 7) {
usbuf.USuserpurge = extract_int(cmdbuf, 8);
}
CtdlPutUserLock(&usbuf);
- if (usbuf.axlevel == 0) {
+ if (usbuf.axlevel == AxDeleted) {
if (purge_user(requested_user) == 0) {
deleted = 1;
}
if (!cret) return -2;
if (!username) return -2;
- if (axlevel < 0 || axlevel > 7) return -2;
+ if (axlevel < AxDeleted || axlevel > AxAideU) return -2;
aaa = (char *)malloc(strlen(username) + 17);
if (!aaa) return -1;