1 /* users.h version 0.333 */ 2 /* all versions previous to 0.333 are completely public domain */ 3 /* all contributed code falls under the same BSD style license as */ 4 /* noted below unless the contributing author places a copyright */ 5 /* notice in their file/s. */ 6 7 8 /* 9 * * Copyright (c) 2001 David T. Stiles 10 * * All rights reserved. 11 * * 12 * * Redistribution and use in source and binary forms, with or without 13 * * modification, are permitted provided that the following conditions 14 * * are met: 15 * * 1. Redistributions of source code must retain the above copyright 16 * * notice, this list of conditions and the following disclaimer. 17 * * 2. Redistributions in binary form must reproduce the above copyright 18 * * notice, this list of conditions and the following disclaimer in the 19 * * documentation and/or other materials provided with the distribution. 20 * * 3. All advertising materials mentioning features or use of this software 21 * * must display the following acknowledgement: 22 * * This product includes software developed by David T. Stiles 23 * * 4. The name David T. Stiles may not be used to endorse or promote 24 * * products derived from this software without specific prior written 25 * * permission. 26 * * 27 * * THIS SOFTWARE IS PROVIDED BY DAVID T. STILES `AS IS'' AND ANY 28 * * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29 * * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 * * ARE DISCLAIMED. IN NO EVENT SHALL DAVID T. STILES BE LIABLE 31 * * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 * * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * * SUCH DAMAGE. 38 * */ 39 40 /* this code would not be possible without the patience and intelligence */ 41 /* provided by many of the people from #c/efnet. I thank all of you sincerely. */ 42 43 #ifndef _USERS_H 44 #define _USERS_H 1 45 46 47 #include <sys/types.h> 48 #include <stdio.h> 49 #include <strings.h> 50 #include <stdarg.h> 51 52 #include <crypt.h> 53 54 #include <unistd.h> 55 #include "bot.h" 56 57 #define MAXUSERS 1024 58 #define USERINFO 512 59 60 61 struct user { 62 char data[MAXDATASIZE]; 63 struct user *next; 64 }; 65 66 67 68 int valid_user( char *nickname ); 69 int loadusers( char *filename ); 70 void oppeople( char *chan, char *name, char *passwd, char *nick ); 71 void op( char *nick, char *channel ); 72 void adduser( char *pass, char *name, char *newupass, char *newuname ); 73 int valid_password( char *passwd ); 74 int valid_login( char *name, char *passwd ); 75 void whois( char *name ); 76 void saveusers( char *filename ); 77 void rmuser( char *passwd, char *name, char *rmname ); 78 void chpass( char *passwd, char *name, char *newpass ); 79 void get_salt( char *ray ); 80 81 #endif /* !_USERS_H */ |