Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Staff Pin System.

Status
Not open for further replies.
◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜
Developer
Joined
May 29, 2007
Messages
2,167
Reaction score
899
Stop using the MySQL extension. Bad bad bad.
You are right, it's deprecated but at east tell him what to use instead. Tell him to replace the mysql with mysqli which stands for MySQL improved.
 
G'nome sayin'
Joined
May 19, 2011
Messages
459
Reaction score
226
Just use this solution, so much better and you only need to add this into one file. No database requirements etc.

PHP:
<?php
 
$mod_pw = 'passwordhere';
 
if (isset($_SESSION['user']))
{
    $sql = mysql_query("SELECT rank FROM users WHERE id = ".intval($_SESSION['user']['id']));
    $r = mysql_fetch_assoc($sql);
 
    if (@$r['rank'] >= 8 && (!isset($_POST['mod_pw']) || $_POST['mod_pw'] != $mod_pw))
    {
        echo '<form method="post" action="">
    <p>MOD Password.

<br><br>	<input type="password" name="mod_pw" value="" /></p>
    <p><input type="submit" value="Log in" /></p>
</form>';
 
        die;
    }
}
?>

This will require a extra password from everyone over rank 8. You can change both password and rank in the script. Works with RevCMS.
 
xHosts.uk - Windows & Linux VPS - Cosmic Guard
[VIP] Member
Joined
Sep 10, 2011
Messages
857
Reaction score
354
Not bad idea, I am personally more in favor of using either Mysqli or PDO, you could adapt it to allow extra security on paid membership accounts as part of the package allow them to set a personal pin number to access the accounts. Great start though
 
Banned
Banned
Joined
May 6, 2009
Messages
531
Reaction score
165
Just use this solution, so much better and you only need to add this into one file. No database requirements etc.
This will require a extra password from everyone over rank 8. You can change both password and rank in the script. Works with RevCMS.

Exactly what I said... Use only the MySQL to pick the rank, more secure in my opinion...
 
Elite Diviner
Joined
Jul 4, 2013
Messages
498
Reaction score
71
I personally would do key via database instead of same key for every staff member.
Code:
<?php 
if (isset($_SESSION['user'])) 
{ 
    $sql = mysql_query("SELECT * FROM users WHERE id = ".intval($_SESSION['user']['id'])); 
    $r = mysql_fetch_assoc($sql); 
  
    if (@$r['rank'] >= 8 && (!isset($_POST['mod_pw']) || $_POST['mod_pw'] == md5($r['pin']))) 
    {  ?>
		<style>
			body{
				background-image:url('<?php echo $_CONFIG['hotel']['url']; ?>/app/tpl/skins/Habbo/images/bg.png');
			}
			
			input[type='password']{
				border-radius:3px;
				border:1px solid lightgrey;
				height:25px;
				text-align:center;
			}
			
			input[type='submit']{
				border-radius:3px;
				border:1px solid lightgrey;
				background-color:#fff;
				height:25px;
				width:100px;
				font-weight:700;
				margin-top:5px;
			}
			
			input[type='submit']:hover{
				background-color:lightgrey;
			}
		</style>
        <form method="post" align = "center"> 
				  <p>Pin Information<br></p><br> 
				  <input type="password" name="mod_pw" placeholder = "Your client pin!"><br>
				  <input type="submit" value="Enter Pin">
		</form> 
<?php
        die; 
    } 
} 
?>

PS - Key is encrypted with md5 use a MD5 encrypter to create the key


Tested it should work I just used the one Exonize posted and got it selecting keys via database.

SQL
Code:
ALTER TABLE `users` ADD `pin` VARCHAR(255)
 
Experienced Elementalist
Joined
Jun 7, 2012
Messages
288
Reaction score
250
Woops tapatalk bug.

But why not making a dicyonary (array in php dicyonary in .net xd) with the usernames of all staffs so you dont have any mysql query??

Dont get why peaple use so much querys i have there in my cms recache staffpage, recache news, login ,register, bancheck client,bancheck login, auth ticket

The recach of the news is manually and staffpage recach can only ve done one time in the 45 minuts (only when someone enters the page)

So why not a dictonairy?
That is much much better stop using mysql for evrything lol. Yeahh and then crying as mysql is using much memory lol.

Hhh just cache poop :p
I give tomorrow a simple sample
 
Last edited:
Experienced Elementalist
Joined
Mar 21, 2012
Messages
207
Reaction score
81
I don't realy get the point for this feature.
 
Banned
Banned
Joined
Apr 11, 2013
Messages
48
Reaction score
10
Don't like the way you coded this, what's the point of connecting to mysql when the CMS already does that?

if you're using RevCMS, you should use $a = $engine->query("");
etc..
 
Banned
Banned
Joined
Apr 11, 2013
Messages
48
Reaction score
10
First here is my response...
Why are you reconnecting to the database? When using a CMS, it's normally connected itself, so you don't need to connect it.
Re-connecting would have to kill the current database session = which would take longer for a reply.
------
You should always filter your $_POST / $_GET variables, because that's just for extra security, specially if you're releasing it on RaGEZONE or another forum (to public). You could have made this better.
 
Newbie Spellweaver
Joined
Oct 27, 2013
Messages
44
Reaction score
3
First here is my response...
Why are you reconnecting to the database? When using a CMS, it's normally connected itself, so you don't need to connect it.
Re-connecting would have to kill the current database session = which would take longer for a reply.
------
You should always filter your $_POST / $_GET variables, because that's just for extra security, specially if you're releasing it on RaGEZONE or another forum (to public). You could have made this better.

The data is filtered, like this, strip_tags(stripslashes(mysql_real_escape_string($_POST["first"])));
 
Elite Diviner
Joined
Dec 16, 2013
Messages
441
Reaction score
28
Why does it ban my Proxy IP everytime i use this? Gold Tree Emulator ban the IP from Anti-DDoS.... And its not enable in server settings?
 
Junior Spellweaver
Joined
Dec 18, 2013
Messages
133
Reaction score
8
Why does it ban my Proxy IP everytime i use this? Gold Tree Emulator ban the IP from Anti-DDoS.... And its not enable in server settings?

I just tested it on my Phoenix Emulator and ''GTE''

It works for both for me, so you maked a mistake.
 
Status
Not open for further replies.
Back
Top