setLanguageFile('frontend', 'language.global'); include_once $class_language->setLanguageFile('frontend', 'language.account'); include_once $class_language->setLanguageFile('frontend', 'language.email.notif'); include_once $class_language->setLanguageFile('frontend', 'language.notifications'); include_once $class_language->setLanguageFile('frontend', 'language.signup'); $error_message = null; $notice_message = null; $cfg = $class_database->getConfigurations('paid_memberships,backend_email,backend_username,signup_domain_restriction,list_email_domains,signup_min_password,signup_max_password,email_change_captcha,keep_entries_open,user_image_max_size,user_image_allowed_extensions,user_image_width,user_image_height,activity_logging,file_favorites,file_rating,file_comments,channel_comments,file_respnses,approve_friends,file_counts,numeric_delimiter,channel_views,recaptcha_site_key,recaptcha_secret_key,affiliate_module,affiliate_tracking_id,affiliate_view_id,affiliate_maps_api_key,affiliate_token_script,affiliate_payout_figure,affiliate_payout_currency,affiliate_payout_units,affiliate_payout_share,affiliate_requirements_type,affiliate_requirements_min'); // Use modern VAuth instead of deprecated VLogin $auth = VAuth::getInstance(); $logged_in = $auth->isAuthenticated(); // Check if user has access to this page if (!$logged_in) { header('Location: ' . VHref::getKey('signin')); exit; } // Check membership/subscription status if enabled $membership_check = null; if ($cfg["paid_memberships"] == 1 && getCurrentUserId() > 0) { // Load membership class if it exists if (class_exists('VMembership')) { $membership_check = VMembership::checkSubscription(getCurrentUserId()); } } $notice_message = ($_POST and $_GET["do"] == '') ? VUseraccount::doChanges() : null; $user_key = $class_filter->clr_str($_SESSION["USER_KEY"]); $files = new VFiles; $smarty->assign('page_display', 'tpl_account'); switch ($_GET["s"]) { case "account-menu-entry1": case "account-menu-entry13": $tpl_page = 'tpl_overview.tpl'; switch ($_GET["do"]) { case "loading":$smarty->display('tpl_frontend/tpl_acct/tpl_overview_image.tpl'); break; case "cancel":VUseraccount::cancelProfileImage(); break; case "upload":VUseraccount::changeProfileImage($user_key); break; case "save":VUseraccount::saveProfileImage($user_key); break; case "make-affiliate":echo VAffiliate::affiliateRequest(); break; case "make-affiliate-email":$html = $_POST ? VAffiliate::affiliateRequestEmail() : null; break; } break; case "account-menu-entry2": $tpl_page = 'tpl_profile_setup.tpl'; break; case "account-menu-entry3": $tpl_page = ''; break; case "account-menu-entry4": $tpl_page = 'tpl_email_opts.tpl'; if ($_POST) { switch ($_GET["do"]) { case "emchange":VUseraccount::changeEmail(); break; } } break; case "account-menu-entry5":$tpl_page = 'tpl_activity.tpl'; break; case "account-menu-entry6": $tpl_page = 'tpl_manage_acct.tpl'; if ($_POST) { switch ($_GET["do"]) { case "cpass":VUseraccount::changePassword(); break; case "purge":VUseraccount::purgeAccount(); break; } } break; } if (!isset($_GET["s"]) and !isset($_GET["do"])) { VAffiliate::allowRequest(); $smarty->assign('c_section', VHref::getKey("account")); } $section_menus = (intval($_SESSION["USER_ID"]) > 0) ? $smarty->assign('keep_entries_open', $_SESSION[$_SESSION["USER_KEY"] . '_list']) : null; $display_section = ($_GET["s"] != '' and !isset($_GET["do"])) ? $smarty->display('tpl_frontend/tpl_acct/' . $tpl_page) : null; $display_page = (!isset($_GET["s"]) and !isset($_GET["do"])) ? $class_smarty->displayPage('frontend', 'tpl_account', $error_message, $notice_message) : null;