Branch: Tag:

2000-02-19

2000-02-19 06:01:16 by Martin Nilsson <mani@lysator.liu.se>

Make it possible to only generate a new admin user.

Rev: server/bin/create_configif.pike:1.4

28:    string def_port = "http://*:"+(random(20000)+10000)+"/";   #endif    -  write( "Roxen 1.4 configuration interface installation script\n"); +  write( "Roxen 2.0 configuration interface installation script\n");       configdir =    Getopt.find_option(argv, "d",({"config-dir","configuration-directory" }),    ({ "ROXEN_CONFIGDIR", "CONFIGURATIONS" }),    "../configurations"); -  +  int admin = has_value(argv, "-a");    -  if(reverse(configdir)[0] != '/') +  if(configdir[-1] != '/')    configdir+="/"; -  +  if(admin) +  write( "Creating an administrator user.\n" ); +  else    write( "Creating a configuration interface server in "+configdir+"\n");       do    { -  +  if(!admin) {    name = rl->read( "Server name [Configuration Interface]: " );    if( !strlen(name-" ") )    name = "Configuration Interface";
48:    port = rl->read( "Port ["+def_port+"]: ");    if( !strlen(port-" ") )    port = def_port; +  }       user = rl->read( "Administrator Username [administrator]: ");    if( !strlen(user-" ") )
76:    mkdirhier( ufile );    Stdio.write_file( ufile, encode_value( user ) );    +  if(admin) { +  write("Administrator user \""+user->name+"\" created."); +  return 0; +  } +     mkdirhier( configdir );    Stdio.write_file( configdir+replace( name, " ", "_" ),   replace(