Skip to content
Snippets Groups Projects
Commit 00238c98 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Update user birthdate formats in user base

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.
parent 70cb9abf
No related branches found
No related tags found
No related merge requests found
......@@ -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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment