X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/311c294b018ad57aa6d13a0b63e025479e3c3632..54b9603ced28334eec94ec45aca67e7bdd0d2078:/settings/install.php
diff --git a/settings/install.php b/settings/install.php
index 7b0596e..c98e2f5 100644
--- a/settings/install.php
+++ b/settings/install.php
@@ -100,69 +100,51 @@ $writable = (is_writable("../config/")) ? true: false;
return;
}
- /* Assume we have a example config available and copy from that so we leave all the comments n things in there
- * If we're setting up it's unlikely anyone would have swooped in already and deleted the example config.
- * Throw an error if not
- */
- if (!file_exists("../config/config.php.sample"))
+ $config["base_url"] = BASE_URL;
+ $config["plugins"] = Array("$auth_method");
+ if ($auth_method == "sql_auth")
{
- Message::Fail("Could not get sample configuration. We need it to work with.");
- return;
- }
- else {
- $config["base_url"] = BASE_URL;
- $config["unrealircd"] = [
- "rpc_user" => $opts->rpc_user,
- "rpc_password" => $opts->rpc_password,
- "host"=>$opts->rpc_iphost,
- "port"=>$opts->rpc_port,
- "tls_verify_cert"=>isset($opts->rpc_ssl)?true:false,
+ $config["mysql"] = [
+ "host" => $opts->sql_host,
+ "database" => $opts->sql_db,
+ "username" => $opts->sql_user,
+ "password" => $opts->sql_password,
];
- $config["plugins"] = Array("$auth_method");
- if ($auth_method == "sql_auth")
- {
- $config["mysql"] = [
- "host" => $opts->sql_host,
- "database" => $opts->sql_db,
- "username" => $opts->sql_user,
- "password" => $opts->sql_password,
- ];
- }
-
- /* First, write only the config file */
- write_config_file();
-
- if ($auth_method == "sql_auth")
- if (!sql_auth::create_tables())
- Message::Fail("Could not create SQL tables");
-
- $user = [
- "user_name" => $opts->account_user,
- "user_pass" => $opts->account_password,
- "fname" => $opts->account_fname,
- "lname" => $opts->account_lname,
- "user_bio" => $opts->account_bio,
- "email" => $opts->account_email
- ];
-
- create_new_user($user);
- $lkup = new PanelUser($opts->account_user);
- if (!$lkup->id)
- {
- Message::Fail("Could not create user");
- return;
- }
- $lkup->add_permission(PERMISSION_MANAGE_USERS);
+ }
- /* Now, write all the config (config.php + settings in DB) */
- write_config();
- ?>
-
- Great! Everything has been completely set up for you, and you can now log in.
- Let's go!
- $opts->account_user,
+ "user_pass" => $opts->account_password,
+ "fname" => $opts->account_fname,
+ "lname" => $opts->account_lname,
+ "user_bio" => $opts->account_bio,
+ "email" => $opts->account_email
+ ];
+
+ create_new_user($user);
+ $lkup = new PanelUser($opts->account_user);
+ if (!$lkup->id)
+ {
+ Message::Fail("Could not create user");
return;
}
+ $lkup->add_permission(PERMISSION_MANAGE_USERS);
+
+ /* Now, write all the config (config.php + settings in DB) */
+ write_config();
+ ?>
+
+ The configuration file has been written. Now, log in to the panel to proceed with the rest of the installation.
+ Let's go!
+
@@ -171,75 +153,24 @@ $writable = (is_writable("../config/")) ? true: false;
font-style: italic;
}
+
config
directory called config.php
- sudo chown -R