How to make an password protected client?

testbala99

New Member
Nov 4, 2017
10
0
Hi! My hotel is currently in development mode but I don't want to activate maintenance mode, I've seen a hotel that used a password protected client. That was like you'll have to enter an password in the /client.php file to access the SWF or something.

How do I make it like this?
 

Gang67

|Jump out gang, we jump out those vehicles|
May 5, 2017
303
54
If it's in development mode then use php to make it so people below a rank can't access, it will display something like 'In beta'. I just made a thread on this at
 

JynX

Posting Freak
Feb 6, 2016
710
438
While this probably isn't the most efficient way to go about things as it can be leaked/shared quite easily and something more like just a rank check to deny access would probably be much more efficient for something like this. You could also even add a column into the users table called like `beta` and then by default make it 0. When a user attempts to visit the page you can check if their `beta` column is set to 1 and if so allow access if not, deny access or just do a header redirect. Up to you.
PHP:
<?php
$successStatus = false; // Set the success status as false before submission
if (isset($_POST['passwordSubmit'])) { // Check to see if the form has been submitted
    if ($_POST['passwordValue'] == "PUT YOUR PASSWORD HERE") { // Edit password here
       $successStatus = true;    
    }
}

if (!$successStatus) { // Check if the value of $successStatus is false
    echo '<html>
                <head>
                    <style>
                        body {
                            margin:0px;
                            padding:0px;
                            font:12px \'Lucida Grande\',Arial,sans-serif;
                            background-color:#000000;
                        }
                        .box {
                            width:300px;
                            margin:30px auto;
                            background-color:#fff;
                            border:1px solid #dcdada;
                            padding:5px;
                            -webkit-border-radius: 4px;
                            -moz-border-radius: 4px;
                            border-radius: 4px;
                        }
                        .error {
                            background-color:#ffbcbb;
                            border:1px solid #ff7777;
                            padding:8px;
                            margin-bottom:4px;
                        }
                        input {
                            padding:4px;
                        }
                        input[type=password] {
                            border:1px solid #dcdada;
                            width:230px;
                            -webkit-border-radius: 4px;
                            -moz-border-radius: 4px;
                            border-radius: 4px;
                        }
                        input[type=submit] {
                            width:65px;
                        }
                    </style>
                </head>
                <body>
                    <div class="box">
                        <form method="post">
                            <input type="password" name="passwordValue" placeholder="Enter password here..">
                            <input type="submit" name="passwordSubmit">
                        </form>
                    </div>
                </body>
            </html>
    ';
}
?>
To use this simply edit the bit that says "Edit password here" to a password of your choice and then paste the entire code into the top of your client.php file located in app/tpl/skins/SKIN HERE/

Credits to the people that created Hablore's pin system as I took most parts of it and just edited it to fit this scenario and give an alternate option to Gang67's.
 
Last edited:

Users who are viewing this thread

Top