Skip to content

Commit

Permalink
Merge pull request smrealms#667 from hemberger/validation
Browse files Browse the repository at this point in the history
Fix major validation issues
  • Loading branch information
hemberger authored Mar 15, 2019
2 parents d04de7d + 1df785a commit f76ccdc
Show file tree
Hide file tree
Showing 89 changed files with 256 additions and 272 deletions.
2 changes: 1 addition & 1 deletion admin/Default/game_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$container['body'] = 'game_delete_confirm.php';
$PHP_OUTPUT.=create_echo_form($container);

$PHP_OUTPUT.=('<select name="game_id" id="InputFields">');
$PHP_OUTPUT.=('<select name="game_id" class="InputFields">');
$PHP_OUTPUT.=('<option value=None selected>[Select the game]</option>');

$db->query('SELECT * FROM game');
Expand Down
2 changes: 1 addition & 1 deletion engine/Default/bar_read_wall.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
$PHP_OUTPUT.=('<br />');

$PHP_OUTPUT.=create_echo_form(create_container('skeleton.php', 'bar_read_wall.php'));
$PHP_OUTPUT.=('<textarea spellcheck="true" name="wall" id="InputFieldsText"></textarea><br /><br />');
$PHP_OUTPUT.=('<textarea spellcheck="true" name="wall" class="InputFields"></textarea><br /><br />');
$PHP_OUTPUT.=create_submit('Write it');
$PHP_OUTPUT.=('</form>');
4 changes: 2 additions & 2 deletions engine/Default/galactic_post_application.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
$PHP_OUTPUT.=('No : <input type="radio" name="exp" value="2"><br />');
$PHP_OUTPUT.=('<br />');
$PHP_OUTPUT.=('How many articles would you write per week if you were selected?<br />');
$PHP_OUTPUT.=('<input type="number" name="amount" value="0" id="InputFields" style="text-align:right;width:25;">');
$PHP_OUTPUT.=('<input type="number" name="amount" value="0" class="InputFields" style="text-align:right;width:25;">');
$PHP_OUTPUT.=('<br />');
$PHP_OUTPUT.=('In 255 characters or less please describe why you should be accepted<br />');
$PHP_OUTPUT.=('<textarea spellcheck="true" name="message" id="InputFields"></textarea>');
$PHP_OUTPUT.=('<textarea spellcheck="true" name="message" class="InputFields"></textarea>');
$PHP_OUTPUT.=('<br /><br />');
$PHP_OUTPUT.=create_submit('Apply');
$PHP_OUTPUT.=('</form>');
2 changes: 1 addition & 1 deletion engine/Default/galactic_post_make_paper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
$container = array();
$container['url'] = 'galactic_post_make_paper_processing.php';
$PHP_OUTPUT.=create_echo_form($container);
$PHP_OUTPUT.=('<input type="text" name="title" id="InputFields" class="center" style="width:525;"><br /><br />');
$PHP_OUTPUT.=('<input type="text" name="title" class="center InputFields" style="width:525;"><br /><br />');
$PHP_OUTPUT.=create_submit('Make the paper');
$PHP_OUTPUT.=('</form>');
4 changes: 2 additions & 2 deletions htdocs/album/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
<td valign="top" align="center">
<form action="search_processing.php">
Quick Search:<br />
<input type="text" name="nick" size="10" id="InputFields"><br />
<input type="submit" value="Search" id="InputFields">
<input type="text" name="nick" size="10" class="InputFields"><br />
<input type="submit" value="Search" class="InputFields">
</form>

