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
186 changes: 55 additions & 131 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,135 +14,59 @@
$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");
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

After include("includes/header.php"); the script remains in PHP mode, but the next line outputs raw HTML (<main ...>). This will cause a PHP parse error unless you close PHP (?>) or echo/print the HTML.

Suggested change
include("includes/header.php");
include("includes/header.php");
?>

Copilot uses AI. Check for mistakes.
?>
<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>
<main id="content" style="text-align:center;">
<section role="alert" aria-live="polite">
<?php if( isset( $_GET[ "id" ] ) ){ ?>
<div class="msg bl3">
<div class="br">
<div class="tl">
<div class="tr2">
<?= $_i18n[ "logine" . base64_decode( $_GET[ "id" ] ) ] ?>
</div>
</div>
</div>
</div>
<br>
<?php } ?>
</section>
<?php $fields = " " . base64_decode( $_GET[ "tk" ] );?>
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

base64_decode($_GET["tk"]) is called without checking that tk exists. On newer PHP versions, passing null to base64_decode() can raise a TypeError. Consider defaulting to an empty string when tk is missing (and only decoding when it is present).

Suggested change
<?php $fields = " " . base64_decode( $_GET[ "tk" ] );?>
<?php $fields = " " . ( isset( $_GET[ "tk" ] ) ? base64_decode( $_GET[ "tk" ] ) : "" );?>

Copilot uses AI. Check for mistakes.
<form action="action_login.php" method="post" name="login">
<fieldset style="width:300px; margin:auto;">
<legend class="section">&nbsp;Entrar al sistema</legend>
<div style="margin:15px 0 0;">
<label for="userName" style="display:block;">
<?=$_i18n[ "user" ]?><span aria-hidden="true"> :&nbsp;&nbsp;&nbsp;&nbsp;</span>
</label>
<input id="userName" name="userName" size="35" type="text" class="rounded" required
aria-describedby="errormsg_user">
<?php if( strpos( $fields, 'userName' ) ){?>
<span class="errormsg" id="errormsg_user"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div style="margin:15px 0 0;">
<label for="userPassword" style="display:block;">
<?=$_i18n[ "pass" ]?><span aria-hidden="true"> :&nbsp;&nbsp;&nbsp;&nbsp;</span>
</label>
<input id="userPassword" name="userPassword" size="35" type="password" class="rounded" required
aria-describedby="errormsg_pass">
<?php if( strpos( $fields, 'userPassword' ) ){?>
<span class="errormsg" id="errormsg_pass"> <?=$_i18n[ "error.required" ]?></span>
<?php } ?>
</div>
<div style="margin-top:15px;">
<button type="submit" value="<?=$_i18n[ "access" ]?>">
<?=$_i18n[ "access" ]?>
</button>
</div>
</fieldset>
</form>
</main>
<script type="text/javascript">
window.onload = function(){
var focusControl = document.forms["login"].elements["userName"];
if (focusControl.type != "hidden" && !focusControl.disabled) {
focusControl.focus();
}
};
</script>
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The page no longer includes ./includes/foot.php and also ends with </html> without closing </body>. Since includes/header.php opens the <body> tag, this leaves the document structure incomplete and will also drop the footer/scripts from includes/foot.php. Restore the footer include and ensure </body></html> are properly closed.

Suggested change
</script>
</script>
<?php include("./includes/foot.php"); ?>
</body>

Copilot uses AI. Check for mistakes.
</html>