} } chmodr($directory, $filemode); //find and replace email subject if set if (isset($_POST['email_subject'])) { f_and_r('#Insert Subject Here#', filter_var($_POST['email_subject'], FILTER_SANITIZE_MAGIC_QUOTES), $id . '/email.php'); } //find and replace email from address if set if (isset($_POST['email_from'])) { f_and_r('#postmaster@domain.com#', filter_var($_POST['email_from'], FILTER_SANITIZE_EMAIL), $id . '/email.php'); } //find and replace email from friendly name if set if (isset($_POST['email_from_friendly'])) { f_and_r('#sender friendly#', filter_var($_POST['email_from_friendly'], FILTER_SANITIZE_STRING), $id . '/email.php'); } //find and replace the reply to address if set if (isset($_POST['reply_to'])) { f_and_r('#reply_to@domain.com#', filter_var($_POST['reply_to'], FILTER_SANITIZE_STRING), $id . '/email.php'); } //find and replace email message if set if (isset($_POST['email_message'])) { f_and_r('#Your message will go here.#', htmlentities($_POST['email_message'], ENT_QUOTES), $id . '/email.php'); } //find and replace email fake link if set if (isset($_POST['email_fake_link'])) { f_and_r('#https://fake_display_link_goes_here.com/login#', filter_var($_POST['email_fake_link'], FILTER_SANITIZE_URL), $id . '/email.php'); } //send them back to template page with a success message $_SESSION['alert_message'] = "Template installed successfully!"; header('location:./#tabs-1'); exit;
if ($globarray) { foreach ($globarray as $filename) { $source = file_get_contents($filename); $source = preg_replace($find, $replace, $source); file_put_contents($filename, $source); } } } //generate salt $salt = genRandomString(); //populate the get_salt.php file with the generated salt value f_and_r("salt='replace_me';", "salt='" . $salt . "';", "login/get_salt.php"); //generate random key for encryption $encrypt_key = genRandomString(); //populate the encrypt_config.php file with the generated encryption key f_and_r("spt_encrypt_key='replace_me';", "spt_encrypt_key='" . $encrypt_key . "';", "spt_config/encrypt_config.php"); //set installation status $_SESSION['install_status'] = 5; } //Step 5 - Configure First User if (isset($_POST['step5']) && $_POST['step5'] == "complete") { //validate that the newly entered username is a valid email address $new_username = $_POST['username']; if (!empty($new_username)) { $_SESSION['temp_new_username'] = $new_username; } $new_fname = $_POST['first_name']; if (!empty($new_fname)) { $_SESSION['temp_new_fname'] = $new_fname; } $new_lname = $_POST['last_name'];