</td>
Expand Down
5 changes: 1 addition & 4 deletions htdocs/css/Default.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ h3 {
}
/* ----- End Heading styles ----- */
/* ---------------------------- */
#InputFields, .InputFields {
.InputFields {
font: inherit;
}
.submitStyle:link {
Expand All @@ -51,9 +51,6 @@ h3 {
padding: 0px 8px;
display: inline-table; /* Fixes the problems with vertical overlap in FF, but not IE :( */
}
#InputFieldsText {
font: inherit;
}
/* ------------------------------------ */
#help_content {
margin: 10px 20px 50px 20px;
Expand Down
5 changes: 0 additions & 5 deletions htdocs/css/Default/Default.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ h1, h2 {
color: #FFFFFF;
border: 1px solid #80C870;
}
#InputFieldsText {
background: #06240E;
color: #FFFFFF;
border: 1px solid #80C870;
}
a.scan_btn {
background: #060E88;
color: #BBBBBB;
Expand Down
5 changes: 0 additions & 5 deletions htdocs/css/Freon22/ClassicGreen.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ h1, h2 {
color: #FFFFFF;
border: 1px solid #80C870;
}
#InputFieldsText {
background: #06240E;
color: #FFFFFF;
border: 1px solid #80C870;
}
a.scan_btn {
background: #060E88;
color: #BBBBBB;
Expand Down
10 changes: 8 additions & 2 deletions htdocs/js/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,19 @@ var exec = function(s) {
}
};
};
// Prevent further click actions after a link is clicked.
// This is skipped if the link has a "target" attribute specified.
$(function() {
$('a[href]:not([target])').click(function(e) {
// If this isn't the left mouse button then don't try to stop further clicks.
// This is useful because it means we do not disable on a middle click (new tab).
// Did we click the link with the left mouse button?
// We don't want to trigger this on right/middle clicks.
if(e.which !== 1) {
return;
}
// Don't trigger if clicked link has a no-op href attribute.
if (this.href === 'javascript:void(0)') {
return;
}
if(linkFollowed !== true) {
linkFollowed = true;
location.href = this.href;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/js/weapon_reorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ var table = document.getElementById('weapon_reorder');
var tableDnD = new TableDnD();
tableDnD.init(table);

moveRow=function(cell, move) {
function moveRow(cell, move) {
var currentRow = cell.parentNode;
var currentRowID = false;
var rows = currentRow.parentNode.rows;
Expand Down
12 changes: 6 additions & 6 deletions htdocs/login_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@
<table border='0' cellspacing='0' cellpadding='1'>
<tr>
<td width='27%'>User name:</td>
<td width='73%'><input type='text' name='login' size='20' maxlength='32' id='InputFields'></td>
<td width='73%'><input type='text' name='login' size='20' maxlength='32' class="InputFields"></td>
</tr>
<tr>
<td width='27%'>Password:</td>
<td width='73%'><input type='password' name='password' size='20' maxlength='32' id='InputFields'></td>
<td width='73%'><input type='password' name='password' size='20' maxlength='32' class="InputFields"></td>
</tr>
<tr>
<td width='27%'>Verify Password:</td>
<td width='73%'><input type='password' name='pass_verify' size='20' maxlength='32' id='InputFields'></td>
<td width='73%'><input type='password' name='pass_verify' size='20' maxlength='32' class="InputFields"></td>
</tr>
<tr>
<td width='27%'>E-Mail Address:</td>
<td width='73%'><input type='email' name='email' size='50' maxlength='128' id='InputFields'></td>
<td width='73%'><input type='email' name='email' size='50' maxlength='128' class="InputFields"></td>
</tr>
<tr>
<td width='27%'>Local Time:</td>
<td width='73%'>
<select name="timez" id="InputFields"><?php
<select name="timez" class="InputFields"><?php
$time = TIME;
for ($i = -12; $i<= 11; $i++) {
?><option value="<?php echo $i; ?>"><?php echo date(DEFAULT_DATE_TIME_SHORT, $time + $i * 3600); ?></option><?php
Expand All @@ -67,7 +67,7 @@
</tr>
<tr>
<td width='27%'>Referral ID (Optional):</td>
<td width='73%'><input type='text' name='referral_id' size='10' maxlength='20' id='InputFields'<?php if(isset($_REQUEST['ref'])){ echo 'value="'.htmlspecialchars($_REQUEST['ref']).'"'; }?>></td>
<td width='73%'><input type='text' name='referral_id' size='10' maxlength='20' class="InputFields" <?php if(isset($_REQUEST['ref'])){ echo 'value="'.htmlspecialchars($_REQUEST['ref']).'"'; }?>></td>
</tr>
<tr>
<td colspan='2'><div class="g-recaptcha" data-sitekey="<?php echo RECAPTCHA_PUBLIC; ?>"></div></td>
Expand Down
4 changes: 2 additions & 2 deletions htdocs/resend_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
<table border="0">
<tr>
<th align="right">Email:</th>
<td><input type="email" name="email" id="InputFields"></td>
<td><input type="email" name="email" class="InputFields"></td>
</tr>
</table>
<p><input type="submit" value="Resend my password" id="InputFields"></p>
<p><input type="submit" value="Resend my password" class="InputFields"></p>
</div>
</form>

Expand Down
10 changes: 5 additions & 5 deletions htdocs/reset_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@
<table border="0">
<tr>
<th align="right">Username:</th>
<td><input name="login" type="text" id="InputFields" value="<?php echo isset($_REQUEST['login']) ? htmlspecialchars($_REQUEST['login']) : ''; ?>" /></td>
<td><input name="login" type="text" class="InputFields" value="<?php echo isset($_REQUEST['login']) ? htmlspecialchars($_REQUEST['login']) : ''; ?>" /></td>
</tr>
<tr>
<th align="right">Password Reset Code:</th>
<td><input name="password_reset" type="text" id="InputFields" value="<?php echo isset($_REQUEST['resetcode']) ? htmlspecialchars($_REQUEST['resetcode']) : ''; ?>" /></td>
<td><input name="password_reset" type="text" class="InputFields" value="<?php echo isset($_REQUEST['resetcode']) ? htmlspecialchars($_REQUEST['resetcode']) : ''; ?>" /></td>
</tr>
<tr>
<th align="right">New Password:</th>
<td><input name="password" type="password" id="InputFields" /></td>
<td><input name="password" type="password" class="InputFields" /></td>
</tr>
<tr>
<th align="right">Verify New Password:</th>
<td><input name="pass_verify" type="password" id="InputFields" /></td>
<td><input name="pass_verify" type="password" class="InputFields" /></td>
</tr>
</table>
<p><input type="submit" value="Reset my password" id="InputFields" /></p>
<p><input type="submit" value="Reset my password" class="InputFields" /></p>
</div>
</form>

Expand Down
8 changes: 4 additions & 4 deletions lib/Album/album_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ function album_entry($album_id) {
echo('<input type="hidden" name="album_id" value="'.$album_id.'">');
echo('<table>');
echo('<tr>');
echo('<td style="color:green; font-size:70%;">Nick:<br /><input type="text" size="10" name="nick" value="' . htmlspecialchars(get_album_nick(SmrSession::$account_id)) . '" id="InputFields" readonly></td>');
echo('<td style="color:green; font-size:70%;">Comment:<br /><input type="text" size="50" name="comment" id="InputFields"></td>');
echo('<td style="color:green; font-size:70%;"><br /><input type="submit" value="Send" id="InputFields"></td>');
echo('<td style="color:green; font-size:70%;">Nick:<br /><input type="text" size="10" name="nick" value="' . htmlspecialchars(get_album_nick(SmrSession::$account_id)) . '" class="InputFields" readonly></td>');
echo('<td style="color:green; font-size:70%;">Comment:<br /><input type="text" size="50" name="comment" class="InputFields"></td>');
echo('<td style="color:green; font-size:70%;"><br /><input type="submit" value="Send" class="InputFields"></td>');
$db->query('SELECT *
FROM account_has_permission
WHERE account_id = '.$db->escapeNumber(SmrSession::$account_id).' AND
permission_id = '.$db->escapeNumber(PERMISSION_MODERATE_PHOTO_ALBUM));
if ($db->nextRecord())
echo('<td style="color:green; font-size:70%;"><br /><input type="submit" name="action" value="Moderate" id="InputFields"></td>');
echo('<td style="color:green; font-size:70%;"><br /><input type="submit" name="action" value="Moderate" class="InputFields"></td>');

echo('</tr>');
echo('</table>');
Expand Down
2 changes: 1 addition & 1 deletion lib/Default/Template.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class Template {

$xml='';
$dom = new DOMDocument();
@$dom->loadHTML($str);
$dom->loadHTML($str);
$xpath = new DOMXpath($dom);
$ajaxSelectors = array('//span[@id]', '//*[contains(@class,"ajax")]');
foreach ($ajaxSelectors as $selector) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Default/smr.inc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function create_form($container,$actions) {
}

function create_submit($value) {
return ('<input type="submit" name="action" value="'.htmlspecialchars($value).'" id="InputFields" />');
return ('<input type="submit" name="action" value="'.htmlspecialchars($value).'" class="InputFields" />');
}

function create_error($message) {
Expand Down
6 changes: 3 additions & 3 deletions templates/Default/admin/Default/1.6/GameDetails.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<tr>
<td class="right">Game Type</td>
<td>
<select name="game_type" id="InputFields"><?php
<select name="game_type" class="InputFields"><?php
foreach (SmrGame::GAME_TYPES as $GameTypeID => $GameType) {
?><option value="<?php echo $GameTypeID; ?>" <?php if ($GameType == $Game['gameType']) echo 'selected'; ?>><?php echo $GameType; ?></option><?php
} ?>
Expand All @@ -64,8 +64,8 @@
<tr>
<td class="right">Ignore Stats</td>
<td>
Yes: <input type="radio" name="ignore_stats" id="InputFields" value="Yes" <?php if ($Game['ignoreStats']) { echo "checked"; } ?> /><br />
No: <input type="radio" name="ignore_stats" id="InputFields" value="No" <?php if (!$Game['ignoreStats']) { echo "checked"; } ?> /><br />
Yes: <input type="radio" name="ignore_stats" class="InputFields" value="Yes" <?php if ($Game['ignoreStats']) { echo "checked"; } ?> /><br />
No: <input type="radio" name="ignore_stats" class="InputFields" value="No" <?php if (!$Game['ignoreStats']) { echo "checked"; } ?> /><br />
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<td><input class="center" type="number" min="1" max="100" value="15" name="width<?php echo $i; ?>"></td>
<td><input class="center" type="number" min="1" max="100" value="15" name="height<?php echo $i; ?>"></td>
<td>
<select name="type<?php echo $i; ?>" id="InputFields"><?php
<select name="type<?php echo $i; ?>" class="InputFields"><?php
foreach($GalaxyTypes as $GalaxyType) {
?><option value="<?php echo htmlspecialchars($GalaxyType); ?>"><?php echo $GalaxyType; ?></option><?php
} ?>
Expand Down
30 changes: 15 additions & 15 deletions templates/Default/admin/Default/account_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
echo $EditingAccount->getAccountID();
}
else { ?>
<input type="number" name="account_id" id="InputFields" size="5"><?php
<input type="number" name="account_id" class="InputFields" size="5"><?php
} ?>
</td>
</tr>
Expand All @@ -19,7 +19,7 @@
echo $EditingAccount->getLogin();
}
else { ?>
<input type="text" name="login" id="InputFields" size="20"><?php
<input type="text" name="login" class="InputFields" size="20"><?php
} ?>
</td>
</tr>
Expand All @@ -30,7 +30,7 @@
echo $EditingAccount->getValidationCode();
}
else { ?>
<input type="text" name="val_code" id="InputFields" size="20"><?php
<input type="text" name="val_code" class="InputFields" size="20"><?php
} ?>
</td>
</tr>
Expand All @@ -41,7 +41,7 @@
echo $EditingAccount->getEmail();
}
else { ?>
<input type="email" name="email" id="InputFields" size="20"><?php
<input type="email" name="email" class="InputFields" size="20"><?php
} ?>
</td>
</tr>
Expand All @@ -52,7 +52,7 @@
echo $EditingAccount->getHofName();
}
else { ?>
<input type="text" name="hofname" id="InputFields" size="20"><?php
<input type="text" name="hofname" class="InputFields" size="20"><?php
} ?>
</td>
</tr><?php
Expand Down Expand Up @@ -129,7 +129,7 @@

<tr>
<td align="right" valign="top" class="bold">Donation:</td>
<td><input type="number" name="donation" size="5" id="InputFields" class="center">$</td>
<td><input type="number" name="donation" size="5" class="InputFields center">$</td>
</tr>
<tr>
<td>&nbsp;</td>
Expand All @@ -138,7 +138,7 @@

<tr>
<td align="right" valign="top" class="bold">Grant Reward SMR Credits:</td>
<td><input type="number" name="grant_credits" size="5" id="InputFields" class="center"> Credits</td>
<td><input type="number" name="grant_credits" size="5" class="InputFields center"> Credits</td>
</tr>

<tr>
Expand Down Expand Up @@ -169,7 +169,7 @@
</td>
</tr>
</table>
<p>Note (optional): <input type="text" name="close_by_request_note" id="InputFields" /></p>
<p>Note (optional): <input type="text" name="close_by_request_note" class="InputFields" /></p>
</td>
</tr>

Expand Down Expand Up @@ -207,11 +207,11 @@ function go() {
</p>
<p>
<input type="radio" name="choise" value="individual">
New Reason: <input type="text" name="reason_msg" id="InputFields" style="width:400px;">
New Reason: <input type="text" name="reason_msg" class="InputFields" style="width:400px;">
</p>
<p><input type="radio" name="choise" value="reopen"> Reopen! (Will remove ban points, if specified)</p>
<p>Suspicion: <input type="text" name="suspicion" id="InputFields" disabled="disabled" style="width:300px;" value="Use for multi closings only"></p>
<p>Ban Points: <input type="number" name="points" id="InputFields" class="center" style="width:40px;"> points</p>
<p>Suspicion: <input type="text" name="suspicion" class="InputFields" disabled="disabled" style="width:300px;" value="Use for multi closings only"></p>
<p>Ban Points: <input type="number" name="points" class="InputFields center" style="width:40px;"> points</p>
</td>
</tr>

Expand Down Expand Up @@ -329,12 +329,12 @@ function go() {
else { ?>
<tr>
<td align="right" class="bold">Player Name:</td>
<td><input type="text" name="player_name" id="InputFields" size="20"></td>
<td><input type="text" name="player_name" class="InputFields" size="20"></td>
</tr>
<tr>
<td align="right" class="bold">Game:</td>
<td>
<select name="game_id" size="1" id="InputFields">
<select name="game_id" size="1" class="InputFields">
<option value="0">All Games</option><?php
foreach ($Games as $Game) {
?><option value="<?php echo $Game->getGameID(); ?>"><?php echo $Game->getDisplayName(); ?></option><?php
Expand All @@ -351,10 +351,10 @@ function go() {
<tr>
<td><?php
if(isset($EditingAccount)) { ?>
<input type="submit" name="action" value="Edit Account" id="InputFields" /><?php
<input type="submit" name="action" value="Edit Account" class="InputFields" /><?php
}
else { ?>
<input type="submit" name="action" value="Search" id="InputFields" /><?php
<input type="submit" name="action" value="Search" class="InputFields" /><?php
} ?>
</td><?php

Expand Down
Loading

0 comments on commit f76ccdc

Please sign in to comment.