Branch: Tag:

2017-09-28

2017-09-28 13:35:30 by Henrik Grubbström (Grubba) <grubba@grubba.org>

create_configif: Improved defaults on interactive redo.

The previously configured values are now used as defaults
the second time around if the user failed to confirm them.

Fixes some more of [WS-69].

93:   int main(int argc, array argv)   {    Readline rl = Readline(); -  string name, user, password, configdir, port; +  string name = "Administration Interface"; +  string user = "administrator"; +  string password, configdir, port;    string passwd2;      #if constant( SSL )
206:    if(!admin)    {    write("\n"); -  name = read_string(rl, "Server name:", "server_name", -  "Administration Interface"); +  do { +  if (!sizeof(name)) name = "Administration Interface"; +  name = read_string(rl, "Server name:", "server_name", name); +  if (batch) m_delete(batch, "server_name"); +  } while (!sizeof(name));       int port_ok;    while( !port_ok )    { -  string protocol, host, path; +  string protocol = "https"; +  string host, path;       port = read_string(rl, "Port URL:", "server_url", def_port);    if( port == def_port )
222:    int ok;    while( !ok )    { -  switch( protocol = lower_case(read_string(rl, "Protocol:", "protocol", "https"))) +  switch( protocol = lower_case(read_string(rl, "Protocol:", "protocol", protocol)))    {    case "":    protocol = "https";