Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
264 changes: 116 additions & 148 deletions login.php
Original file line number Diff line number Diff line change
@@ -1,148 +1,116 @@
<?php
/**********************************************************************
* Author : Sergio Ceron Figueroa (sxceron@laciudadx.com)
* Alias : sxceron
* Web : http://www.dotrow.info
* Name : jShop v1.0
* Desc : Formulario para iniciar sesion
*
***********************************************************************/
// Include file headers
include_once "./includes/settings.php";
include_once "./includes/db.php";

$sselected = 1; $subtitle = $_i18n["login.submenu"]; $selected = $_GET[ "sm" ];
$items = array( $_i18n["login.submenu"], $_i18n["register.submenu"] ); $links = array( "./login.php", "./register.php" );
include("includes/header.php");
?>
<div align="center" id="content"><?php if( isset( $_GET[ "id" ] ) ){ ?>
<div align="center" class="msg">
<div class="bl3">
<div class="br">
<div class="tl">
<div class="tr2"><?=$_i18n[ "logine".base64_decode( $_GET[ "id" ] ) ]?>
</div>
</div>
</div>
</div>
</div>
<br>
<?php } $fields = " ".base64_decode( $_GET[ "tk" ] ); ?>
<style>
.f {
border-top: solid 1px #bbbbbb;
color: #676767;
font-size: 12px;
padding-top: 5px;
margin-top: 15px
}

.f span {
position: relative;
bottom: 7px
}

.errormsg {
color: #cc0000
}

.alert {
color: #FF0000
}

.x {
background-color: #ddf8cc;
border: solid 1px #80c65a;
padding: 15px;
margin: 0 15px 0 0;
text-align: center;
}

.x,.x td {
font-size: 12px
}

.x table {
margin: 0px;
text-align: left;
}

.x p {
text-align: left;
}

.x h2 {
margin: 0 0 0 0;
font-weight: bold;
font-size: 12px;
}
</style>


<table border="0" cellpadding="0" style="text-align: center;"
cellspacing="0" style="width:200px">
<tbody>
<tr>
<td valign="top">
<div class="">
<form action="action_login.php" method="post" name="settings">
<div class="section">&nbsp;Entrar al sistema</div>
<table style="margin: 15px 0pt 0pt;" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="right" nowrap="nowrap"><?=$_i18n[ "user" ]?> :&nbsp;&nbsp;&nbsp;&nbsp;</th>
<td><input name="userName" size="35" type="text" class="rounded"> <?php if( strpos( $fields, 'userName' ) ){?><br>
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?>
</span><?php } ?></td>
</tr>
<tr>
<td></td>
<td
style="overflow: hidden; color: rgb(68, 68, 68); font-size: 75%;"
dir="ltr" align="right"></td>
<td></td>
</tr>
<tr>
<td colspan="3" height="8"></td>
</tr>
<tr>
<td colspan="2" height="8"></td>
</tr>
<tr>
<th align="right" nowrap="nowrap"><?=$_i18n[ "pass" ]?> :&nbsp;&nbsp;&nbsp;&nbsp;</th>
<td><input name="userPassword" size="35" type="password" class="rounded"> <?php if( strpos( $fields, 'userPassword' ) ){?><br>
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?>
</span><?php } ?></td>
</tr>
<tr>
<td colspan="2" height="8"></td>
</tr>
<tr>
<td colspan="2" height="8"></td>
<td></td>
</tr>
<tr>
<td></td>
<td><input value="<?=$_i18n[ "access" ]?>" type="submit"></td>
<td></td>
</tr>
</tbody>
</table>

</tr>
</tbody>
</table>
</div>
<script type="text/javascript" language="JavaScript">
<!--
var focusControl = document.forms["login"].elements["userName"];
if (focusControl.type != "hidden" && !focusControl.disabled) {
focusControl.focus();
}
// -->
</script>
<?php include("./includes/foot.php");?>

</body>
</html>
<?php
/**********************************************************************
* Author : Sergio Ceron Figueroa (sxceron@laciudadx.com)
* Alias : sxceron
* Web : http://www.dotrow.info
* Name : jShop v1.0
* Desc : Formulario para iniciar sesion
*
***********************************************************************/
// Include file headers
include_once "./includes/settings.php";
include_once "./includes/db.php";

