]> code.citadel.org Git - citadel.git/blobdiff - textclient/routines.c
Grammar change in the license declaration.
[citadel.git] / textclient / routines.c
index 56b4fd3375ae8f246172c2a1366b1c6d390689b9..7db33c0b3bbbf05c6770ca54173a1bde2ea8c036 100644 (file)
@@ -3,7 +3,7 @@
 // Copyright (c) 1987-2016 by the citadel.org team
 //
 // This program is open source software.  Use, duplication, and/or
-// disclosure are subject to the GNU General Purpose License version 3.
+// disclosure is subject to the GNU General Purpose License version 3.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -81,7 +81,7 @@ void edit_user_internet_email_addresses(CtdlIPC * ipc, char *who) {
                switch (ch) {
                case 'a':
                        newprompt("Enter new email address: ", buf, 50);
-                       striplt(buf);
+                       string_trim(buf);
                        if (!IsEmptyStr(buf)) {
                                // FIXME validate the email address (format, our own domain, addr does not belong to another user)
                                ++num_recs;
@@ -218,8 +218,6 @@ void edituser(CtdlIPC * ipc, int cmd) {
                else {
                        user->flags |= US_REGIS;
                }
-               user->timescalled = intprompt("Times called", user->timescalled, 0, INT_MAX);
-               user->posted = intprompt("Messages posted", user->posted, 0, INT_MAX);
                user->lastcall = boolprompt("Set last login to now", 0) ? time(NULL) : user->lastcall;
                user->USuserpurge = intprompt("Purge time (in days, 0 for system default", user->USuserpurge, 0, INT_MAX);
        }
@@ -239,8 +237,10 @@ void edituser(CtdlIPC * ipc, int cmd) {
        }
        free(user);
 
-       if (boolprompt("Edit this user's Internet email addresses", 0)) {
-               edit_user_internet_email_addresses(ipc, who);
+       if (cmd == 25) {        // user edit
+               if (boolprompt("Edit this user's Internet email addresses", 0)) {
+                       edit_user_internet_email_addresses(ipc, who);
+               }
        }
 
 }
@@ -490,6 +490,9 @@ void locate_host(CtdlIPC * ipc, char *hbuf) {
                return;
        }
        fgets(hbuf, SIZ, who);
+       if (hbuf[strlen(hbuf) - 1] == '\n') {
+               hbuf[strlen(hbuf) - 1] = 0;
+       }
        pclose(who);
        stripallbut(hbuf, '(', ')');
 }