X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fctdlproto%2Fserv_user.c;h=48799de77d955c73e92bae7599d2c4affd8f1c0b;hb=e329db30593524cc2d8851a4500bac41f2340354;hp=82a18fd14d6654cb24f4e5f1453ec1561633c364;hpb=d5283210d4cf1c74fbeea06354d87efbac454471;p=citadel.git diff --git a/citadel/modules/ctdlproto/serv_user.c b/citadel/modules/ctdlproto/serv_user.c index 82a18fd14..48799de77 100644 --- a/citadel/modules/ctdlproto/serv_user.c +++ b/citadel/modules/ctdlproto/serv_user.c @@ -1,7 +1,7 @@ /* * Server functions which perform operations on user objects. * - * Copyright (c) 1987-2017 by the citadel.org team + * Copyright (c) 1987-2018 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, version 3. @@ -34,7 +34,7 @@ void cmd_user(char *cmdbuf) striplt(username); syslog(LOG_DEBUG, "user_ops: cmd_user(%s)", username); - a = CtdlLoginExistingUser(NULL, username); + a = CtdlLoginExistingUser(username); switch (a) { case login_already_logged_in: cprintf("%d Already logged in.\n", ERROR + ALREADY_LOGGED_IN); @@ -93,7 +93,6 @@ void cmd_pass(char *buf) void cmd_newu(char *cmdbuf) { int a; - long len; char username[SIZ]; if (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) { @@ -120,7 +119,6 @@ void cmd_newu(char *cmdbuf) } extract_token(username, cmdbuf, 0, '|', sizeof username); strproc(username); - len = cutuserkey(username); if (IsEmptyStr(username)) { cprintf("%d You must supply a user name.\n", ERROR + USERNAME_REQUIRED); @@ -134,7 +132,7 @@ void cmd_newu(char *cmdbuf) return; } - a = create_user(username, len, 1); + a = create_user(username, CREATE_USER_BECOME_USER, NATIVE_AUTH_UID); if (a == 0) { logged_in_response(); @@ -164,11 +162,6 @@ void cmd_setp(char *new_pw) cprintf("%d Not allowed. Use the 'passwd' command.\n", ERROR + NOT_HERE); return; } - if (CC->is_master) { - cprintf("%d The master prefix password cannot be changed with this command.\n", - ERROR + NOT_HERE); - return; - } if (!strcasecmp(new_pw, "GENERATE_RANDOM_PASSWORD")) { char random_password[17]; @@ -194,7 +187,6 @@ void cmd_setp(char *new_pw) void cmd_creu(char *cmdbuf) { int a; - long len; char username[SIZ]; char password[SIZ]; struct ctdluser tmp; @@ -210,12 +202,10 @@ void cmd_creu(char *cmdbuf) cprintf("%d You must supply a user name.\n", ERROR + USERNAME_REQUIRED); return; } - len = cutuserkey(username); - extract_token(password, cmdbuf, 1, '|', sizeof password); - a = create_user(username, len, 0); + a = create_user(username, CREATE_USER_DO_NOT_BECOME_USER, NATIVE_AUTH_UID); if (a == 0) { if (!IsEmptyStr(password)) { @@ -706,7 +696,6 @@ void cmd_asea(char *cmdbuf) char buf[SIZ]; char whodat[64]; char new_emailaddrs[512] = { 0 } ; - int i; if (CtdlAccessCheck(ac_aide)) return; @@ -734,25 +723,8 @@ void cmd_asea(char *cmdbuf) } } - if (CtdlGetUserLock(&usbuf, requested_user) != 0) { // We are relying on the fact that the DirectoryIndex functions don't lock. - return; // Silently fail here if we can't acquire a lock on the user record. - } - /* Delete all of the existing directory index records for the user (easier this way) */ - for (i=0; i