Changeset 1ee6c18 for commands.c
- Timestamp:
- 2005-12-08T13:41:53Z (19 years ago)
- Branches:
- master
- Children:
- a1f17d4
- Parents:
- d636233
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
rd636233 r1ee6c18 86 86 int cmd_identify( irc_t *irc, char **cmd ) 87 87 { 88 int checkie = bitlbee_load( irc, cmd[1]);88 int checkie = global.storage->load( irc->nick, cmd[1], irc ); 89 89 90 90 if( checkie == -1 ) … … 110 110 int cmd_register( irc_t *irc, char **cmd ) 111 111 { 112 int checkie;113 char path[512];114 115 112 if( global.conf->authmode == AUTHMODE_REGISTERED ) 116 113 { … … 118 115 return( 0 ); 119 116 } 120 121 g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 122 checkie = access( path, F_OK ); 123 124 g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".nicks" ); 125 checkie += access( path, F_OK ); 126 127 if( checkie == -2 ) 117 118 if( !global.storage->exists( irc->nick )) 128 119 { 129 120 setpassnc( irc, cmd[1] ); … … 141 132 int cmd_drop( irc_t *irc, char **cmd ) 142 133 { 143 char s[512]; 144 FILE *fp; 145 146 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 147 fp = fopen( s, "r" ); 148 if( !fp ) 134 if( ! global.storage->exists (irc->nick) ) 149 135 { 150 136 irc_usermsg( irc, "That account does not exist" ); 151 137 return( 0 ); 152 138 } 153 154 fscanf( fp, "%32[^\n]s", s ); 155 fclose( fp ); 156 if( setpass( irc, cmd[1], s ) < 0 ) 157 { 158 irc_usermsg( irc, "Incorrect password" ); 159 return( 0 ); 160 } 161 162 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 163 unlink( s ); 164 165 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".nicks" ); 166 unlink( s ); 139 140 if ( global.storage->check_pass (irc->nick, cmd[1]) ) 141 { 142 irc_usermsg( irc, "Password invalid" ); 143 return( 0 ); 144 } 145 146 global.storage->remove (irc->nick); 167 147 168 148 setpassnc( irc, NULL ); … … 634 614 int cmd_save( irc_t *irc, char **cmd ) 635 615 { 636 if( bitlbee_save( irc ) )616 if( global.storage->save( irc ) ) 637 617 irc_usermsg( irc, "Configuration saved" ); 638 618 else
Note: See TracChangeset
for help on using the changeset viewer.