Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[371] Use XSL template for login.xml page

  • Loading branch information...
commit 302c6a0947fa0eb5830860d8ca2daa8b724cb7f5 1 parent d5b3687
@Shadez authored
View
16 _content/de_de/strings.xml
@@ -3759,4 +3759,20 @@
<str id="remote.required">Benötigt World of Warcraft Connect</str>
<str id="remote.message">Ihr benötigt ein Abonnement für World of Warcraft Connect, um im Auktionshaus Gegenstände kaufen und verkaufen zu können.</str>
</auctionHouse>
+ <login>
+ <str id="login-title">World of Warcraft Account - Anmeldung</str>
+ <str id="login-jquery-processed">In Bearbeitung</str>
+ <str id="login-username-label">WoW-Accountname</str>
+ <str id="login-password-label">Passwort</str>
+ <str id="login-auth-button">Anmeldung</str>
+ <str id="login-return-to-armory">Back to Armory</str>
+ <str id="login-error-username">Accountname benötigt.</str>
+ <str id="login-error-password">Passwort benötigt.</str>
+ <str id="login-error-incorrect-password">Ungültiges Passwort.</str>
+ <str id="logoff-you-logged-off">Sie haben sich abgemeldet</str>
+ <str id="logoff-redirect-info">Sie haben sich abgemeldet und werden in drei Sekunden automatisch weitergeleitet.</str>
+ <str id="logoff-redirect-link-1">Sollten Sie nicht weitergeleitet werden, </str>
+ <str id="logoff-redirect-link-2">klicken Sie bitte hier</str>
+ <str id="logoff-redirect-link-3">, um fortzufahren.</str>
+ </login>
</strs>
View
16 _content/en_gb/strings.xml
@@ -3227,4 +3227,20 @@
<str id="remote.required">World of Warcraft Remote Required</str>
<str id="remote.message">You must have a subscription to World of Warcraft Remote in order to buy and sell items on the Auction House.</str>
</auctionHouse>
+ <login>
+ <str id="login-title">World of Warcraft Account Login</str>
+ <str id="login-jquery-processed">Processing</str>
+ <str id="login-username-label">WoW Account Name</str>
+ <str id="login-password-label">Password</str>
+ <str id="login-auth-button">Log In</str>
+ <str id="login-return-to-armory">Back to Armory</str>
+ <str id="login-error-username">Account name required.</str>
+ <str id="login-error-password">Password required.</str>
+ <str id="login-error-incorrect-password">Password invalid.</str>
+ <str id="logoff-you-logged-off">You Are Logged Out</str>
+ <str id="logoff-redirect-info">You are now logged out and will automatically be redirected within three seconds.</str>
+ <str id="logoff-redirect-link-1">If you are not redirected, </str>
+ <str id="logoff-redirect-link-2">click here</str>
+ <str id="logoff-redirect-link-3"> to proceed.</str>
+ </login>
</strs>
View
16 _content/en_us/strings.xml
@@ -3231,4 +3231,20 @@
<str id="remote.required">World of Warcraft Remote Required</str>
<str id="remote.message">You must have a subscription to World of Warcraft Remote in order to buy and sell items on the Auction House.</str>
</auctionHouse>
+ <login>
+ <str id="login-title">World of Warcraft Account Login</str>
+ <str id="login-jquery-processed">Processing</str>
+ <str id="login-username-label">WoW Account Name</str>
+ <str id="login-password-label">Password</str>
+ <str id="login-auth-button">Log In</str>
+ <str id="login-return-to-armory">Back to Armory</str>
+ <str id="login-error-username">Account name required.</str>
+ <str id="login-error-password">Password required.</str>
+ <str id="login-error-incorrect-password">Password invalid.</str>
+ <str id="logoff-you-logged-off">You Are Logged Out</str>
+ <str id="logoff-redirect-info">You are now logged out and will automatically be redirected within three seconds.</str>
+ <str id="logoff-redirect-link-1">If you are not redirected, </str>
+ <str id="logoff-redirect-link-2">click here</str>
+ <str id="logoff-redirect-link-3"> to proceed.</str>
+ </login>
</strs>
View
16 _content/es_es/strings.xml
@@ -3219,4 +3219,20 @@
<str id="remote.required">Requiere World of Warcraft A Distancia</str>
<str id="remote.message">Necesitas estar suscrito a World of Warcraft A Distancia para comprar y vender objetos en la Casa de Subastas.</str>
</auctionHouse>
+ <login>
+ <str id="login-title">Inicia sesión en tu cuenta de World of Warcraft</str>
+ <str id="login-jquery-processed">En proceso</str>
+ <str id="login-username-label">Cuenta de WoW</str>
+ <str id="login-password-label">Contraseña</str>
+ <str id="login-auth-button">Iniciar sesión</str>
+ <str id="login-return-to-armory">Back to Armory</str>
+ <str id="login-error-username">El nombre de cuenta es obligatorio.</str>
+ <str id="login-error-password">La contraseña es obligatoria.</str>
+ <str id="login-error-incorrect-password">Contraseña no válida.</str>
+ <str id="logoff-you-logged-off">Has salido</str>
+ <str id="logoff-redirect-info">Has cerrado sesión y se te redireccionará automáticamente en tres segundos.</str>
+ <str id="logoff-redirect-link-1">Si no se te redirecciona, </str>
+ <str id="logoff-redirect-link-2">haz clic aquí</str>
+ <str id="logoff-redirect-link-3"> para continuar.</str>
+ </login>
</strs>
View
16 _content/es_mx/strings.xml
@@ -3222,4 +3222,20 @@
<str id="remote.required">Requiere WoW Remoto</str>
<str id="remote.message">Deberás tener una suscripción a WoW Remoto para comprar y vender objetos en la Casa de Subastas.</str>
</auctionHouse>
+ <login>
+ <str id="login-title">Inicia sesión en tu cuenta de World of Warcraft</str>
+ <str id="login-jquery-processed">En proceso</str>
+ <str id="login-username-label">Cuenta de WoW</str>
+ <str id="login-password-label">Contraseña</str>
+ <str id="login-auth-button">Iniciar sesión</str>
+ <str id="login-return-to-armory">Back to Armory</str>
+ <str id="login-error-username">El nombre de cuenta es obligatorio.</str>
+ <str id="login-error-password">La contraseña es obligatoria.</str>
+ <str id="login-error-incorrect-password">Contraseña no válida.</str>
+ <str id="logoff-you-logged-off">Has salido</str>
+ <str id="logoff-redirect-info">Has cerrado sesión y se te redireccionará automáticamente en tres segundos.</str>
+ <str id="logoff-redirect-link-1">Si no se te redirecciona,</str>
+ <str id="logoff-redirect-link-2"> haz clic aquí</str>
+ <str id="logoff-redirect-link-3"> para continuar.</str>
+ </login>
</strs>
View
16 _content/fr_fr/strings.xml
@@ -3222,4 +3222,20 @@
<str id="remote.required">Requiert World of Warcraft Nomade</str>
<str id="remote.message">Vous devez être abonné à World of Warcraft Nomade pour vendre ou acheter des objets à l’hôtel des ventes.</str>
</auctionHouse>
+ <login>
+ <str id="login-title">Identifiant de compte World of Warcraft</str>
+ <str id="login-jquery-processed">Connexion en cours...</str>
+ <str id="login-username-label">Compte WoW</str>
+ <str id="login-password-label">Mot de passe</str>
+ <str id="login-auth-button">Se connecter</str>
+ <str id="login-return-to-armory">Back to Armory</str>
+ <str id="login-error-username">Nom de compte requis.</str>
+ <str id="login-error-password">Mot de passe requis.</str>
+ <str id="login-error-incorrect-password">Mot de passe invalide.</str>
+ <str id="logoff-you-logged-off">Vous êtes déconnecté</str>
+ <str id="logoff-redirect-info">Vous êtes à présent déconnecté et serez redirigé automatiquement dans trois secondes.</str>
+ <str id="logoff-redirect-link-1">Si vous n'êtes pas redirigé, </str>
+ <str id="logoff-redirect-link-2">cliquez ici</str>
+ <str id="logoff-redirect-link-3"> pour continuer.</str>
+ </login>
</strs>
View
16 _content/ru_ru/strings.xml
@@ -3210,4 +3210,20 @@
<str id="remote.required">Требуется подписка на «World of Warcraft без границ»</str>
<str id="remote.message">Для покупки и продажи лотов на аукционе для Оружейной требуется подписка на «World of Warcraft без границ».</str>
</auctionHouse>
+ <login>
+ <str id="login-title">Авторизация учетной записи World of Warcraft</str>
+ <str id="login-jquery-processed">Выполняется</str>
+ <str id="login-username-label">Имя пользователя WoW</str>
+ <str id="login-password-label">Пароль</str>
+ <str id="login-auth-button">Авторизация</str>
+ <str id="login-return-to-armory">Вернуться в Оружейную</str>
+ <str id="login-error-username">Необходимо указать имя пользователя.</str>
+ <str id="login-error-password">Необходимо указать пароль.</str>
+ <str id="login-error-incorrect-password">Пароль недействителен.</str>
+ <str id="logoff-you-logged-off">Вы не авторизованы в системе.</str>
+ <str id="logoff-redirect-info">Вы вышли из системы. Автоматическое перенаправление произойдет через 3 секунды.</str>
+ <str id="logoff-redirect-link-1">Если перенеправление не произошло, </str>
+ <str id="logoff-redirect-link-2">щелкните здесь</str>
+ <str id="logoff-redirect-link-3">.</str>
+ </login>
</strs>
View
80 _layout/login.xsl
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:import href="language.xsl"/>
+<xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
+<xsl:template match="page">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><xsl:value-of select="$loc/strs/login/str[@id='login-title']"/></title>
+ <meta http-equiv="imagetoolbar" content="false"/>
+ <link rel="shortcut icon" href="images/login/favicon.ico" type="image/x-icon"/>
+ <link rel="stylesheet" type="text/css" media="screen, projection" href="_css/login/master.css"/>
+ <link rel="stylesheet" type="text/css" media="screen, projection" href="_css/login/region_EU.css"/>
+ <!--[if IE 6]>
+ <link rel="stylesheet" type="text/css" href="_css/login/master-ie6.css" />
+ <![endif]-->
+ <xsl:if test="@logout = '1'">
+ <meta http-equiv="refresh" content="3;url=index.xml"/>
+ </xsl:if>
+ <script type="text/javascript" src="_js/login/common.js"></script>
+ <script type="text/javascript" src="_js/login/jquery.js"></script>
+ <script type="text/javascript">
+ var $j = jQuery.noConflict();
+ var processingStr = "<xsl:value-of select="$loc/strs/login/str[@id='login-jquery-processed']"/>";
+ </script>
+ </head>
+ <body>
+ <xsl:if test="@logout='1'">
+ <div class="page logoutView">
+ <div class="logout">
+ <h2 class="loggedOut"><xsl:value-of select="$loc/strs/login/str[@id='logoff-you-logged-off']"/></h2>
+ <p class="redirect"><xsl:value-of select="$loc/strs/login/str[@id='logoff-redirect-info']"/></p>
+ <p class="redirect"><xsl:value-of select="$loc/strs/login/str[@id='logoff-redirect-link-1']"/> <a href="index.xml"><xsl:value-of select="$loc/strs/login/str[@id='logoff-redirect-link-2']"/></a><xsl:value-of select="$loc/strs/login/str[@id='logoff-redirect-link-3']"/></p>
+ </div>
+ </div>
+ </xsl:if>
+ <xsl:if test="@logout=''">
+ <div class="page loginView">
+ <div class="">
+ <form id="loginForm" class="submitForm" name="loginForm" method="post" action="" onsubmit="login.disableButton('submit', this); return true;">
+ <div class="formRow accountName">
+ <label class="formLabel" for="accountName" style="margin-bottom:1px"><xsl:value-of select="$loc/strs/login/str[@id='login-username-label']"/></label>
+ <input value="{@username}" id="accountName" name="accountName" maxlength="320" type="text" tabindex="1" class="text" />
+ <xsl:if test="@loginError = '1'">
+ <div class="errorTooltip"><div class="tooltipBg"><p><xsl:value-of select="$loc/strs/login/str[@id='login-error-username']"/></p><div class="arrow"></div></div></div>
+ <script type="text/javascript">
+ document.getElementById('accountName').focus();
+ </script>
+ </xsl:if>
+ </div>
+ <div class="formRow password">
+ <label class="formLabel" for="password"><xsl:value-of select="$loc/strs/login/str[@id='login-password-label']"/></label>
+ <input id="password" name="password" maxlength="16" type="password" tabindex="2" class="text" />
+ <xsl:if test="@passwordError = '1'">
+ <div class="errorTooltip"><div class="tooltipBg"><p><xsl:value-of select="$loc/strs/login/str[@id='login-error-password']"/></p><div class="arrow"></div></div></div>
+ <script type="text/javascript">
+ document.getElementById('password').focus();
+ </script>
+ </xsl:if>
+ <xsl:if test="@passwordError = '2'">
+ <div class="errorTooltip"><div class="tooltipBg"><p><xsl:value-of select="$loc/strs/login/str[@id='login-error-incorrect-password']"/></p><div class="arrow"></div></div></div>
+ <script type="text/javascript">
+ document.getElementById('password').focus();
+ </script>
+ </xsl:if>
+ </div>
+ <input type="submit" class="hiddenSubmit" />
+ <br />
+ <a class="submit" href="javascript:;" onclick="Form.submit(this)" tabindex="3"><xsl:value-of select="$loc/strs/login/str[@id='login-auth-button']"/></a>
+ <div class="signUp">
+ <p> </p>
+ <p><a href="index.xml"><xsl:value-of select="$loc/strs/login/str[@id='login-return-to-armory']"/></a></p>
+ </div>
+ </form>
+ </div>
+ </div>
+ </xsl:if>
+ </body>
+</html>
+</xsl:template>
+</xsl:stylesheet>
View
12 includes/armory_loader.php
@@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
- * @revision 365
+ * @revision 371
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -32,6 +32,7 @@
if(!@include('revision_nr.php')) {
die('<b>Error:</b> can not load revision_nr.php!');
}
+$_SESSION['last_url'] = str_replace('.php', '.xml', $_SERVER['PHP_SELF']) . '?' .str_replace('locale=', 'l=', $_SERVER['QUERY_STRING']);
$armory = new Armory();
/* Check DbVersion */
$dbVersion = $armory->aDB->selectCell("SELECT `version` FROM `ARMORYDBPREFIX_db_version`");
@@ -111,9 +112,8 @@
if(isset($_GET['login']) && $_GET['login'] == 1) {
header('Location: login.xml');
}
-elseif(isset($_GET['logout']) && $_GET['logout'] == 1 && !defined('skip_utils_class')) {
- $utils->CloseSession();
- header('Location: index.xml');
+elseif(isset($_GET['logout']) && $_GET['logout'] == 1) {
+ header('Location: login.xml?logoff');
}
/** End login **/
@@ -164,7 +164,7 @@
$returnUrl = $_SERVER['HTTP_REFERER'];
}
else {
- $returnUrl = '.';
+ $returnUrl = $_SESSION['last_url'];
}
header('Location: '.$returnUrl);
}
@@ -215,6 +215,6 @@
if(!@include('classes/class.xmlhandler.php')) {
die('<b>Error:</b> can not load XML handler class!');
}
-$xml = new XMLHandler($armory->_locale);
+$xml = new XMLHandler($armory->GetLocale());
$xml->StartXML();
?>
View
2  includes/revision_nr.php
@@ -1,5 +1,5 @@
<?php
-define('ARMORY_REVISION', 370);
+define('ARMORY_REVISION', 371);
define('DB_VERSION', 'armory_r361');
define('CONFIG_VERSION', '0708201001');
?>
View
46 includes/template/login-page.html
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><!-- [$login_title] --></title>
- <meta http-equiv="imagetoolbar" content="false"/>
- <link rel="shortcut icon" href="images/login/favicon.ico" type="image/x-icon"/>
- <link rel="stylesheet" type="text/css" media="screen, projection" href="_css/login/master.css"/>
- <link rel="stylesheet" type="text/css" media="screen, projection" href="_css/login/region_EU.css"/>
- <!--[if IE 6]>
- <link rel="stylesheet" type="text/css" href="_css/login/master-ie6.css" />
- <![endif]-->
- <script type="text/javascript" src="_js/login/common.js"></script>
- <script type="text/javascript" src="_js/login/jquery.js"></script>
- <script type="text/javascript">
- var $j = jQuery.noConflict();
- var processingStr = "<!-- [$jquery_processing] -->";
- </script>
- </head>
- <body>
- <div class="page loginView">
- <div class="">
- <form id="loginForm" class="submitForm" name="loginForm" method="post" action="" onsubmit="login.disableButton('submit', this); return true;">
- <div class="formRow accountName">
- <label class="formLabel" for="accountName" style="margin-bottom:1px"><!-- [$username_label] --></label>
- <input value="<!-- [$username] -->" id="accountName" name="accountName" maxlength="320" type="text" tabindex="1" class="text" />
- <!-- [$error_username] -->
- <script type="text/javascript">
- document.getElementById('accountName').focus();
- </script>
- </div>
- <div class="formRow password">
- <label class="formLabel" for="password"><!-- [$password_label] --></label>
- <input id="password" name="password" maxlength="16" type="password" tabindex="2" class="text" />
- <!-- [$error_password] -->
- </div>
- <input type="submit" class="hiddenSubmit" />
- <a class="submit" href="javascript:;" onclick="Form.submit(this)" tabindex="3"><!-- [$auth_button] --></a>
- <div class="signUp">
- <p>&nbsp;</p>
- <p><a href="index.xml"><!-- [$return_to_armory] --></a></p>
- </div>
- </form>
- </div>
- </div>
- </body>
-</html>
View
141 login.php
@@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
- * @revision 365
+ * @revision 371
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -26,106 +26,59 @@
if(!@include('includes/armory_loader.php')) {
die('<b>Fatal error:</b> unable to load system files.');
}
-$strings = array(
- 'ru_ru' => array(
- 'login_title' => 'Авторизация учетной записи World of Warcraft',
- 'jquery_processing' => 'Выполняется',
- 'username_label' => 'Имя пользователя WoW',
- 'password_label' => 'Пароль',
- 'auth_button' => 'Авторизация',
- 'return_to_armory' => 'Вернуться в Оружейную',
- 'error_username' => '<div class="errorTooltip"><div class="tooltipBg"><p>Необходимо указать имя пользователя.<br /></p><div class="arrow"></div></div></div>',
- 'error_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Необходимо указать пароль.<br /></p><div class="arrow"></div></div></div>',
- 'error_incorrect_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Пароль недействителен.<br /></p><div class="arrow"></div></div></div>'
- ),
- 'en_gb' => array(
- 'login_title' => 'World of Warcraft Account Login',
- 'jquery_processing' => 'Processing',
- 'username_label' => 'WoW Account Name',
- 'password_label' => 'Password',
- 'auth_button' => 'Log In',
- 'return_to_armory' => 'Back to Armory',
- 'error_username' => '<div class="errorTooltip"><div class="tooltipBg"><p>Account name required.<br /></p><div class="arrow"></div></div></div>',
- 'error_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Password required.<br /></p><div class="arrow"></div></div></div>',
- 'error_incorrect_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Password invalid.<br /></p><div class="arrow"></div></div></div>'
- ),
- 'de_de' => array(
- 'login_title' => 'World of Warcraft Account - Anmeldung',
- 'jquery_processing' => 'In Bearbeitung',
- 'username_label' => 'WoW-Accountname',
- 'password_label' => 'Passwort',
- 'auth_button' => 'Anmeldung',
- 'return_to_armory' => 'Back to Armory',
- 'error_username' => '<div class="errorTooltip"><div class="tooltipBg"><p>Accountname ben&ouml;tigt.<br /></p><div class="arrow"></div></div></div>',
- 'error_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Passwort ben&ouml;tigt.<br /></p><div class="arrow"></div></div></div>',
- 'error_incorrect_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Ung&uuml;ltiges Passwort.<br /></p><div class="arrow"></div></div></div>'
- ),
- 'fr_fr' => array(
- 'login_title' => 'Identifiant de compte World of Warcraft',
- 'jquery_processing' => 'Connexion en cours...',
- 'username_label' => 'Compte WoW',
- 'password_label' => 'Mot de passe',
- 'auth_button' => 'Se connecter',
- 'return_to_armory' => 'Back to Armory',
- 'error_username' => '<div class="errorTooltip"><div class="tooltipBg"><p>Nom de compte requis.<br /></p><div class="arrow"></div></div></div>',
- 'error_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Mot de passe requis.<br /></p><div class="arrow"></div></div></div>',
- 'error_incorrect_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Mot de passe invalide.<br /></p><div class="arrow"></div></div></div>'
- ),
- 'es_es' => array(
- 'login_title' => 'Inicia sesi&oacute;n en tu cuenta de World of Warcraft',
- 'jquery_processing' => 'En proceso',
- 'username_label' => 'Cuenta de Wo',
- 'password_label' => 'Contrase&ntilde;a',
- 'auth_button' => 'Iniciar sesi&oacute;n',
- 'return_to_armory' => 'Back to Armory',
- 'error_username' => '<div class="errorTooltip"><div class="tooltipBg"><p>El nombre de cuenta es obligatorio.<br /></p><div class="arrow"></div></div></div>',
- 'error_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>La contrase&ntilde;a es obligatoria.<br /></p><div class="arrow"></div></div></div>',
- 'error_incorrect_password' => '<div class="errorTooltip"><div class="tooltipBg"><p>Contrase&ntilde;a no v&aacute;lida.<br /></p><div class="arrow"></div></div></div>'
- ),
-
-);
-ob_start();
-if(!isset($strings[$armory->GetLocale()])) {
- $strings[$armory->GetLocale()] = $strings['ru_ru'];
-}
-$template = file_get_contents('includes/template/login-page.html');
-foreach($strings[$armory->GetLocale()] as $str_key => $str_value) {
- if($str_key != 'error_username' && $str_key != 'error_password') {
- $template = str_replace('<!-- [$'.$str_key.'] -->', $str_value, $template);
- }
-}
-if(isset($_POST['accountName'])) {
+header('Content-type: text/xml');
+$loginError = '';
+$passwordError = '';
+$logout = '';
+if(isset($_POST['accountName']) && !isset($_SESSION['accountId'])) {
$utils->username = $_POST['accountName'];
$utils->password = $_POST['password'];
- if(!empty($utils->username) && !empty($utils->password)) {
- $template = str_replace('<!-- [$error_username] -->', '', $template);
- $template = str_replace('<!-- [$username] -->', $utils->username, $template);
- if($utils->AuthUser()) {
- if(!isset($_GET['ref'])) {
- header('Location: index.xml');
- }
- else {
- header('Location: ' . $_GET['ref']);
- }
+ if(!$utils->username && !$utils->password) {
+ $loginError = 1;
+ $passwordError = 1;
+ }
+ elseif(!$utils->username) {
+ $loginError = 1;
+ }
+ elseif(!$utils->password) {
+ $passwordError = 1;
+ }
+ elseif(!$utils->AuthUser()) {
+ $passwordError = 2;
+ }
+ else {
+ if(!isset($_GET['ref'])) {
+ header('Location: index.xml');
}
else {
- $template = str_replace('<!-- [$username] -->', $utils->username, $template);
- $template = str_replace('<!-- [$error_password] -->', $strings[$armory->GetLocale()]['error_incorrect_password'], $template);
+ header('Location: ' . $_GET['ref']);
}
}
- if(empty($utils->username)) {
- $template = str_replace('<!-- [$error_username] -->', $strings[$armory->GetLocale()]['error_username'], $template);
- $template = str_replace('<!-- [$username] -->', '', $template);
+}
+elseif(isset($_GET['logoff']) && isset($_SESSION['accountId'])) {
+ $loginError = '';
+ $passwordError = '';
+ $utils->CloseSession();
+ $logout = '1';
+}
+elseif(isset($_SESSION['accountId'])) {
+ if(isset($_GET['ref'])) {
+ header('Location: ' . $_GET['ref']);
}
- if(empty($utils->password)) {
- $template = str_replace('<!-- [$username] -->', $utils->username, $template);
- $template = str_replace('<!-- [$error_password] -->', $strings[$armory->GetLocale()]['error_password'], $template);
+ else {
+ header('Location: index.xml');
}
}
-else {
- $template = str_replace('<!-- [$username] -->', '', $template);
-}
-echo $template;
-echo ob_flush();
-ob_clean();
+$xml->LoadXSLT('login.xsl');
+$xml->XMLWriter()->startElement('page');
+$xml->XMLWriter()->writeAttribute('globalSearch', 1);
+$xml->XMLWriter()->writeAttribute('lang', $armory->GetLocale());
+$xml->XMLWriter()->writeAttribute('requestUrl', 'login.xml');
+$xml->XMLWriter()->writeAttribute('loginError', $loginError);
+$xml->XMLWriter()->writeAttribute('passwordError', $passwordError);
+$xml->XMLWriter()->writeAttribute('username', $utils->username);
+$xml->XMLWriter()->writeAttribute('logout', $logout);
+$xml->XMLWriter()->endElement(); //page
+echo $xml->StopXML();
+exit;
?>
Please sign in to comment.
Something went wrong with that request. Please try again.