Jump to content
MakeWebGames

Adjust User Level error


Mystical

Recommended Posts

well here are my cases:

switch ( $_GET['action'] ) {
	case 'editnews': newspaper_form(); break;
	case 'subnews': newspaper_submit(); break;
	case 'givedpform': give_dp_form(); break;
	case 'givedpsub': give_dp_submit(); break;
	case 'stafflist': staff_list(); break;
	case 'userlevel': userlevel(); break;
	case 'userlevelform': userlevelform(); break;
	case 'massmailer': massmailer(); break;
default: echo 'Error: This script requires an action.'; break;

and i assume its the "userlevelform" cause that is where i get the error:

function userlevelform() {
global $db,$ir,$c,$h,$userid;
echo "
<br><h3>User Level Adjust</h3><br />
<form action='staff_special.php?action=userlevel' method='get'>
User: ".user_dropdown($c,'ID')."
<br />
User Level:
<br />
<input type='radio' name='level' value='1' /> Member
<br />
<input type='radio' name='level' value='2' /> Admin
<br />
<input type='radio' name='level' value='3' /> Secretary
<br />
<input type='radio' name='level' value='4' /> Assistant
<br />
<input type='radio' name='level' value='5' /> Forum Mod
<br />
<input type='submit' value='Adjust' />
</form>
";
Link to comment
Share on other sites

All you have to do is this. You do not need to replace anything else.

 

Replace this:

function userlevel() {

global $db,$ir,$c,$h,$userid;

$_GET['level'] = ( isset($_GET['level'])&&in_array($_POST['level'], array(1,2,3,4,5)) )?abs(intval($_GET['level'])):1;

$_GET['ID'] = ( isset($_GET['ID'])&&is_numeric($_GET['ID']) )?abs(intval($_GET['ID'])):'';

$d = $db->query('SELECT `userid` FROM `users` WHERE `userid` = '.$_POST['ID']);

if ( $db->num_rows($d) == 0 ) {

echo 'Invalid user.<br />> <a href="staff_special.php?action=userlevelform">Go Home</a>';

die($h->endpage());

 

With this:

function userlevel() {

global $db,$ir,$c,$h,$userid;

$_GET['level'] = ( isset($_GET['level'])&&in_array($_GET['level'], array(1,2,3,4,5)) )?abs(intval($_GET['level'])):1;

$_GET['ID'] = ( isset($_GET['ID'])&&is_numeric($_GET['ID']) )?abs(intval($_GET['ID'])):'';

$d = $db->query('SELECT `userid` FROM `users` WHERE `userid` = '.$_GET['ID']);

if ( $db->num_rows($d) == 0 ) {

echo 'Invalid user.<br />> <a href="staff_special.php?action=userlevelform">Go Home</a>';

die($h->endpage());

 

The fix was posted by lucky3809 in this thread.....

Edited by Mystical
Link to comment
Share on other sites

This didnt work for me unless im just not seeing it but here is my code
function userlevel() {
global $db,$ir,$c,$h,$userid;
	$_GET['level'] = ( isset($_GET['level'])&&in_array($_GET['level'], array(1,2,3,4,5)) )?abs(intval($_GET['level'])):1;
	$_GET['ID'] = ( isset($_GET['ID'])&&is_numeric($_GET['ID']) )?abs(intval($_GET['ID'])):'';
$d = $db->query('SELECT `userid` FROM `users` WHERE `userid` = '.$_GET['ID']);
    if ( $db->num_rows($d) == 0 ) {
  echo 'Invalid user.<br />> <a href="staff_special.php?action=userlevelform">Go Home</a>';
  die($h->endpage());
    }

 

All you have to do is this. You do not need to replace anything else.

 

Replace this:

 

function userlevel() {
global $db,$ir,$c,$h,$userid;
$_GET['level'] = ( isset($_GET['level'])&&in_array($_POST['level'], array(1,2,3,4,5)) )?abs(intval($_GET['level'])):1;
$_GET['ID'] = ( isset($_GET['ID'])&&is_numeric($_GET['ID']) )?abs(intval($_GET['ID'])):'';
$d = $db->query('SELECT `userid` FROM `users` WHERE `userid` = '.$_POST['ID']);
if ( $db->num_rows($d) == 0 ) {
echo 'Invalid user.<br />> <a href="staff_special.php?action=userlevelform">Go Home</a>';
die($h->endpage());

 

 

With this:

 

function userlevel() {
global $db,$ir,$c,$h,$userid;
$_GET['level'] = ( isset($_GET['level'])&&in_array($_GET['level'], array(1,2,3,4,5)) )?abs(intval($_GET['level'])):1;
$_GET['ID'] = ( isset($_GET['ID'])&&is_numeric($_GET['ID']) )?abs(intval($_GET['ID'])):'';
$d = $db->query('SELECT `userid` FROM `users` WHERE `userid` = '.$_GET['ID']);
if ( $db->num_rows($d) == 0 ) {
echo 'Invalid user.<br />> <a href="staff_special.php?action=userlevelform">Go Home</a>';
die($h->endpage());

 

The fix was posted by lucky3809 in this thread.....

That is exactly what i have

Edited by KyleMassacre
added code tags to look pretty
Link to comment
Share on other sites

Its showing the exact same thing

 

Guess what? Mine was not working either.... When I posted it was fixed it must of been in cache from when I added the old file from V 2.0.2c. So I just checked my file and mine did not work either! Got to looking at it with a blank stare for a few hours until my eyes started to bleed....... 5 or 6 beers later I figured out why it was not working. I am as tired as I am drunk so I posted my entire file on pastebin for you which actually works. Just replace yours with this one and let me know how she goes....

http://pastebin.com/bz79m7HW

Edited by Mystical
Link to comment
Share on other sites

There is an error in staff_special.php for v2.0.3. When I try to update a users level I get this message. Error: This script requires an action. I saw Illusions fix in another thread but after I added the fix I still get the exact same error. Any help would be appreciated.

Try;

<a href='filename.php?action=userlevelform'>User Level Form</a><br />

Link to comment
Share on other sites

it is in your staff.php menu the link to the userlevelform it is nothing on your staff_special.php looked over your script you never said when you got that message after you had clicked on the link from your side menu or after selecting a player.

and still you shouldnt be mixing POST and GET it needs to be all the same or the Post in the query is not being secured by the secured line with GET.

the fix open staff.php

find :

staff_special.php

replace with:

staff_special.php?action=userlevelform

Edited by lucky3809
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...