...
 
Commits (1)
  • Rob Swindell's avatar
    Update user birthdate formats in user base · a8167fb7
    Rob Swindell authored
    i.e. from MM/DD/YY or DD/MM/YY to YYYYMMDD.
    
    The C/C++ source still supports all 3 formats, so it's not terrible if the
    birthdates aren't converted, but thing will be better if we do this ahead
    of time and find all the remaining issues with the new format rather than
    wait for new users (with the new format) to trickle in.
    a8167fb7
......@@ -48,7 +48,9 @@ function move_laston_address()
u = new User(i);
// print("User: "+i+" Note: "+u.note+" IP: "+u.ip_address);
if (u.ip_address.length == 0 && u.note.length > 0) {
print("\nMoving IP from note to ip_address for "+u.alias+" (#"+i+")");
if(!updated)
print();
print("Moving IP from note to ip_address for "+u.alias+" (#"+i+")");
u.ip_address = u.note;
updated++;
}
......@@ -56,6 +58,34 @@ function move_laston_address()
return updated;
}
function update_birthdates()
{
var i;
var u;
var updated = 0;
var last_user = system.lastuser;
if(test)
return 0;
for (i=1; i < last_user; i++) {
u = new User(i);
if (u.birthdate.charAt(2) == '/') {
if(!updated)
print();
print("Updating birthdate format of "+u.alias+" (#"+i+")");
var year = u.birthyear;
var month = u.birthmonth;
var day = u.birthday;
u.birthyear = year;
u.birthmonth = month;
u.birthday = day;
updated++;
}
}
return updated;
}
function install_logonlist()
{
var maint_event = "?logonlist -m";
......@@ -123,8 +153,10 @@ function update_gfile_indexes()
printf("Synchronet update.js revision %u\n", REVISION);
printf("Updating exec directory: ");
printf("%s\n", update_exec_dir() ? "Success" : "FAILURE");
printf("Updating ip_address field: ");
printf("Updating users ip_address field: ");
printf("%d records updated\n", move_laston_address());
printf("Updating users birthdate field: ");
printf("%d records updated\n", update_birthdates());
var sbbsecho_cfg = system.ctrl_dir + "sbbsecho.cfg";
var sbbsecho_ini = system.ctrl_dir + "sbbsecho.ini";
......