]> code.citadel.org Git - citadel.git/blobdiff - citadel/user_ops.c
Networker: when a remote host fails to connect successfully add floodprotection.
[citadel.git] / citadel / user_ops.c
index 7f72befa7f12abe00aca67c8d403d5772c4c2fcc..fd8056559c4ba479eaec5eb8570c63ebf11ca47c 100644 (file)
@@ -4,18 +4,12 @@
  * Copyright (c) 1987-2011 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 as published
- * by the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * modify it under the terms of the GNU General Public 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
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "sysdep.h"
@@ -375,7 +369,7 @@ void MailboxName(char *buf, size_t n, const struct ctdluser *who, const char *pr
 
 
 /*
- * Is the user currently logged in an Aide?
+ * Is the user currently logged in an Admin?
  */
 int is_aide(void)
 {
@@ -387,7 +381,7 @@ int is_aide(void)
 
 
 /*
- * Is the user currently logged in an Aide *or* the room aide for this room?
+ * Is the user currently logged in an Admin *or* the room Admin for this room?
  */
 int is_room_aide(void)
 {
@@ -799,13 +793,6 @@ void CtdlUserLogout(void)
                abort_upl(CCC);
        }
 
-       /*
-        * If we were talking to a network node, we're not anymore...
-        */
-       if (!IsEmptyStr(CCC->net_node)) {
-               network_talking_to(CCC->net_node, strlen(CCC->net_node), NTT_REMOVE);
-       }
-
        /* Run any hooks registered by modules... */
        PerformSessionHooks(EVT_LOGOUT);
        
@@ -952,7 +939,6 @@ int CtdlTryPassword(const char *password, long len)
                CONM_syslog(LOG_INFO, "CtdlTryPassword: NULL password string supplied\n");
                return pass_wrong_password;
        }
-       code = (-1);
 
        if (CCC->is_master) {
                code = strcmp(password, config.c_master_pass);
@@ -1011,9 +997,11 @@ int CtdlTryPassword(const char *password, long len)
                strproc(pw);
                strproc(CCC->user.password);
                code = strcasecmp(CCC->user.password, pw);
-               strproc(pw);
-               strproc(CCC->user.password);
-               code = strcasecmp(CCC->user.password, pw);
+               if (code != 0) {
+                       strproc(pw);
+                       strproc(CCC->user.password);
+                       code = strcasecmp(CCC->user.password, pw);
+               }
                free (pw);
        }
 
@@ -1601,7 +1589,7 @@ int CtdlInvtKick(char *iuser, int op) {
 void cmd_invt_kick(char *iuser, int op) {
 
        /*
-        * These commands are only allowed by aides, room aides,
+        * These commands are only allowed by admins, room admins,
         * and room namespace owners
         */
        if (is_room_aide()) {
@@ -1644,7 +1632,7 @@ void cmd_kick(char *iuser) {cmd_invt_kick(iuser, 0);}
 int CtdlForgetThisRoom(void) {
        visit vbuf;
 
-       /* On some systems, Aides are not allowed to forget rooms */
+       /* On some systems, Admins are not allowed to forget rooms */
        if (is_aide() && (config.c_aide_zap == 0)
           && ((CC->room.QRflags & QR_MAILBOX) == 0)  ) {
                return(1);