-// TODO: lots of other options to implement
-$setup_ok = setup_admin_password($cfg) &&
- setup_var_folder($cfg);
-env_2_cfg_string($cfg, 'web_root', 'WEB_ROOT', '');
-env_2_cfg_string($cfg, 'file_hash', 'FILE_HASH', 'md5');
+function setup_webroot(&$cfg)
+{
+ if (!env_2_cfg_string($cfg, 'web_root')) {
+ echo("warning: you may want to have set WEB_ROOT to your website URL (like 'jirafeau.mydomain.tld/')\n");
+ }
+}
+
+function run_setup(&$cfg)
+{
+ $setup_ok = setup_admin_password($cfg) &&
+ setup_var_folder($cfg);
+ setup_webroot($cfg);
+ env_2_cfg_string($cfg, 'file_hash');
+ env_2_cfg_bool($cfg, 'preview');
+ env_2_cfg_bool($cfg, 'title');
+ env_2_cfg_string($cfg, 'organisation');
+ env_2_cfg_string($cfg, 'contactperson');
+ env_2_cfg_string($cfg, 'style');
+ env_2_cfg_string($cfg, 'availability_default');
+ env_2_cfg_bool($cfg, 'one_time_download');
+ env_2_cfg_bool($cfg, 'enable_crypt');
+ env_2_cfg_bool($cfg, 'debug');
+ env_2_cfg_int($cfg, 'maximal_upload_size');
+ env_2_cfg_string_array($cfg, 'upload_password');
+ env_2_cfg_string_array($cfg, 'upload_ip');
+ env_2_cfg_string_array($cfg, 'upload_ip_nopassword');
+ env_2_cfg_string_array($cfg, 'proxy_ip');
+ env_2_cfg_bool($cfg, 'store_uploader_ip');
+ env_2_cfg_string($cfg, 'download_password_requirement');
+ env_2_cfg_int($cfg, 'download_password_gen_len');
+ env_2_cfg_string($cfg, 'download_password_gen_chars');
+ env_2_cfg_string($cfg, 'download_password_policy');
+ env_2_cfg_string($cfg, 'download_password_policy_regex');