1 /* SmoothWall install program.
3 * This program is distributed under the terms of the GNU General Public
4 * Licence. See the file COPYING for details.
6 * (c) Lawrence Manning, 2001
7 * Write the config and get password stuff.
18 int write_lang_configs( char *lang
)
20 struct keyvalue
*kv
= initkeyvalues();
22 /* default stuff for main/settings. */
23 replacekeyvalue(kv
, "LANGUAGE", lang
);
24 replacekeyvalue(kv
, "HOSTNAME", SNAME
);
25 replacekeyvalue(kv
, "THEME", "ipfire");
26 writekeyvalues(kv
, "/harddisk" CONFIG_ROOT
"/main/settings");
32 int write_ethernet_configs(struct keyvalue
*ethernetkv
)
34 /* Write out the network settings we got from a few mins ago. */
35 writekeyvalues(ethernetkv
, "/harddisk" CONFIG_ROOT
"/ethernet/settings");
39 /* Taken from the cdrom one. */
40 int getpassword(char *password
, char *text
)
42 char *values
[] = { NULL
, NULL
, NULL
}; /* pointers for the values. */
43 struct newtWinEntry entries
[] =
45 { ctr
[TR_PASSWORD_PROMPT
], &values
[0], 2 },
46 { ctr
[TR_AGAIN_PROMPT
], &values
[1], 2 },
49 char title
[STRING_SIZE
];
56 sprintf (title
, "%s v%s - %s", NAME
, VERSION
, SLOGAN
);
57 rc
= newtWinEntries(title
, text
,
58 50, 5, 5, 20, entries
, ctr
[TR_OK
], ctr
[TR_CANCEL
], NULL
);
62 if (strlen(values
[0]) == 0 || strlen(values
[1]) == 0)
64 errorbox(ctr
[TR_PASSWORD_CANNOT_BE_BLANK
]);
66 strcpy(values
[0], "");
67 strcpy(values
[1], "");
69 else if (strcmp(values
[0], values
[1]) != 0)
71 errorbox(ctr
[TR_PASSWORDS_DO_NOT_MATCH
]);
73 strcpy(values
[0], "");
74 strcpy(values
[1], "");
80 strncpy(password
, values
[0], STRING_SIZE
);
82 if (values
[0]) free(values
[0]);
83 if (values
[1]) free(values
[1]);