$value) { if ($column == 'username' && strlen($value) > 0) { if ($username_in == aes_decrypt($value)) { $logged_in = 'true'; } } } //mysqli_free_result($result); if ($logged_in == 'false') { ?> <?php echo $page_title;?>

Token Expired...Logging Out...

<?php echo $page_title;?>
Forgot Password?


0) { $key_to_pass = $_GET['keyvalue']; } function setup_page_header($key_to_pass, $page_title, $custom_styles, $active_menu_number, $username_in, $password_in, $con) { $var_png_image_url_512_by_65 = "chaarmi-logo.png"; // FREE / LITE / PRO default to Main Logo Base // Custom Logo Code Here - ENTERPRISE ONLY - If you wish to Whitelabel your system, please reach out to your Metaverse Service Provider $sql = "SELECT * FROM chrm_local_system_settings where setting_name = '".aes_encrypt("custom_logo_link")."'"; $result = mysqli_query($con, $sql); $row = mysqli_fetch_array($result); $custom_logo_link_from_server = aes_decrypt($row['setting_value']); if (!empty($custom_logo_link_from_server)) { $var_png_image_url_512_by_65 = $custom_logo_link_from_server; } // Main Menu Navigation Bar Links (Update in TWO spots, TOP and $_POST['method_item'] == "step2") $link_home = "index.php?keyvalue=".$key_to_pass."&pageid=home&username=".$username_in; $link_plots = "index.php?keyvalue=".$key_to_pass."&pageid=plots&username=".$username_in; $link_users = "index.php?keyvalue=".$key_to_pass."&pageid=users&username=".$username_in; $link_settings = "index.php?keyvalue=".$key_to_pass."&pageid=settings&username=".$username_in; $link_help = "index.php?keyvalue=".$key_to_pass."&pageid=help&username=".$username_in; $link_logout = "index.php?keyvalue=".$key_to_pass."&logout=1&username=".$username_in; $link_content = "index.php?keyvalue=".$key_to_pass."&pageid=content&username=".$username_in; //metaverse_owner $username_encrypted = aes_encrypt($username_in); $password_encrypted = aes_encrypt($password_in); $sql = "SELECT * FROM chrm_backend_master_user where username = '".$username_encrypted."'"; $result = mysqli_query($con, $sql); $row = mysqli_fetch_assoc($result); $total_rows = mysqli_num_rows( $result ); $user_type = ""; if ($total_rows > 0) { $user_type = aes_decrypt($row['user_type']); } // Active Menu Numbers if($active_menu_number == '3') { // This is the USERS section. Check if the user is the metaverse_owner, otherwise LOGOUT User if ($user_type != "metaverse_owner") { // LOGOUT ?> <?php echo $page_title;?>

Welcome to your Metaverse Galaxy!

What incredible new worlds will you create today?

$value) { if ($column == 'username' && strlen($value) > 0) { $usernameFromDB = $value; } } //mysqli_free_result($result); // Delete all Expired Users $sql = "DELETE FROM chrm_backend_user_login_activity WHERE expDate < NOW()"; $result2 = mysqli_query($con, $sql); //mysqli_free_result($result2); $sql = "DELETE FROM chrm_backend_user_login_activity WHERE username = '".$usernameFromDB."'"; $result3 = mysqli_query($con, $sql); //mysqli_free_result($result3); // Show main page show_login_page($con); } else if ($_GET['pageid'] == "home") { // Home // Analytics Dashboard and Overview // Obtain keyvalue and check the database to see if user is still logged in $key_value_in = $_GET['keyvalue']; if (empty($username_in)) { $username_in = $_POST['inputUsername']; } // CHECK IF STILL LOGGED IN $logged_in_status = login_check($key_value_in, $con, $username_in); if ($logged_in_status == 'true') { if (empty($username_in)) { $username_in = $_POST['inputUsername']; } $password_in = $_POST['inputPassword']; setup_page_header($key_to_pass, "Home", "", "1", $username_in, $password_in, $con); show_home_page($con); setup_page_footer($key_to_pass); } } else if ($_GET['pageid'] == "content") { // Obtain keyvalue and check the database to see if user is still logged in $key_value_in = $_GET['keyvalue']; if (empty($username_in)) { $username_in = $_POST['inputUsername']; } // CHECK IF STILL LOGGED IN $logged_in_status = login_check($key_value_in, $con, $username_in); if ($logged_in_status == 'true') { if (empty($username_in)) { $username_in = $_POST['inputUsername']; } $password_in = $_POST['inputPassword']; $custom_styles_data = " .top-bar { display: flex; justify-content: flex-end; padding: 10px; background-color: #f0f0f0; border-bottom: 1px solid #ccc; } h1, h2, h3, h4, h5 { color: #4a5361; margin: 0; padding: 0; } /* Add this CSS to style the upload form */ .hidden { display: none; } .upload-form { background-color: #fff; border: 1px solid #ccc; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); max-width: 800px; margin: 20px auto; text-align: center; } .upload-form h2 { margin-top: 0; color: #333; } .progress-bar { width: 0; height: 10px; background-color: #007bff; margin-top: 10px; transition: width 0.3s ease; } "; setup_page_header($key_to_pass, "Content", $custom_styles_data, "5", $username_in, $password_in, $con); // Get the USERTYPE of the USERNAME IN // The initial directory path (e.g. /www/your_directory/) $initial_directory = '../my-content/'; $full_url_base_directory = '/my-content/'; // Get User Type $username_encrypted = aes_encrypt($username_in); $sql = "SELECT * FROM chrm_backend_master_user where username = '".$username_encrypted."'"; $result = mysqli_query($con, $sql); $row = mysqli_fetch_assoc($result); $total_rows = mysqli_num_rows( $result ); $user_type_in = ""; if ($total_rows > 0) { $user_type_in = aes_decrypt($row['user_type']); } if ($user_type_in == "metaverse_owner" || $user_type_in == "admin") { $initial_directory = '../my-content/'; } else { // Only show the specific USERS directory $initial_directory = '../my-content/'.$username_in.'/'; $full_url_base_directory = '/my-content/'.$username_in.'/'; } $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://'; $domain = $_SERVER['HTTP_HOST']; $base_url = $protocol . $domain; // Add the FRONTEND url info $full_url_base_directory = $base_url.$full_url_base_directory; // The current directory path $current_directory = $initial_directory; // UPLOAD FILES AS requested if (isset($_POST['filename'])) { // Make sure there are no special characters (excluding hyphens, dots, and whitespaces) if (preg_match('/^[\w\-. ]+$/', $_POST['filename'])) { $filename = urldecode($_POST["filename"]); $fullFilePath = $initial_directory.$filename; // Create directory or else create a file file_put_contents($fullFilePath, ''); // Redirect to the index page exit; } else { exit('Please enter a valid name!'); } } // Navigate to directory or download file if (isset($_GET["file"])) { $filename = urldecode($_GET["file"]); $fullFilePath = $initial_directory.$filename;//$full_url_base_directory . $filename; if (unlink($fullFilePath)) { echo ""; echo "
FILE HAS BEEN DELETED SUCCESSFULLY: ".$fullFilePath.""; } else { $error_message = "Error deleting file: $filename"; error_log($error_message); echo ""; } } // Retrieve all files and directories $results = glob(str_replace(['[',']',"\f[","\f]"], ["\f[","\f]",'[[]','[]]'], ($current_directory ? $current_directory : $initial_directory)) . '*'); // If true, directories will appear first in the populated file list $directory_first = true; // Sort files if ($directory_first) { usort($results, function($a, $b){ $a_is_dir = is_dir($a); $b_is_dir = is_dir($b); if ($a_is_dir === $b_is_dir) { return strnatcasecmp($a, $b); } else if ($a_is_dir && !$b_is_dir) { return -1; } else if (!$a_is_dir && $b_is_dir) { return 1; } }); } // FILE SYSTEM setup ?>

