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

Add system.birthdate_template string property

Suitable for passing to console.gettemplate() when prompting for a birth date.

I'm using like this in my logon.js to correct corrupted newuser birth dates:
  while(user.age < 10) {
	console.putmsg(bbs.text(bbs.text.EnterYourBirthday));
	user.birthdate = console.gettemplate(system.birthdate_template);
  }
parent ad49884c
Branches
Tags
No related merge requests found
Pipeline #7827 passed
......@@ -52,6 +52,7 @@ enum {
, SYS_PROP_DATE_SEP
, SYS_PROP_DATE_VERBAL
, SYS_PROP_BIRTHDATE_FMT
, SYS_PROP_BIRTHDATE_TEMPLATE
, SYS_PROP_PWDAYS
, SYS_PROP_MINPWLEN
, SYS_PROP_MAXPWLEN
......@@ -190,6 +191,10 @@ static JSBool js_system_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
birthdate_format(cfg, str, sizeof str);
p = str;
break;
case SYS_PROP_BIRTHDATE_TEMPLATE:
birthdate_template(cfg, str, sizeof str);
p = str;
break;
case SYS_PROP_NODES:
*vp = INT_TO_JSVAL(cfg->sys_nodes);
break;
......@@ -460,6 +465,8 @@ static jsSyncPropertySpec js_system_properties[] = {
, JSDOCSTR("Short date month-name displayed verbally instead of numerically")},
{ "birthdate_format", SYS_PROP_BIRTHDATE_FMT, SYSOBJ_FLAGS, 32002
, JSDOCSTR("User birth date input and display format (MM=Month number, DD=Day of month, YYYY=Year)")},
{ "birthdate_template", SYS_PROP_BIRTHDATE_TEMPLATE, SYSOBJ_FLAGS, 32002
, JSDOCSTR("User birth date input template")},
{ "pwdays", SYS_PROP_PWDAYS, SYSOBJ_FLAGS, 310
, JSDOCSTR("Days between forced user password changes (<tt>0</tt>=<i>never</i>)")},
{ "min_password_length", SYS_PROP_MINPWLEN, SYSOBJ_FLAGS, 31702
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment