auth_method)) ? $opts->auth_method : NULL;
+ $auth_method_name = NULL;
+ switch($auth_method)
+ {
+ case "sql_db":
+ $auth_method_name = "SQLDB";
+ break;
+ case "file_db":
+ $auth_method_name = "FileDB";
+ break;
+ }
+ if ($auth_method)
+ $am = new Plugin($auth_method);
+ else
+ {
+ Message::Fail("Invalid parameters");
+ return;
+ }
+ if ($am->error)
+ {
+ Message::Fail("Couldn't load plugin \"$auth_method\": $am->error");
+ return;
+ }
+
+ $config["base_url"] = BASE_URL;
+ $config["plugins"] = Array("$auth_method");
+ if ($auth_method == "sql_db")
+ {
+ $config["mysql"] = [
+ "host" => $opts->sql_host,
+ "database" => $opts->sql_db,
+ "username" => $opts->sql_user,
+ "password" => $opts->sql_password,
+ "table_prefix" => $opts->sql_table_prefix,
+ ];
+ }
+
+ generate_secrets();
+
+ /* First, write only the config file */
+ write_config_file();
+
+ if ($auth_method == "sql_db")
+ {
+ sql_db::delete_tables();
+ if (!sql_db::create_tables())
+ Message::Fail("Could not create SQL tables");
+ } else if ($auth_method == "file_db")
+ {
+ file_db::delete_db();
+ }
+
+ $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_meta('role', 'Super-Admin');
+
+ /* Enable lookups on HIBP by default */
+ $config['hibp'] = true;
+
+ /* 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!
- Welcome to the IRC admin panel setup page. This setup process will guide you through the necessary steps to configure your IRC uplink and choose your preferred authentication method.
-
- The first page will ask you for your UnrealIRCd uplink credentials and will test them to ensure that the connection is successful. This step is crucial for the Admin Panel to function properly.
-
- Next, you will be asked to choose your preferred authentication method between file-based and SQL. Depending on your choice, additional steps may be required. If you choose SQL, you will be given the option to set up the appropriate tables in the database.
-
- After that, we'll take you through a short account creation process where you get to create your first account. Once you're setup and logged in, you'll be able to add more users and choose what they can do on your panel.
-
- Finally, the last page will offer additional options that you can customize according to your preferences. Once you have completed all the necessary steps, your IRC admin panel will be fully configured and ready for use.
-
- Should you wish to edit your config further, you will find it in the
config
directory called
config.php
-
- We recommend that you carefully read each page and fill in all the required information accurately to ensure a seamless setup process. Thank you for choosing UnrealIRCd Admin Panel, and we hope you find it useful for managing your server/network.
-
-
-
Proceed
'
- : 'Before we begin, you must let the shell user who owns the webpanel have permission to create files.
-
Get info
'; ?>
-
+ The admin panel needs to be able to write the config file.
+ And after that, refresh this webpage.