File Content System


0) { $user_type_in = aes_decrypt($row['user_type']); } if ($user_type_in == "metaverse_owner" || $user_type_in == "admin") { ?>
0) { // Plot ID Already Exists $plot_id_to_generate_already_exists = "true"; } else { // GENERATE New Plot ID $sql = "INSERT INTO chrm_plot_list (plot_id, user_id_of_land_owner, user_id_of_land_creator, user_id_of_land_presenter, land_presenter_expiry_date, land_data_base_interior, land_data_presenter_interior, land_data_base_exterior, land_data_presenter_exterior) VALUES ('".aes_encrypt($plot_name_to_generate)."', null, null, null, null, null, null, null, null)"; $result = mysqli_query($con, $sql); //$row = mysqli_fetch_assoc($result); } /* */ } // Get PlotID $plot_id_in = $_GET['plot_id']; $plot_found = 'false'; if (strlen($plot_id_in) > 0) { $plot_found = 'true'; } // Get Plot list if (empty($username_in)) { $username_in = $_POST['inputUsername']; } $password_in = $_POST['inputPassword']; $username_encrypted = aes_encrypt($username_in); $password_encrypted = aes_encrypt($password_in); // Get Plot Deletion Information $plot_delete_flag = $_GET['delete_plot']; if ($plot_delete_flag == "true") { $plot_found = "false"; // Delete version from table $sql = "DELETE FROM chrm_plot_list where plot_id = '".aes_encrypt($plot_id_in)."'"; $result = mysqli_query($con, $sql); } $custom_styles_data = ".left-panel { height: 92vh; overflow-y: auto; } .top-bar { display: flex; justify-content: flex-end; padding: 10px; background-color: #f0f0f0; border-bottom: 1px solid #ccc; } "; $password_in = $_POST['inputPassword']; setup_page_header($key_to_pass, "Plots", $custom_styles_data, "2", $username_in, $password_in, $con); ?>

Land Plots


Land Plots


<-- Please select a Plot to edit on the left side menu list

0) { $user_type_in = aes_decrypt($row['user_type']); } if ($user_type_in == "metaverse_owner" || $user_type_in == "admin") { ?>

0) { $sql = "UPDATE chrm_backend_master_user SET email = '".$encrypted_email."', password = '".$encrypted_password."' WHERE username = '".$encrypted_username."'"; $result = mysqli_query($con, $sql); } else { $sql = "UPDATE chrm_backend_master_user SET email = '".$encrypted_email."' WHERE username = '".$encrypted_username."'"; $result = mysqli_query($con, $sql); } } else if ($username_in != $username_from_db && $usertype_in == "metaverse_owner") { ?> 0) { $sql = "UPDATE chrm_backend_master_user SET email = '".$encrypted_email."', password = '".$encrypted_password."', user_type = '".$encrypted_usertype."' WHERE username = '".$encrypted_username."'"; $result = mysqli_query($con, $sql); } else { $sql = "UPDATE chrm_backend_master_user SET email = '".$encrypted_email."', user_type = '".$encrypted_usertype."' WHERE username = '".$encrypted_username."'"; $result = mysqli_query($con, $sql); } } } else if ($function_to_do == "delete") { // Delete username and password into the backend system $encrypted_username = aes_encrypt($username_in); // Check total rows $sql = "SELECT * FROM chrm_backend_master_user"; $result = mysqli_query($con, $sql); $total_rows = mysqli_num_rows($result); if ($total_rows <= 1) { ?> 0) { ?>

Users Page



Username Email User Type Plots Actions
COMING SOON
" method="post" style="display: inline;">
" method="post" style="display: inline;" onsubmit="return confirmFirstStep()">
= 1) { $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."' AND setting_description = '".aes_encrypt($settingDescription)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting to be removed from this edition of Chaarmi $sql = "DELETE FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result2 = mysqli_query($con, $sql); // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } } // sendgrid_api_key $settingName = "sendgrid_api_key"; $settingDescription = "This is your SendGrid api key for emails going out of your server. Please visit https://www.sendgrid.com to setup your key. They give you a free edition to start with however it is a paid service after a certain amount of credits."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // photon_realtime_api_key $settingName = "photon_realtime_api_key"; $settingDescription = "This is your Photon License key to give you access to Multiplayer functionality. Please visit https://www.photonengine.com to get your official license key. The free edition gives you 20 user CCU. You can upgrade to higher CCU levels, however you are limited to the Chaarmi CCU limits even with higher CCU from Photon."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // openai_api_key $settingName = "openai_api_key"; $settingDescription = "This is the OpenAI key for ChatGPT and other AI function accessability. It is to be used only with the OpenAI service which is an external service. You can find more details about this service by visiting https://openai.com"; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // user_company_manditory $settingName = "user_company_manditory"; $settingDescription = "Enter 1 for true and 0 for false. If this value is true then the end user MUST give their company name when entering your Chaarmi Worlds Galaxy, otherwise this is an optional field and can be left blank."; $settingValue = "0"; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // user_email_manditory $settingName = "user_email_manditory"; $settingDescription = "Enter 1 for true and 0 for false. If this value is true then the end user MUST give their email when entering your Chaarmi Worlds Galaxy, otherwise this is an optional field and can be left blank."; $settingValue = "0"; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Privacy Policy $settingName = "privacy_policy_link"; $settingDescription = "This is a URL link to your privacy policy."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Terms of Use $settingName = "terms_of_use_link"; $settingDescription = "This is a URL link to your terms of use."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 1 $settingName = "custom_glb_avatar_1"; $settingDescription = "This is your FIRST custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 2 $settingName = "custom_glb_avatar_2"; $settingDescription = "This is your SECOND custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 3 $settingName = "custom_glb_avatar_3"; $settingDescription = "This is your THIRD custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 4 $settingName = "custom_glb_avatar_4"; $settingDescription = "This is your FOURTH custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 5 $settingName = "custom_glb_avatar_5"; $settingDescription = "This is your FIFTH custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 6 $settingName = "custom_glb_avatar_6"; $settingDescription = "This is your SIXTH custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 7 $settingName = "custom_glb_avatar_7"; $settingDescription = "This is your SEVENTH custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // Custom GLB Avatar 8 $settingName = "custom_glb_avatar_8"; $settingDescription = "This is your EIGHTH custom avatar glb file. Please use a local URL from your server and a local IMAGE from the server. Make the input in the form 'sCustomAvatarName, sGLB_URL, sImage_URL'. You can setup EIGHT unique avatars per metaverse galaxy that users can select from along with a Ready Player Me avatar."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // MSP AND ENTERPRISE ONLY ADDITIONS // Custom Login Screen $settingName = "custom_login_screen"; $settingDescription = "This is your custom login screen. It can be any JPG, PNG or MP4 Video file URL Link."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // custom_logo_link $settingName = "custom_logo_link"; $settingDescription = "This is a URL link to a jpg image or png image in the size of 512px by 65px and will allow you to CUSTOMIZE your edition of Chaarmi Worlds."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // PRO ELEMENT // custom_warning_disclaimer_message $settingName = "custom_warning_disclaimer_message"; $settingDescription = "This is a message displayed to ever user immediately upon entry to a galaxy. It has a WARNING DISCLAIMER title that is flashing and your message or note. If you leave it empty nothing will be shown. It is important to alert users that voice chat and microphones are being used as well as video communications."; $settingValue = ""; $settingAdditionalData = ""; $sql_check = "SELECT * FROM chrm_local_system_settings WHERE setting_name = '".aes_encrypt($settingName)."'"; $result = mysqli_query($con, $sql_check); $total_rows = mysqli_num_rows($result); if ($total_rows < 1) { // Setting does not exists so lets create it in the database $sql = "INSERT INTO chrm_local_system_settings (setting_name, setting_description, setting_value, setting_additional_data) VALUES ('".aes_encrypt($settingName)."', '".aes_encrypt($settingDescription)."','".aes_encrypt($settingValue)."','".aes_encrypt($settingAdditionalData)."')"; $result2 = mysqli_query($con, $sql); } // END OF ADDING SETTINGS if (isset($_GET['edit'])) { $setting_name = aes_encrypt($_GET['edit']); $setting_value = $_POST['data_to_edit']; $setting_value = aes_encrypt($setting_value); // Update in Database $sql = "UPDATE chrm_local_system_settings SET setting_value = '".$setting_value."' WHERE setting_name = '".$setting_name."'"; $result = mysqli_query($con, $sql); } $sql = "SELECT * FROM chrm_local_system_settings"; $result = mysqli_query($con, $sql); $total_rows = mysqli_num_rows($result); // Show SETTINGS Page with CRUD capabilities ?>

Settings Page

Setting Setting Value Actions


Details:


Additional:

" method="post">
$value) { if ($column == 'username' && strlen($value) > 0) { $username_from_db = $value; } if ($column == 'password' && strlen($value) > 0) { $password_from_db = $value; } if ($column == 'email' && strlen($value) > 0) { $userEmail = aes_decrypt($value); } } // Check to see that the username and password are correct if ($username_encrypted == $username_from_db && $password_encrypted == $password_from_db) { // If they are add a new entry to chrm_backend_user_login_activity which will keep a user logged in for a total of 24 hours before being removed. $expFormat = mktime(date("H"), date("i"), date("s"), date("m") ,date("d")+1, date("Y")); $expDate = date("Y-m-d H:i:s",$expFormat); $key = md5(aes_encrypt($userEmail)); $addKey = substr(md5(uniqid(rand(),1)),3,10); $key = $key . $addKey; $key = aes_encrypt($key); // Insert Into Temp Table $sql = "INSERT INTO chrm_backend_user_login_activity (username, key_value, expDate) VALUES ('".aes_encrypt($username_in)."', '".$key."', '".$expDate."')"; $result2 = mysqli_query($con, $sql); //mysqli_free_result($result2); // Show Main Website $SIGNED_IN = 'true'; // Get Username and Password from Post if (empty($username_in)) { $username_in = $_POST['inputUsername']; } $password_in = $_POST['inputPassword']; $username_encrypted = aes_encrypt($username_in); $password_encrypted = aes_encrypt($password_in); $key_to_pass = $key; } else { // Wrong Password. Show login screen with message to try again. ?> <?php echo $page_title;?>
$value) { if ($column == 'key_value' && strlen($value) > 0) { if ($value == $pid_in) { $bDoReset = 'true'; } } if ($column == 'email' && strlen($value) > 0) { $userEmail = aes_decrypt($value); } } // Make sure RESET is true and key_value exists then do the actual password change in the DB if ($bDoReset == 'true') { // Get aes_encrypted value of email $userEmailEncrypted = aes_encrypt($userEmail); // Get the password $passwordIn = $_POST['inputNewPassword']; // Do Password Encryption $passwordInEncrypted = aes_encrypt($passwordIn); // Update in Database $sql = "UPDATE chrm_backend_master_user SET password = '".$passwordInEncrypted."' WHERE email = '".$userEmailEncrypted."'"; $result = mysqli_query($con, $sql); //mysqli_free_result($result); // Remove all requests for this specific email $sql = "DELETE FROM chrm_backend_password_reset_temp WHERE email = '".$userEmailEncrypted."'"; $result3 = mysqli_query($con, $sql); //mysqli_free_result($result3); mysqli_close($con); ?> <?php echo $page_title;?>
<?php echo $page_title;?>
$value) { if ($column == 'key_value' && strlen($value) > 0) { if ($value == $pid_in) { $bDoReset = 'true'; } } if ($column == 'email' && strlen($value) > 0) { $userEmail = aes_decrypt($value); } } //mysqli_free_result($result); mysqli_close($con); if ($bDoReset == 'true') { ?> <?php echo $page_title;?>
<?php echo $page_title;?>
$value) { if ($column == 'username' && strlen($value) > 0) { if (aes_decrypt($value) == $username_in) { // Set boolean to send Email to User $bSendEmailToUser = 'true'; } } if ($column == 'email' && strlen($value) > 0) { $userEmail = aes_decrypt($value); } } if ($bSendEmailToUser == 'true') { // Add username to table for generating new password along with randomized key. It is this random key that will be sent via email. $expFormat = mktime(date("H"), date("i"), date("s"), date("m") ,date("d")+1, date("Y")); $expDate = date("Y-m-d H:i:s",$expFormat); $key = md5(aes_encrypt($userEmail)); $addKey = substr(md5(uniqid(rand(),1)),3,10); $key = $key . $addKey; $key = aes_encrypt($key); // Insert Into Temp Table $sql = "INSERT INTO chrm_backend_password_reset_temp (email, key_value, expDate) VALUES ('".aes_encrypt($userEmail)."', '".$key."', '".$expDate."')"; $result2 = mysqli_query($con, $sql); //mysqli_free_result($result2); // Send email to user to reset password $from_email = "contact@chaarmi.com"; $from_name = "Chaarmi Worlds Inc."; $to_email_address = $userEmail; $to_name = ""; $subject = 'Password Reset - Chaarmi Metaverse Galaxy'; $body = 'Hello '.$to_email_address.'!

'; $body = $body.'This email is a password reset request. Someone has requested a password reset. If this was you please follow the link below:

'; $body = $body."https://".$_SERVER['SERVER_NAME']."/my-admin/index.php?forgot_password=3&pid=".$key.""; $body = $body.'

If this was not you, please ignore this email.

NOTE: This is an autogenerated email from a Chaarmi Metaverse Galaxy from the domain: '.$_SERVER['SERVER_NAME']; $sql = "SELECT * FROM chrm_local_system_settings where setting_name = '".aes_encrypt("sendgrid_api_key")."'"; $result = mysqli_query($con, $sql); $row = mysqli_fetch_array($result); $sendgrid_api_key_from_server = aes_decrypt($row['setting_value']); if (isset($sendgrid_api_key_from_server)) { $sendgrid_api_key = $sendgrid_api_key_from_server; } $sendgrid_key = $sendgrid_api_key; send_an_email($from_email, $from_name, $to_email_address, $to_name, $subject, $body, $sendgrid_key); } //mysqli_free_result($result); mysqli_close($con); // Show user on this screen that a password reset request has been sent to the email on record and show a return to start link ?> <?php echo $page_title;?>

<?php echo $page_title;?>


CANCEL
prepare($query); $stmt->bind_param("sssb", $setting_name, $setting_description, $setting_value, $setting_additional_data); $stmt->execute(); } // Create function for reading a setting function read_setting($setting_name) { global $con; $query = "SELECT * FROM chrm_local_system_settings WHERE setting_name = ?"; $stmt = $con->prepare($query); $stmt->bind_param("s", $setting_name); $stmt->execute(); return $stmt->get_result()->fetch_assoc(); } // Create function for updating a setting function update_setting($setting_name, $setting_description, $setting_value, $setting_additional_data) { global $con; $query = "UPDATE chrm_local_system_settings SET setting_description = ?, setting_value = ?, setting_additional_data = ? WHERE setting_name = ?"; $stmt = $con->prepare($query); $stmt->bind_param("ssbs", $setting_description, $setting_value, $setting_additional_data, $setting_name); $stmt->execute(); } // Create function for deleting a setting function delete_setting($setting_name) { global $con; $query = "DELETE FROM chrm_local_system_settings WHERE setting_name = ?"; $stmt = $con->prepare($query); $stmt->bind_param("s", $setting_name); $stmt->execute(); } // FILE SYSTEM Code Functions // Convert bytes to human readable format function convert_filesize($bytes, $precision = 2) { $units = ['Bytes', 'KB', 'MB', 'GB', 'TB']; $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); $bytes /= pow(1024, $pow); return round($bytes, $precision) . ' ' . $units[$pow]; } // Determine the file type icon function get_filetype_icon($filetype) { if (is_dir($filetype)) { return ''; } else if (preg_match('/image\/*/', mime_content_type($filetype))) { return ''; } else if (preg_match('/video\/*/', mime_content_type($filetype))) { return ''; } else if (preg_match('/audio\/*/', mime_content_type($filetype))) { return ''; } else if (preg_match('/audio\/*/', mime_content_type($filetype))) { return ''; } return ''; } ?>