$sselected = 1; $subtitle = $_i18n["login.submenu"]; $selected = $_GET[ "sm" ];
$items = array( $_i18n["login.submenu"], $_i18n["register.submenu"] ); $links = array( "./login.php", "./register.php" );
include("includes/header.php");
?>
<div align="center" id="content"><?php if( isset( $_GET[ "id" ] ) ){ ?>
<div align="center" class="msg">
<div class="bl3">
<div class="br">
<div class="tl">
<div class="tr2"><?=$_i18n[ "logine".base64_decode( $_GET[ "id" ] ) ]?>
</div>
</div>
</div>
</div>
</div>
<br>
<?php } $fields = " ".base64_decode( $_GET[ "tk" ] ); ?>
<style>
.f {
border-top: solid 1px #bbbbbb;
color: #676767;
font-size: 12px;
padding-top: 5px;
margin-top: 15px
}

.f span {
position: relative;
bottom: 7px
}

.errormsg {
color: #cc0000
}

.alert {
color: #FF0000
}

.x {
background-color: #ddf8cc;
border: solid 1px #80c65a;
padding: 15px;
margin: 0 15px 0 0;
text-align: center;
}

.x,.x td {
font-size: 12px
}

.x table {
margin: 0px;
text-align: left;
}

.x p {
text-align: left;
}

.x h2 {
margin: 0 0 0 0;
font-weight: bold;
font-size: 12px;
}
</style>


<div class="login-container">
<form action="action_login.php" method="post" name="settings" class="login-form">
<h2 class="section-header">&nbsp;Entrar al sistema</h2>
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<h2 class="section-header"> replaces the prior div.section header, but there is no .section-header style in the repo and the existing styling targets div.section in styles/global.css. This likely regresses the login heading styling. Consider keeping div class="section", or update/add CSS so the new heading class gets the intended styles.

Suggested change
<h2 class="section-header">&nbsp;Entrar al sistema</h2>
<div class="section">&nbsp;Entrar al sistema</div>

Copilot uses AI. Check for mistakes.
<div class="form-group">
<label for="userName" class="form-label"><?=$_i18n[ "user" ]?> :</label>
<input id="userName" name="userName" type="text" class="input-text rounded">
<?php if( strpos( $fields, 'userName' ) ){?>
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div class="form-group">
<label for="userPassword" class="form-label"><?=$_i18n[ "pass" ]?> :</label>
<input id="userPassword" name="userPassword" type="password" class="input-text rounded">
<?php if( strpos( $fields, 'userPassword' ) ){?>
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
Comment on lines +89 to +96
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both validation error <span> elements use the same id="errormsg_0". IDs must be unique in the DOM; this can break CSS/JS targeting and assistive tech relationships. Use distinct IDs per field (or drop the id attribute if it isn't used).

Suggested change
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div class="form-group">
<label for="userPassword" class="form-label"><?=$_i18n[ "pass" ]?> :</label>
<input id="userPassword" name="userPassword" type="password" class="input-text rounded">
<?php if( strpos( $fields, 'userPassword' ) ){?>
<span class="errormsg" id="errormsg_0"> <?=$_i18n[ "error.required" ]?></span>
<span class="errormsg" id="errormsg_userName"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div class="form-group">
<label for="userPassword" class="form-label"><?=$_i18n[ "pass" ]?> :</label>
<input id="userPassword" name="userPassword" type="password" class="input-text rounded">
<?php if( strpos( $fields, 'userPassword' ) ){?>
<span class="errormsg" id="errormsg_userPassword"> <?=$_i18n[ "error.required" ]?></span>

Copilot uses AI. Check for mistakes.
<?php } ?>
</div>
<div class="form-group">
<input value="<?=$_i18n[ "access" ]?>" type="submit" class="submit-button">
</div>
</form>
</div>
</div>
<script type="text/javascript" language="JavaScript">
<!--
var focusControl = document.forms["login"].elements["userName"];
if (focusControl.type != "hidden" && !focusControl.disabled) {
Comment on lines +107 to +108
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The focus script references document.forms["login"], but the only form on this page is name="settings". In browsers this makes focusControl undefined and the subsequent .type access can throw, breaking the page JS and preventing autofocus. Update the script to reference the actual form (or target the input by id) and null-check before accessing properties.

Suggested change
var focusControl = document.forms["login"].elements["userName"];
if (focusControl.type != "hidden" && !focusControl.disabled) {
var focusControl = document.getElementById("userName");
if (focusControl && focusControl.type != "hidden" && !focusControl.disabled) {

Copilot uses AI. Check for mistakes.
focusControl.focus();
}
// -->
</script>
<?php include("./includes/foot.php");?>

</body>
</html>