]> code.citadel.org Git - citadel.git/blobdiff - citadel/user_ops.c
* Removed all of the thread cancellation cruft that is no longer necessary
[citadel.git] / citadel / user_ops.c
index 39fcab1de916295ebf8efd0451b7e78a22a801bb..5cf386354cdb7c410d70e23e92b7f7c4b1da78b9 100644 (file)
@@ -14,9 +14,6 @@
 #include <string.h>
 #include <syslog.h>
 #include <limits.h>
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
 #ifndef ENABLE_CHKPWD
 #include "auth.h"
 #endif
@@ -95,6 +92,7 @@ void putuser(struct usersupp *usbuf)
                }
        lowercase_name[sizeof(lowercase_name)-1] = 0;
 
+       usbuf->version = config.c_setup_level;
        cdb_store(CDB_USERSUPP,
                lowercase_name, strlen(lowercase_name),
                usbuf, sizeof(struct usersupp));
@@ -424,14 +422,14 @@ void cmd_pass(char *buf)
                }
 
        code = (-1);
-       if (CC->usersupp.USuid == BBSUID) {
+       if (CC->usersupp.uid == BBSUID) {
                strproc(password);
                strproc(CC->usersupp.password);
                code = strcasecmp(CC->usersupp.password,password);
                }
 #ifdef ENABLE_AUTOLOGIN
        else {
-               if (validpw(CC->usersupp.USuid, password)) {
+               if (validpw(CC->usersupp.uid, password)) {
                        code = 0;
                        lgetuser(&CC->usersupp, CC->curr_user);
                        safestrncpy(CC->usersupp.password, password,
@@ -536,10 +534,10 @@ int create_user(char *newusername)
                for (a=0; a<strlen(username); ++a) {
                        if (username[a] == ',') username[a] = 0;
                        }
-               CC->usersupp.USuid = p->pw_uid;
+               CC->usersupp.uid = p->pw_uid;
                }
        else {
-               CC->usersupp.USuid = BBSUID;
+               CC->usersupp.uid = BBSUID;
                }
 
        if (!getuser(&usbuf,username)) {
@@ -561,12 +559,6 @@ int create_user(char *newusername)
        CC->usersupp.USscreenwidth = 80;
        CC->usersupp.USscreenheight = 24;
        time(&CC->usersupp.lastcall);
-       strcpy(CC->usersupp.USname, "");
-       strcpy(CC->usersupp.USaddr, "");
-       strcpy(CC->usersupp.UScity, "");
-       strcpy(CC->usersupp.USstate, "");
-       strcpy(CC->usersupp.USzip, "");
-       strcpy(CC->usersupp.USphone, "");
 
        /* fetch a new user number */
        CC->usersupp.usernum = get_new_user_number();
@@ -658,7 +650,7 @@ void cmd_setp(char *new_pw)
                cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
                return;
                }
-       if (CC->usersupp.USuid != BBSUID) {
+       if (CC->usersupp.uid != BBSUID) {
                cprintf("%d Not allowed.  Use the 'passwd' command.\n",ERROR);
                return;
                }
@@ -888,67 +880,6 @@ void cmd_gnur(void) {
        }
 
 
-/*
- * get registration info for a user
- */
-void cmd_greg(char *who)
-{
-       struct usersupp usbuf;
-       int a,b;
-       char pbuf[32];
-
-       if (!(CC->logged_in)) {
-               cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
-               return;
-               }
-
-       if (!strcasecmp(who,"_SELF_")) strcpy(who,CC->curr_user);
-
-       if ((CC->usersupp.axlevel < 6) && (strcasecmp(who,CC->curr_user))) {
-               cprintf("%d Higher access required.\n",
-                       ERROR+HIGHER_ACCESS_REQUIRED);
-               return;
-               }
-
-       if (getuser(&usbuf,who) != 0) {
-               cprintf("%d '%s' not found.\n",ERROR+NO_SUCH_USER,who);
-               return;
-               }
-
-       cprintf("%d %s\n",LISTING_FOLLOWS,usbuf.fullname);
-       cprintf("%ld\n",usbuf.usernum);
-       cprintf("%s\n",usbuf.password);
-       cprintf("%s\n",usbuf.USname);
-       cprintf("%s\n",usbuf.USaddr);
-       cprintf("%s\n%s\n%s\n",
-               usbuf.UScity,usbuf.USstate,usbuf.USzip);
-       strcpy(pbuf,usbuf.USphone);
-       usbuf.USphone[0]=0;
-       for (a=0; a<strlen(pbuf); ++a) {
-               if ((pbuf[a]>='0')&&(pbuf[a]<='9')) {
-                       b=strlen(usbuf.USphone);
-                       usbuf.USphone[b]=pbuf[a];
-                       usbuf.USphone[b+1]=0;
-                       }
-               }
-       while(strlen(usbuf.USphone)<10) {
-               strcpy(pbuf,usbuf.USphone);
-               strcpy(usbuf.USphone," ");
-               strcat(usbuf.USphone,pbuf);
-               }
-
-       cprintf("(%c%c%c) %c%c%c-%c%c%c%c\n",
-               usbuf.USphone[0],usbuf.USphone[1],
-               usbuf.USphone[2],usbuf.USphone[3],
-               usbuf.USphone[4],usbuf.USphone[5],
-               usbuf.USphone[6],usbuf.USphone[7],
-               usbuf.USphone[8],usbuf.USphone[9]);
-
-       cprintf("%d\n",usbuf.axlevel);
-       cprintf("%s\n",usbuf.USemail);
-       cprintf("000\n");
-       }
-
 /*
  * validate a user
  */