loggedIn()) { coreFunctions::redirect(coreFunctions::getCoreSitePath() . '/index.' . SITE_CONFIG_PAGE_EXTENSION); } // load theme functions $themeObj = themeHelper::getLoadedInstance(); // page settings define("PAGE_NAME", t("login_page_name", "Login")); define("PAGE_DESCRIPTION", t("login_meta_description", "Login to your account")); define("PAGE_KEYWORDS", t("login_meta_keywords", "login, register, image, picture, pic, img, hosting, sharing, upload, storage, site, website")); define("HTML_ELEMENT_CLASS", "login-page-wrapper"); // top navigation require_once(SITE_TEMPLATES_PATH . '/partial/_navigation_header.inc.php'); // login user, this is a non-ajax fallback so rarely used if ((int) $_REQUEST['submitme']) { // clear any expired IPs bannedIP::clearExpiredBannedIps(); // do login $loginUsername = trim($_REQUEST['username']); $loginPassword = trim($_REQUEST['password']); // check user isn't banned from logging in $bannedIp = bannedIP::getBannedIPData(); if ($bannedIp) { if ($bannedIp['banType'] == 'Login') { notification::setError(t("login_ip_banned", "You have been temporarily blocked from logging in due to too many failed login attempts. Please try again [[[EXPIRY_TIME]]].", array('EXPIRY_TIME' => ($bannedIp['banExpiry'] != null ? coreFunctions::formatDate($bannedIp['banExpiry']) : t('later', 'later'))))); } } // initial validation if (notification::isErrors() == false) { if (!strlen($loginUsername)) { // log failure Auth::logFailedLoginAttempt(coreFunctions::getUsersIPAddress(), $loginUsername); notification::setError(t("please_enter_your_username", "Please enter your username")); } elseif (!strlen($loginPassword)) { // log failure Auth::logFailedLoginAttempt(coreFunctions::getUsersIPAddress(), $loginUsername); notification::setError(t("please_enter_your_password", "Please enter your password")); } } if (notification::isErrors() == false) { $rs = $Auth->login($loginUsername, $loginPassword); if ($rs) { // if we know the file if (isset($_REQUEST['loginShortUrl'])) { // download file $file = file::loadByShortUrl(trim($_REQUEST['loginShortUrl'])); if ($file) { coreFunctions::redirect($file->getFullShortUrl()); } } // successful login coreFunctions::redirect(coreFunctions::getCoreSitePath() . '/index.' . SITE_CONFIG_PAGE_EXTENSION); } else { // login failed notification::setError(t("username_and_password_is_invalid", "Your username and password are invalid")); } } } // header top require_once(SITE_TEMPLATES_PATH . '/partial/_header_file_manager_top.inc.php'); ?>