Added abiltiy to change default archiver

This commit is contained in:
Andrew Pamment 2016-12-08 16:32:05 +10:00
parent 02bcdf87cc
commit b18e9ee10e
2 changed files with 29 additions and 0 deletions

View File

@ -203,3 +203,7 @@ Is this Correct? (Y/N)
\e[1;32mUpload Successful!\e[0m\r\n \e[1;32mUpload Successful!\e[0m\r\n
\e[1;31mUser not found! Assuming new user...\e[0m\r\n\r\n \e[1;31mUser not found! Assuming new user...\e[0m\r\n\r\n
\e[1;32mSuccesfully processed \e[1;37m%d \e[1;32mmessages!\r\n\e[0m \e[1;32mSuccesfully processed \e[1;37m%d \e[1;32mmessages!\r\n\e[0m
\e[0;36mA. \e[1;37mDefault Archiver (\e[1;33m%s\e[1;37m)\r\n
\r\n\e[1;32mSelect an archiver...\e[0m\r\n\r\n
\e[1;31m%d. \e[1;37m%s\e[0m\r\n
>

View File

@ -4,17 +4,22 @@
#include <ctype.h> #include <ctype.h>
#include "bbs.h" #include "bbs.h"
extern struct bbs_config conf;
void settings_menu(struct user_record *user) { void settings_menu(struct user_record *user) {
char buffer[256]; char buffer[256];
int dosettings = 0; int dosettings = 0;
char c; char c;
char *hash; char *hash;
int new_arc;
int i;
while (!dosettings) { while (!dosettings) {
s_printf(get_string(149)); s_printf(get_string(149));
s_printf(get_string(150)); s_printf(get_string(150));
s_printf(get_string(151)); s_printf(get_string(151));
s_printf(get_string(152), user->location); s_printf(get_string(152), user->location);
s_printf(get_string(205), conf.archivers[user->defarchiver - 1]->name);
s_printf(get_string(153)); s_printf(get_string(153));
s_printf(get_string(154)); s_printf(get_string(154));
@ -64,6 +69,26 @@ void settings_menu(struct user_record *user) {
save_user(user); save_user(user);
} }
break; break;
case 'a':
{
s_printf(get_string(206));
for (i=0;i<conf.archiver_count;i++) {
s_printf(get_string(207), i + 1, conf.archivers[i]->name);
}
s_printf(get_string(208));
s_readstring(buffer, 5);
new_arc = atoi(buffer);
if (new_arc - 1 < 0 || new_arc > conf.archiver_count) {
break;
} else {
user->defarchiver = new_arc;
save_user(user);
}
}
break;
case 'q': case 'q':
dosettings = 1; dosettings = 1;
break; break;