minor updates to hostserv and fix levels with Ultimate :(
This commit is contained in:
parent
71220112a7
commit
2d9a5206ed
2 changed files with 27 additions and 10 deletions
|
@ -1,8 +1,12 @@
|
|||
HostServ Module for NeoStats 2.x ChangeLog
|
||||
Shmad <shmad@neostats.net>
|
||||
^Enigma^ <enigma@neostats.net>
|
||||
* Version 2.4 * Fish * Jan 29th, 2003
|
||||
+ a few typo's in the messages
|
||||
+ chpass can only be used if you match the host, or u have level 100 with neostats
|
||||
|
||||
* Version 2.3 * Shmad & Fish * January 4th, 2002
|
||||
|
||||
* Version 2.3 * Shmad & Fish * January 4th, 2003
|
||||
+ Write to DB who added the record.
|
||||
+ VIEW # now shows also who added the record.
|
||||
+ hostserv.h now contains defines for access for each function.
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
** USA
|
||||
**
|
||||
** NeoStats CVS Identification
|
||||
** $Id: hostserv.c,v 1.35 2003/01/27 02:33:59 fishwaldo Exp $
|
||||
** $Id: hostserv.c,v 1.36 2003/01/29 10:06:51 fishwaldo Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -92,7 +92,7 @@ int ListArryCount = 0;
|
|||
Module_Info HostServ_info[] = { {
|
||||
"HostServ",
|
||||
"Network User Virtual Host Service",
|
||||
"2.3"
|
||||
"2.4"
|
||||
} };
|
||||
|
||||
|
||||
|
@ -154,12 +154,15 @@ int new_m_version(char *origin, char **av, int ac) {
|
|||
|
||||
/* Routine For Setting the Virtual Host */
|
||||
static int hs_sign_on(char **av, int ac) {
|
||||
char *tmp = NULL;
|
||||
char *tmp2 = NULL;
|
||||
char *tmp;
|
||||
char *tmp2;
|
||||
hnode_t *hn;
|
||||
hs_map *map;
|
||||
User *u;
|
||||
|
||||
if (!is_synced)
|
||||
return 0;
|
||||
|
||||
u = finduser(av[0]);
|
||||
if (!u) return 1;
|
||||
|
||||
|
@ -428,15 +431,25 @@ static void hs_listban(User *u) {
|
|||
static void hs_chpass(User *u, char *nick, char *oldpass, char *newpass) {
|
||||
hnode_t *hn;
|
||||
hs_map *map;
|
||||
char *tmp, *tmp2;
|
||||
|
||||
hn = hash_lookup(vhosts, nick);
|
||||
if (hn) {
|
||||
map = hnode_get(hn);
|
||||
if (!strcasecmp(map->passwd, oldpass)) {
|
||||
strncpy(map->passwd, newpass, 30);
|
||||
prefmsg(u->nick, s_HostServ, "Password Successfully changed");
|
||||
chanalert(s_HostServ, "%s changed the password for %s", u->nick, map->nnick);
|
||||
write_database();
|
||||
tmp = strlower(map->host);
|
||||
tmp2 = strlower(u->hostname);
|
||||
if ((fnmatch(tmp, tmp2, 0) == 0) || (UserLevel(u) >= 100)) {
|
||||
if (!strcasecmp(map->passwd, oldpass)) {
|
||||
strncpy(map->passwd, newpass, 30);
|
||||
prefmsg(u->nick, s_HostServ, "Password Successfully changed");
|
||||
chanalert(s_HostServ, "%s changed the password for %s", u->nick, map->nnick);
|
||||
write_database();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
prefmsg(u->nick, s_HostServ, "Error, Hostname Mis-Match");
|
||||
chanalert(s_HostServ, "%s tried to change the password for %s, but the hosts do not match (%s->%s)", u->nick, map->nnick, u->hostname, map->host);
|
||||
hslog("%s tried to change the password for %s but the hosts do not match (%s -> %s)", u->nick, map->nnick, u->hostname, map->host);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue