]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
* Renamed "struct user" to "struct ctdluser"
[citadel.git] / citadel / citserver.c
index 567468e1240d6cb7cacf220070eceaa03bb717b4..8ea2441fafb9b1a1f5833518937dcfa3485226f8 100644 (file)
@@ -71,7 +71,7 @@ time_t server_startup_time;
  */
 void master_startup(void) {
        struct timeval tv;
-       struct quickroom qrbuf;
+       struct ctdlroom qrbuf;
        
        lprintf(9, "master_startup() started\n");
        time(&server_startup_time);
@@ -404,25 +404,28 @@ static int hostnames_match(const char *realname, const char *testname) {
 }
 
 /*
- * check a hostname against the public_clients file
+ * Check a hostname against the public_clients file.  This determines
+ * whether the client is allowed to change the hostname for this session
+ * (for example, to show the location of the user rather than the location
+ * of the client).
  */
 int is_public_client(char *where)
 {
        char buf[SIZ];
        FILE *fp;
 
-       lprintf(9, "Checking whether %s is a public client\n", where);
-
+       lprintf(9, "Checking whether %s is a local client\n", where);
        if (hostnames_match(where, "localhost")) return(1);
        if (hostnames_match(where, config.c_fqdn)) return(1);
 
-       fp = fopen("public_clients","r");
+       lprintf(9, "Checking whether %s is a public client\n", where);
+       fp = fopen("public_clients", "r");
        if (fp == NULL) return(0);
 
        while (fgets(buf, sizeof buf, fp)!=NULL) {
                while (isspace((buf[strlen(buf)-1]))) 
                        buf[strlen(buf)-1] = 0;
-               if (hostnames_match(where,buf)) {
+               if (hostnames_match(where, buf)) {
                        fclose(fp);
                        return(1);
                }
@@ -607,12 +610,12 @@ void GenerateRoomDisplay(char *real_room,
                        struct CitContext *viewed,
                        struct CitContext *viewer) {
 
-       strcpy(real_room, viewed->quickroom.QRname);
-       if (viewed->quickroom.QRflags & QR_MAILBOX) {
+       strcpy(real_room, viewed->room.QRname);
+       if (viewed->room.QRflags & QR_MAILBOX) {
                strcpy(real_room, &real_room[11]);
        }
-       if (viewed->quickroom.QRflags & QR_PRIVATE) {
-               if ( (CtdlRoomAccess(&viewed->quickroom, &viewer->usersupp)
+       if (viewed->room.QRflags & QR_PRIVATE) {
+               if ( (CtdlRoomAccess(&viewed->room, &viewer->user)
                   & UA_KNOWN) == 0) {
                        strcpy(real_room, "<private room>");
                }
@@ -639,7 +642,7 @@ int CtdlAccessCheck(int required_level) {
                return(-1);
        }
 
-       if (CC->usersupp.axlevel >= 6) return(0);
+       if (CC->user.axlevel >= 6) return(0);
        if (required_level >= ac_aide) {
                cprintf("%d This command requires Aide access.\n",
                        ERROR+HIGHER_ACCESS_REQUIRED);
@@ -686,8 +689,8 @@ void cmd_term(char *cmdbuf)
        for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
                if (session_num == ccptr->cs_pid) {
                        found_it = 1;
-                       if ((ccptr->usersupp.usernum == CC->usersupp.usernum)
-                          || (CC->usersupp.axlevel >= 6)) {
+                       if ((ccptr->user.usernum == CC->user.usernum)
+                          || (CC->user.axlevel >= 6)) {
                                allowed = 1;
                                ccptr->kill_me = 1;
                        }