Roxen.git / server / sbin / roxen-create-server

version» Context lines:

Roxen.git/server/sbin/roxen-create-server:1:   #!/bin/env pike   // -*- pike -*-    - // $Id: roxen-create-server,v 1.5 2008/08/15 12:33:55 mast Exp $ + // $Id$      string roxen_dir = "@ROXEN_DIR@";      class Config   {    constant default_data_dir = "/var/roxen";    constant default_log_dir = "/var/log/roxen";    constant default_pid_file = "/var/run/roxen";       string config_dir = "/etc/roxen/default";
Roxen.git/server/sbin/roxen-create-server:209:    if(!Stdio.is_dir(roxen_dir))    {    werror("Fatal error: Cannot find Roxen server directory in %O.\n"    "Use --roxen-dir option?\n", roxen_dir);    exit(1);    }       return Config(admin_user, admin_pass, admin_url, config_dir, pid_file);   }    + #if constant(Crypto.Password) + constant hash_password = Crypto.Password.hash; + #else + constant hash_password = Crypto.make_crypt_md5; + #endif +    int main(int argc, array argv)   {    Config config = parse_options(argv);       if(!Stdio.mkdirhier(config->config_dir))    {    werror("Failed to create config dir in %s", config->config_dir);    exit(1);    }   
Roxen.git/server/sbin/roxen-create-server:348:    {    werror(" Failed to create admin user dir %s", dirname(ufile));    exit(1);    }       string user_config_file =    string_to_utf8(#"<?XML version=\"1.0\" encoding=\"UTF-8\"?>   <map>    <str>permissions</str> : <a> <str>Everything</str> </a>    <str>real_name</str> : <str>Administrator</str> -  <str>password</str> : <str>" + crypt(config->password) + #"</str> +  <str>password</str> : <str>" + hash_password(config->password) + #"</str>    <str>name</str> : <str>" + config->admin_user + "</str>\n</map>");       if(Stdio.File(ufile, "wct", 0770)->write(user_config_file) !=    sizeof(user_config_file))    {    werror(" Failed to create admin user file %s", ufile);    exit(1);    }    else    write(" Administrator user \"" + config->admin_user + "\" created.\n");   }