fix warning staffpanel part

This commit is contained in:
xiaomlove
2021-01-07 17:35:00 +08:00
parent 69857a62b7
commit 86f364af9d
21 changed files with 71 additions and 51 deletions
+8 -7
View File
@@ -68,6 +68,7 @@ function get_type_name($type)
function print_ad_editor($position, $row = "") function print_ad_editor($position, $row = "")
{ {
global $lang_admanage; global $lang_admanage;
global $allowxhtmlclass;
switch ($position) switch ($position)
{ {
case 'header': case 'header':
@@ -136,11 +137,11 @@ tr($lang_admanage['row_type']."<font color=\"red\">*</font>", "<select name=\"ad
<h2 align="left"><?php echo $lang_admanage['text_image']?></h2> <h2 align="left"><?php echo $lang_admanage['text_image']?></h2>
<table border="1" cellspacing="0" cellpadding="10" width="100%"> <table border="1" cellspacing="0" cellpadding="10" width="100%">
<?php <?php
tr($lang_admanage['row_image_url']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"ad[image][url]\"".($type == 'image' ? " value=\"".$pararow['url']."\"" : "")." style=\"width: 300px\" /> ".$lang_admanage['text_image_url_note'], 1); tr($lang_admanage['row_image_url']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"ad[image][url]\"".($type == 'image' ? " value=\"".($pararow['url'] ?? '')."\"" : "")." style=\"width: 300px\" /> ".$lang_admanage['text_image_url_note'], 1);
tr($lang_admanage['row_image_link']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"ad[image][link]\"".($type == 'image' ? " value=\"".$pararow['link']."\"" : "")." style=\"width: 300px\" /> ".$lang_admanage['text_image_link_note'], 1); tr($lang_admanage['row_image_link']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"ad[image][link]\"".($type == 'image' ? " value=\"".($pararow['link'] ?? '')."\"" : "")." style=\"width: 300px\" /> ".$lang_admanage['text_image_link_note'], 1);
tr($lang_admanage['row_image_width'], "<input type=\"text\" name=\"ad[image][width]\"".($type == 'image' ? " value=\"".$pararow['width']."\"" : "")." style=\"width: 100px\" /> ".$lang_admanage['text_image_width_note'], 1); tr($lang_admanage['row_image_width'], "<input type=\"text\" name=\"ad[image][width]\"".($type == 'image' ? " value=\"".($pararow['width'] ?? '')."\"" : "")." style=\"width: 100px\" /> ".$lang_admanage['text_image_width_note'], 1);
tr($lang_admanage['row_image_height'], "<input type=\"text\" name=\"ad[image][height]\"".($type == 'image' ? " value=\"".$pararow['height']."\"" : "")." style=\"width: 100px\" /> ".$lang_admanage['text_image_height_note'], 1); tr($lang_admanage['row_image_height'], "<input type=\"text\" name=\"ad[image][height]\"".($type == 'image' ? " value=\"".($pararow['height'] ?? '')."\"" : "")." style=\"width: 100px\" /> ".$lang_admanage['text_image_height_note'], 1);
tr($lang_admanage['row_image_tooltip'], "<input type=\"text\" name=\"ad[image][title]\"".($type == 'image' ? " value=\"".$pararow['title']."\"" : "")." style=\"width: 300px\" /> ".$lang_admanage['text_image_tooltip_note'], 1); tr($lang_admanage['row_image_tooltip'], "<input type=\"text\" name=\"ad[image][title]\"".($type == 'image' ? " value=\"".($pararow['title'] ?? '')."\"" : "")." style=\"width: 300px\" /> ".$lang_admanage['text_image_tooltip_note'], 1);
?> ?>
</table> </table>
</div> </div>
@@ -187,7 +188,7 @@ tr($lang_admanage['row_flash_height']."<font color=\"red\">*</font>", "<input ty
<?php <?php
} }
$action = $_GET['action']; $action = $_GET['action'] ?? '';
if ($action == 'del') if ($action == 'del')
{ {
$id = intval($_GET['id'] ?? 0); $id = intval($_GET['id'] ?? 0);
@@ -380,7 +381,7 @@ begin_main_frame();
print("<p align=\"center\">".$lang_admanage['text_no_ads_yet']."</p>"); print("<p align=\"center\">".$lang_admanage['text_no_ads_yet']."</p>");
else{ else{
list($pagertop, $pagerbottom, $limit) = pager($perpage, $num, "?"); list($pagertop, $pagerbottom, $limit) = pager($perpage, $num, "?");
$res = sql_query("SELECT * FROM advertisements ORDER BY id DESC ".(int)$limit) or sqlerr(__FILE__, __LINE__); $res = sql_query("SELECT * FROM advertisements ORDER BY id DESC ".$limit) or sqlerr(__FILE__, __LINE__);
?> ?>
<table border="1" cellspacing="0" cellpadding="5" width="940"> <table border="1" cellspacing="0" cellpadding="5" width="940">
<tr> <tr>
+2 -2
View File
@@ -18,14 +18,14 @@ if ($action == 'showlist') {
<form method=post action=allowedemails.php> <form method=post action=allowedemails.php>
<input type=hidden name=action value=savelist> <input type=hidden name=action value=savelist>
<tr><td>Enter a list of allowed email addresses (separated by spaces):<br />To allow a specific address enter "email@domain.com", to allow an entire domain enter "@domain.com"</td> <tr><td>Enter a list of allowed email addresses (separated by spaces):<br />To allow a specific address enter "email@domain.com", to allow an entire domain enter "@domain.com"</td>
<td><textarea name="value" rows="5" cols="40"><?php echo $list[value]?></textarea> <td><textarea name="value" rows="5" cols="40"><?php echo $list['value']?></textarea>
<input type=submit value="save"></form></td> <input type=submit value="save"></form></td>
</tr></table> </tr></table>
<?php <?php
stdfoot () ; stdfoot () ;
}elseif ($action == 'savelist') { }elseif ($action == 'savelist') {
stdhead ("Save List"); stdhead ("Save List");
$value = trim ( htmlspecialchars ( $_POST[value] ) ) ; $value = trim ( htmlspecialchars ( $_POST['value'] ) ) ;
sql_query("UPDATE allowedemails SET value = ".sqlesc($value)) or sqlerr(__FILE__, __LINE__); sql_query("UPDATE allowedemails SET value = ".sqlesc($value)) or sqlerr(__FILE__, __LINE__);
Print ("Saved."); Print ("Saved.");
stdfoot () ; stdfoot () ;
+4 -4
View File
@@ -12,7 +12,7 @@ stdhead("Add Upload", false);
<form method=post action=takeamountupload.php> <form method=post action=takeamountupload.php>
<?php <?php
if ($_GET["returnto"] || $_SERVER["HTTP_REFERER"]) if (isset($_GET["returnto"]) || $_SERVER["HTTP_REFERER"])
{ {
?> ?>
<input type=hidden name=returnto value="<?php echo htmlspecialchars($_GET["returnto"]) ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"])?>"> <input type=hidden name=returnto value="<?php echo htmlspecialchars($_GET["returnto"]) ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"])?>">
@@ -21,7 +21,7 @@ if ($_GET["returnto"] || $_SERVER["HTTP_REFERER"])
?> ?>
<table cellspacing=0 cellpadding=5> <table cellspacing=0 cellpadding=5>
<?php <?php
if ($_GET["sent"] == 1) { if (isset($_GET["sent"]) && $_GET["sent"] == 1) {
?> ?>
<tr><td colspan=2 class="text" align="center"><font color=red><b>Upload amount has been added and inform message has been sent.</font></b></tr></td> <tr><td colspan=2 class="text" align="center"><font color=red><b>Upload amount has been added and inform message has been sent.</font></b></tr></td>
<?php <?php
@@ -108,7 +108,7 @@ if ($_GET["sent"] == 1) {
</td> </td>
</tr> </tr>
<tr><td class="rowhead" valign="top">Subject </td><td class="rowfollow"><input type=text name=subject size=82></td></tr> <tr><td class="rowhead" valign="top">Subject </td><td class="rowfollow"><input type=text name=subject size=82></td></tr>
<tr><td class="rowhead" valign="top">Reason </td><td class="rowfollow"><textarea name=msg cols=80 rows=5><?php echo $body?></textarea></td></tr> <tr><td class="rowhead" valign="top">Reason </td><td class="rowfollow"><textarea name=msg cols=80 rows=5><?php echo $body ?? ''?></textarea></td></tr>
<tr> <tr>
<td class="rowfollow" colspan=2><div align="center"><b>Operator:&nbsp;&nbsp;</b> <td class="rowfollow" colspan=2><div align="center"><b>Operator:&nbsp;&nbsp;</b>
<?php echo $CURUSER['username']?> <?php echo $CURUSER['username']?>
@@ -118,7 +118,7 @@ if ($_GET["sent"] == 1) {
</div></td></tr> </div></td></tr>
<tr><td class="rowfollow" colspan=2 align=center><input type=submit value="Do It!" class=btn></td></tr> <tr><td class="rowfollow" colspan=2 align=center><input type=submit value="Do It!" class=btn></td></tr>
</table> </table>
<input type=hidden name=receiver value=<?php echo $receiver?>> <input type=hidden name=receiver value=<?php echo $receiver ?? ''?>>
</form> </form>
</div></td></tr></table> </div></td></tr></table>
+2 -2
View File
@@ -16,14 +16,14 @@ if ($action == 'showlist') {
<form method=post action=bannedemails.php> <form method=post action=bannedemails.php>
<input type=hidden name=action value=savelist> <input type=hidden name=action value=savelist>
<tr><td>Enter a list of banned email addresses (separated by spaces):<br />To ban a specific address enter "email@domain.com", to ban an entire domain enter "@domain.com"</td> <tr><td>Enter a list of banned email addresses (separated by spaces):<br />To ban a specific address enter "email@domain.com", to ban an entire domain enter "@domain.com"</td>
<td><textarea name="value" rows="5" cols="40"><?php echo $list[value]?></textarea> <td><textarea name="value" rows="5" cols="40"><?php echo $list['value']?></textarea>
<input type=submit value="save"></form></td> <input type=submit value="save"></form></td>
</tr></table> </tr></table>
<?php <?php
stdfoot () ; stdfoot () ;
}elseif ($action == 'savelist') { }elseif ($action == 'savelist') {
stdhead (VERSION." - Save List"); stdhead (VERSION." - Save List");
$value = trim ( htmlspecialchars ( $_POST[value] ) ) ; $value = trim ( htmlspecialchars ( $_POST['value'] ?? '' ) ) ;
sql_query("UPDATE bannedemails SET value = ".sqlesc($value)) or sqlerr(__FILE__, __LINE__); sql_query("UPDATE bannedemails SET value = ".sqlesc($value)) or sqlerr(__FILE__, __LINE__);
Print ("Saved."); Print ("Saved.");
stdfoot () ; stdfoot () ;
+6 -6
View File
@@ -5,11 +5,11 @@ loggedinorreturn();
if (get_user_class() < UC_ADMINISTRATOR) if (get_user_class() < UC_ADMINISTRATOR)
stderr("Sorry", "Access denied."); stderr("Sorry", "Access denied.");
$remove = (int)$_GET['remove']; $remove = intval($_GET['remove'] ?? 0);
if (is_valid_id($remove)) if (is_valid_id($remove))
{ {
sql_query("DELETE FROM bans WHERE id=".mysql_real_escape_string($remove)) or sqlerr(); sql_query("DELETE FROM bans WHERE id=".mysql_real_escape_string($remove)) or sqlerr();
write_log("Ban ".htmlspecialchars($remove)." was removed by $CURUSER[id] ($CURUSER[username])",'mod'); write_log("Ban ".htmlspecialchars($remove)." was removed by {$CURUSER['id']} ($CURUSER[username])",'mod');
} }
if ($_SERVER["REQUEST_METHOD"] == "POST" && get_user_class() >= UC_ADMINISTRATOR) if ($_SERVER["REQUEST_METHOD"] == "POST" && get_user_class() >= UC_ADMINISTRATOR)
@@ -25,8 +25,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && get_user_class() >= UC_ADMINISTRATOR
stderr("Error", "Bad IP address."); stderr("Error", "Bad IP address.");
$comment = sqlesc($comment); $comment = sqlesc($comment);
$added = sqlesc(date("Y-m-d H:i:s")); $added = sqlesc(date("Y-m-d H:i:s"));
sql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES($added, ".mysql_real_escape_string($CURUSER[id]).", $firstlong, $lastlong, $comment)") or sqlerr(__FILE__, __LINE__); sql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES($added, ".mysql_real_escape_string($CURUSER['id']).", $firstlong, $lastlong, $comment)") or sqlerr(__FILE__, __LINE__);
header("Location: $_SERVER[REQUEST_URI]"); header("Location: {$_SERVER['REQUEST_URI']}");
die; die;
} }
@@ -48,8 +48,8 @@ else
while ($arr = mysql_fetch_assoc($res)) while ($arr = mysql_fetch_assoc($res))
{ {
print("<tr><td>".gettime($arr[added])."</td><td align=left>".long2ip($arr[first])."</td><td align=left>".long2ip($arr[last])."</td><td align=left>". get_username($arr['addedby']) . print("<tr><td>".gettime($arr['added'])."</td><td align=left>".long2ip($arr['first'])."</td><td align=left>".long2ip($arr['last'])."</td><td align=left>". get_username($arr['addedby']) .
"</td><td align=left>$arr[comment]</td><td><a href=bans.php?remove=$arr[id]>Remove</a></td></tr>\n"); "</td><td align=left>{$arr['comment']}</td><td><a href=bans.php?remove={$arr['id']}>Remove</a></td></tr>\n");
} }
print("</table>\n"); print("</table>\n");
} }
+4 -4
View File
@@ -8,7 +8,7 @@ stderr("Sorry", "Access denied.");
$bucketpath = "$bitbucket"; $bucketpath = "$bitbucket";
if (get_user_class() >= UC_MODERATOR) if (get_user_class() >= UC_MODERATOR)
{ {
$delete = $_GET["delete"]; $delete = intval($_GET["delete"] ?? 0);
if (is_valid_id($delete)) { if (is_valid_id($delete)) {
$r = sql_query("SELECT name,owner FROM bitbucket WHERE id=".mysql_real_escape_string($delete)) or sqlerr(__FILE__, __LINE__); $r = sql_query("SELECT name,owner FROM bitbucket WHERE id=".mysql_real_escape_string($delete)) or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($r) == 1) { if (mysql_num_rows($r) == 1) {
@@ -21,7 +21,7 @@ if (get_user_class() >= UC_MODERATOR)
stdhead("BitBucket Log"); stdhead("BitBucket Log");
$res = sql_query("SELECT count(*) FROM bitbucket") or die(mysql_error()); $row = mysql_fetch_array($res); $count = $row[0]; $res = sql_query("SELECT count(*) FROM bitbucket") or die(mysql_error()); $row = mysql_fetch_array($res); $count = $row[0];
$perpage = 10; $perpage = 10;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] . "?out=" . $_GET["out"] . "&" ); list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] . "?out=" . ($_GET["out"] ?? '') . "&" );
print("<h1>BitBucket Log</h1>\n"); print("<h1>BitBucket Log</h1>\n");
print("Total Images Stored: $count"); print("Total Images Stored: $count");
echo $pagertop; echo $pagertop;
@@ -38,8 +38,8 @@ if (get_user_class() >= UC_MODERATOR)
$url = str_replace(" ", "%20", htmlspecialchars("$bitbucket/$name")); $url = str_replace(" ", "%20", htmlspecialchars("$bitbucket/$name"));
print("<tr>"); print("<tr>");
print("<td><center><a href=$url><img src=\"".$url."\" border=0 onLoad='SetSize(this, 400)'></a></center>"); print("<td><center><a href=$url><img src=\"".$url."\" border=0 onLoad='SetSize(this, 400)'></a></center>");
print("Uploaded by: " . get_username($arr[owner]). "<br />"); print("Uploaded by: " . get_username($arr['owner']). "<br />");
print("(#$arr[id]) Filename: $name ($width&nbsp;x&nbsp;$height)"); print("(#{$arr['id']}) Filename: $name ($width&nbsp;x&nbsp;$height)");
if (get_user_class() >= UC_MODERATOR) if (get_user_class() >= UC_MODERATOR)
print(" <b><a href=?delete=$arr[id]>[Delete]</a></b><br />"); print(" <b><a href=?delete=$arr[id]>[Delete]</a></b><br />");
print("Added: $date $time"); print("Added: $date $time");
+3 -3
View File
@@ -356,12 +356,12 @@ tr($lang_catmanage['col_order'], "<input type=\"text\" name=\"sort_index\" value
} }
$validsubcattype=array('source', 'medium', 'codec', 'standard', 'processing', 'team', 'audiocodec'); $validsubcattype=array('source', 'medium', 'codec', 'standard', 'processing', 'team', 'audiocodec');
$type = $_GET['type']; $type = $_GET['type'] ?? '';
if ($type == '') if ($type == '')
$type = 'searchbox'; $type = 'searchbox';
else else
check_valid_type($type); check_valid_type($type);
$action = $_GET['action']; $action = $_GET['action'] ?? '';
if ($action == '') if ($action == '')
$action = 'view'; $action = 'view';
if ($action == 'view') if ($action == 'view')
@@ -725,7 +725,7 @@ elseif($action == 'submit')
$codec = intval($_POST['codec'] ?? 0); $codec = intval($_POST['codec'] ?? 0);
$standard = intval($_POST['standard'] ?? 0); $standard = intval($_POST['standard'] ?? 0);
$processing = intval($_POST['processing'] ?? 0); $processing = intval($_POST['processing'] ?? 0);
$team = intval($_POST['team'] ?? 0; $team = intval($_POST['team'] ?? 0);
$audiocodec = intval($_POST['audiocodec'] ?? 0); $audiocodec = intval($_POST['audiocodec'] ?? 0);
if (!$name || !$image) if (!$name || !$image)
stderr($lang_catmanage['std_error'], $lang_catmanage['std_missing_form_data']); stderr($lang_catmanage['std_error'], $lang_catmanage['std_missing_form_data']);
+1 -1
View File
@@ -11,7 +11,7 @@ echo "<p>";
echo "clean-up in progress...please wait<br />"; echo "clean-up in progress...please wait<br />";
ob_flush(); ob_flush();
flush(); flush();
if ($_GET['forceall']) { if (isset($_GET['forceall']) && $_GET['forceall']) {
$forceall = 1; $forceall = 1;
} else { } else {
$forceall = 0; $forceall = 0;
+5
View File
@@ -102,6 +102,11 @@ class DB
return $this->driver->lastInsertId(); return $this->driver->lastInsertId();
} }
public function freeResult($result)
{
return $this->driver->freeResult($result);
}
+4
View File
@@ -76,5 +76,9 @@ class DBMysqli implements DBInterface
return $this->mysqli->insert_id; return $this->mysqli->insert_id;
} }
public function freeResult($mysqliResult)
{
return $mysqliResult->free_result();
}
} }
+5
View File
@@ -59,3 +59,8 @@ function mysql_insert_id()
{ {
return DB::getInstance()->lastInsertId(); return DB::getInstance()->lastInsertId();
} }
function mysql_free_result($result)
{
return DB::getInstance()->freeResult($result);
}
+2
View File
@@ -26,4 +26,6 @@ interface DBInterface
public function lastInsertId(): int; public function lastInsertId(): int;
public function freeResult($result);
} }
+1
View File
@@ -22,6 +22,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes")
<td class=colhead width=125>IP</td> <td class=colhead width=125>IP</td>
<td class=colhead width=40>Peer</td></tr>\n"); <td class=colhead width=40>Peer</td></tr>\n");
$uc = 0; $uc = 0;
$ip = '';
while($ras = mysql_fetch_assoc($res)) while($ras = mysql_fetch_assoc($res))
{ {
if ($ras["dupl"] <= 1) if ($ras["dupl"] <= 1)
+9 -9
View File
@@ -6,13 +6,13 @@ loggedinorreturn();
if (get_user_class() < UC_SYSOP) { if (get_user_class() < UC_SYSOP) {
die("access denied."); die("access denied.");
} }
mysql_connect($mysql_host,$mysql_user,$mysql_pass); mysql_connect($mysql_host,$mysql_user,$mysql_pass, $BASIC['mysql_db'], $BASIC['mysql_port']);
mysql_select_db($mysql_db); mysql_select_db($mysql_db);
stdhead("Manage Locations"); stdhead("Manage Locations");
begin_main_frame("",false,100); begin_main_frame("",false,100);
begin_frame("Manage Locations",true,10,"100%","center"); begin_frame("Manage Locations",true,10,"100%","center");
$sure = $_GET['sure']; $sure = $_GET['sure'] ?? '';
if($sure == "yes") { if($sure == "yes") {
$delid = $_GET['delid']; $delid = $_GET['delid'];
$query = "DELETE FROM locations WHERE id=" .sqlesc($delid) . " LIMIT 1"; $query = "DELETE FROM locations WHERE id=" .sqlesc($delid) . " LIMIT 1";
@@ -22,7 +22,7 @@ if($sure == "yes") {
stdfoot(); stdfoot();
die(); die();
} }
$delid = $_GET['delid']; $delid = intval($_GET['delid'] ?? 0);
if($delid > 0) { if($delid > 0) {
echo("Are you sure you would like to delete this Location?( <strong><a href='". $_SERVER['PHP_SELF'] . "?delid=$delid&sure=yes'>Yes!</a></strong> / <strong><a href='". $_SERVER['PHP_SELF'] . "'>No</a></strong> )"); echo("Are you sure you would like to delete this Location?( <strong><a href='". $_SERVER['PHP_SELF'] . "?delid=$delid&sure=yes'>Yes!</a></strong> / <strong><a href='". $_SERVER['PHP_SELF'] . "'>No</a></strong> )");
end_frame(); end_frame();
@@ -30,7 +30,7 @@ if($delid > 0) {
die(); die();
} }
$edited = $_GET['edited']; $edited = intval($_GET['edited'] ?? 0);
if($edited == 1) { if($edited == 1) {
$id = intval($_GET['id'] ?? 0); $id = intval($_GET['id'] ?? 0);
$name = $_GET['name']; $name = $_GET['name'];
@@ -103,7 +103,7 @@ if($editid > 0) {
die(); die();
} }
$add = $_GET['add']; $add = $_GET['add'] ?? '';
$success = false; $success = false;
if($add == 'true') { if($add == 'true') {
$name = $_GET['name']; $name = $_GET['name'];
@@ -154,8 +154,8 @@ echo("<tr><td class=toolbox align=center colspan=2><input class=btn type='Submit
echo("</table>"); echo("</table>");
echo("</form>"); echo("</form>");
$range_start_ip = $_GET['range_start_ip']; $range_start_ip = $_GET['range_start_ip'] ?? '';
$range_end_ip = $_GET['range_end_ip']; $range_end_ip = $_GET['range_end_ip'] ?? '';
echo("<form name='form2' method='get' action='" . $_SERVER['PHP_SELF'] . "'>"); echo("<form name='form2' method='get' action='" . $_SERVER['PHP_SELF'] . "'>");
echo("<table class=main cellspacing=0 cellpadding=5 width=48% align=right>"); echo("<table class=main cellspacing=0 cellpadding=5 width=48% align=right>");
@@ -171,8 +171,8 @@ print("<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><
unset($wherea); unset($wherea);
$wherea = '';
$check_range = $_GET['check_range']; $check_range = $_GET['check_range'] ?? '';
if($check_range == 'true') { if($check_range == 'true') {
//stderr("",$range_start_ip . $range_end_ip . validip_format($range_start_ip) . validip_format($range_end_ip)); //stderr("",$range_start_ip . $range_end_ip . validip_format($range_start_ip) . validip_format($range_end_ip));
+2 -1
View File
@@ -7,7 +7,7 @@ stderr("Error", "Permission denied.");
$class = intval($_POST["class"] ?? 0); $class = intval($_POST["class"] ?? 0);
if ($class) if ($class)
int_check($class,true); int_check($class,true);
$or = $_POST["or"]; $or = $_POST["or"] ?? '';
if ($_SERVER["REQUEST_METHOD"] == "POST") if ($_SERVER["REQUEST_METHOD"] == "POST")
{ {
@@ -55,6 +55,7 @@ if (get_user_class() == UC_MODERATOR && $CURUSER["class"] > UC_POWER_USER)
printf("<input type=hidden name=class value=$CURUSER[class]\n"); printf("<input type=hidden name=class value=$CURUSER[class]\n");
else else
{ {
$prefix = '';
print("<tr><td class=rowhead>Classe</td><td colspan=2 align=left><select name=or><option value='<'><<option value='>'>><option value='='>=<option value='<='><=<option value='>='>>=</select><select name=class>\n"); print("<tr><td class=rowhead>Classe</td><td colspan=2 align=left><select name=or><option value='<'><<option value='>'>><option value='='>=<option value='<='><=<option value='>='>>=</select><select name=class>\n");
if (get_user_class() == UC_MODERATOR) if (get_user_class() == UC_MODERATOR)
$maxclass = UC_POWER_USER; $maxclass = UC_POWER_USER;
+2 -2
View File
@@ -35,7 +35,7 @@ function searchform () {
$countrows = number_format(get_row_count("loginattempts")) + 1; $countrows = number_format(get_row_count("loginattempts")) + 1;
$page = intval($_GET["page"] ?? 0); $page = intval($_GET["page"] ?? 0);
$order = $_GET['order']; $order = $_GET['order'] ?? '';
if ($order == 'id') if ($order == 'id')
$orderby = "id"; $orderby = "id";
elseif ($order == 'ip') elseif ($order == 'ip')
@@ -53,7 +53,7 @@ else
$perpage = 5; $perpage = 5;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $countrows, "maxlogin.php?order=$order&"); list($pagertop, $pagerbottom, $limit) = pager($perpage, $countrows, "maxlogin.php?order=$order&");
$msg = '';
if ($action == 'showlist') { if ($action == 'showlist') {
stdhead ("Max. Login Attemps - Show List"); stdhead ("Max. Login Attemps - Show List");
print("<h1>Failed Login Attempts</h1>"); print("<h1>Failed Login Attempts</h1>");
+5 -5
View File
@@ -6,7 +6,7 @@ if (get_user_class() < UC_ADMINISTRATOR) {
stderr("Error","Only Administrators and above can modify the Rules, sorry."); stderr("Error","Only Administrators and above can modify the Rules, sorry.");
} }
if ($_GET["act"] == "newsect") if (isset($_GET["act"]) && $_GET["act"] == "newsect")
{ {
stdhead("Add section"); stdhead("Add section");
//print("<td valign=top style=\"padding: 10px;\" colspan=2 align=center>"); //print("<td valign=top style=\"padding: 10px;\" colspan=2 align=center>");
@@ -30,14 +30,14 @@ if ($_GET["act"] == "newsect")
print("</td></tr></table>"); print("</td></tr></table>");
stdfoot(); stdfoot();
} }
elseif ($_GET["act"]=="addsect"){ elseif (isset($_GET["act"]) && $_GET["act"]=="addsect"){
$title = $_POST["title"]; $title = $_POST["title"];
$text = $_POST["text"]; $text = $_POST["text"];
$language = $_POST["language"]; $language = $_POST["language"];
sql_query("insert into rules (title, text, lang_id) values(".sqlesc($title).", ".sqlesc($text).", ".sqlesc($language).")") or sqlerr(__FILE__,__LINE__); sql_query("insert into rules (title, text, lang_id) values(".sqlesc($title).", ".sqlesc($text).", ".sqlesc($language).")") or sqlerr(__FILE__,__LINE__);
header("Refresh: 0; url=modrules.php"); header("Refresh: 0; url=modrules.php");
} }
elseif ($_GET["act"] == "edit"){ elseif (isset($_GET["act"]) && $_GET["act"] == "edit"){
$id = $_GET["id"]; $id = $_GET["id"];
$res = @mysql_fetch_array(@sql_query("select * from rules where id='$id'")); $res = @mysql_fetch_array(@sql_query("select * from rules where id='$id'"));
stdhead("Edit rules"); stdhead("Edit rules");
@@ -62,7 +62,7 @@ elseif ($_GET["act"] == "edit"){
print("</td></tr></table>"); print("</td></tr></table>");
stdfoot(); stdfoot();
} }
elseif ($_GET["act"]=="edited"){ elseif (isset($_GET["act"]) && $_GET["act"]=="edited"){
$id = intval($_POST["id"] ?? 0); $id = intval($_POST["id"] ?? 0);
$title = $_POST["title"]; $title = $_POST["title"];
$text = $_POST["text"]; $text = $_POST["text"];
@@ -70,7 +70,7 @@ elseif ($_GET["act"]=="edited"){
sql_query("update rules set title=".sqlesc($title).", text=".sqlesc($text).", lang_id = ".sqlesc($language)." where id=".sqlesc($id)) or sqlerr(__FILE__,__LINE__); sql_query("update rules set title=".sqlesc($title).", text=".sqlesc($text).", lang_id = ".sqlesc($language)." where id=".sqlesc($id)) or sqlerr(__FILE__,__LINE__);
header("Refresh: 0; url=modrules.php"); header("Refresh: 0; url=modrules.php");
} }
elseif ($_GET["act"]=="del"){ elseif (isset($_GET["act"]) && $_GET["act"]=="del"){
$id = (int)$_GET["id"]; $id = (int)$_GET["id"];
$sure = intval($_GET["sure"] ?? 0); $sure = intval($_GET["sure"] ?? 0);
if (!$sure) if (!$sure)
+2 -2
View File
@@ -31,8 +31,8 @@ $res = sql_query("SELECT COUNT(*) FROM peers") or sqlerr(__FILE__, __LINE__);
$n = mysql_fetch_row($res); $n = mysql_fetch_row($res);
$n_peers = $n[0]; $n_peers = $n[0];
$uporder = $_GET['uporder']; $uporder = $_GET['uporder'] ?? '';
$catorder = $_GET["catorder"]; $catorder = $_GET["catorder"] ?? '';
if ($uporder == "lastul") if ($uporder == "lastul")
$orderby = "last DESC, name"; $orderby = "last DESC, name";
+1 -1
View File
@@ -8,7 +8,7 @@ if (get_user_class() < UC_MODERATOR) stderr("Error", "Permission denied");
if ($_SERVER["REQUEST_METHOD"] == "POST") if ($_SERVER["REQUEST_METHOD"] == "POST")
$ip = $_POST["ip"]; $ip = $_POST["ip"];
else else
$ip = $_GET["ip"]; $ip = $_GET["ip"] ?? '';
if ($ip) if ($ip)
{ {
$nip = ip2long($ip); $nip = ip2long($ip);
+2 -1
View File
@@ -13,7 +13,7 @@ $year=date('Y');
$month=intval($_GET['month'] ?? 0); $month=intval($_GET['month'] ?? 0);
if (!$month || $month<=0 || $month>12) if (!$month || $month<=0 || $month>12)
$month=date('m'); $month=date('m');
$order=$_GET['order']; $order=$_GET['order'] ?? '';
if (!in_array($order, array('username', 'torrent_size', 'torrent_count'))) if (!in_array($order, array('username', 'torrent_size', 'torrent_count')))
$order='username'; $order='username';
if ($order=='username') if ($order=='username')
@@ -88,6 +88,7 @@ else{
unset($row2); unset($row2);
} }
$res3=sql_query("SELECT users.id AS userid, users.username AS username, 0 AS torrent_count, 0 AS torrent_size FROM users WHERE class >= ".UC_UPLOADER.(count($hasupuserid) ? " AND users.id NOT IN (".implode(",",$hasupuserid).")" : "")." ORDER BY username ASC") or sqlerr(__FILE__, __LINE__); $res3=sql_query("SELECT users.id AS userid, users.username AS username, 0 AS torrent_count, 0 AS torrent_size FROM users WHERE class >= ".UC_UPLOADER.(count($hasupuserid) ? " AND users.id NOT IN (".implode(",",$hasupuserid).")" : "")." ORDER BY username ASC") or sqlerr(__FILE__, __LINE__);
$count = 0;
while($row = mysql_fetch_array($res3)) while($row = mysql_fetch_array($res3))
{ {
$res2 = sql_query("SELECT torrents.id, torrents.name, torrents.added FROM torrents WHERE owner=".$row['userid']." ORDER BY id DESC LIMIT 1"); $res2 = sql_query("SELECT torrents.id, torrents.name, torrents.added FROM torrents WHERE owner=".$row['userid']." ORDER BY id DESC LIMIT 1");
+1 -1
View File
@@ -61,7 +61,7 @@ if (get_user_class() >= UC_ADMINISTRATOR) {
print("<tr><td colspan=10 align=right><input type=\"submit\" name=\"submit\" value=\"Apply Changes\"></td></tr>\n"); print("<tr><td colspan=10 align=right><input type=\"submit\" name=\"submit\" value=\"Apply Changes\"></td></tr>\n");
print("<input type=\"hidden\" name=\"nowarned\" value=\"nowarned\"></form></table>\n"); print("<input type=\"hidden\" name=\"nowarned\" value=\"nowarned\"></form></table>\n");
} }
print("<p>$pagemenu<br>$browsemenu</p>"); print("<p>" . ($pagemenu ?? '') . "<br>" . ($browsemenu ?? '') . "</p>");
die; die;