Thread: Terms of Service (cannot be by-passed)

Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
  1. #21  
    Banned

    Join Date
    May 2007
    Posts
    2,177
    Thanks given
    558
    Thanks received
    261
    Rep Power
    0
    Quote Originally Posted by Onehiths View Post
    I've created a basic terms of service system for rs-private servers. This script forces people to agree to terms of service on any website you "require" (will be explained later) the check file.

    ---

    Features:
    Design changing in configuration including border colors, text color, backgrounds, etc

    TOS Updater - Change $UpdateVersion to force users to re-agree to the terms if you
    change them

    User-Friendly frontend and backend

    ---

    Preview with default settings:
    Spoiler for Preview:



    To use this, do the following:


    1)
    Create a file called tos.php in your web directory and put this code in it:
    Code:
    <?php
    //!!!!!!!   Make sure to modify tosconfig.php    !!!!!!!!
    $from=1;
    require("tosconfig.php");
    if($I_HAVE_MODIFIED_TOS_CONFIG == false) {
    	die("You MUST modify the tosconfig.php file first. Change \"\$I_HAVE_MODIFIED_TOS_CONFIG = false\" to \"\$I_HAVE_MODIFIED_TOS_CONFIG = true\"");
    }
    if(isset($_COOKIE['tos'])) 
    	$tos = $_COOKIE['tos'];
    if(isset($_POST['dg'])) {
    	header("Location: {$redirectDeclined}");
    	die;
    }
    if(isset($_POST['ag'])) {
    	setcookie("tos", $UpdateVersion);
    	$tos = $UpdateVersion;
    }
    if(isset($_GET['resetTOSCookie']) || $tos != $UpdateVersion) {
    	setCookie("tos", null, time() - 3600);
    	$tos = null;
    }
    if($tos == null || $tos != $UpdateVersion) {
    echo "<center>";
    echo "<title>{$page['title']}</title>";
    echo "<body style='background-color:{$style['background']};'>";
    echo "<div style=\"text-align:center;background-color:{$style['background-tos']};border-color:{$style['border']};border-width:{$style['border_style']};border-style:solid;color:{$style['color']};width:50%;height:100%;\">";
    echo "<h1>{$page['title']}</h1>";
    ?>
    <center>
    <h2>Terms of Service</h2>
    <div style="margin-left:20px;margin-right:20px;">
    By continuing you agree to all of the following statements:<br />
    <br />
    <li style="margin-left:20px;text-align:left;">You are not an employee, lawyer or contractor of Jagex Ltd, RuneScape, FunOrb, MechScape, Stellar Dawn, War of Legends or Adlex Solicitors, and are not a family member or acquaintance of the aforementioned.<br /><br /></li>
    <li style="margin-left:20px;text-align:left;">All of the information on this site is solely for learning purposes, as the main purpose of this site is to instruct people in the art of programming.<br /><br /></li>
    <li style="margin-left:20px;text-align:left;">All programs provided for download from this site are entirely programmed by the members of this community and are not the intellectual property of any business or organization.<br /><br /></li>
    <li style="margin-left:20px;text-align:left;">No profit is made from this website: all proceeds go directly into server costs.<br /><br /></li>
    <li style="margin-left:20px;text-align:left;">The authors of this website are in no way responsible legally for its contents, or the content that users post on it.<br /><br /></li>
    <li style="margin-left:20px;text-align:left;">Nothing is sold (i.e. ownership transferred) on this website. Only the service of updating our database is provided.<br /><br /></li>
    <li style="margin-left:20px;text-align:left;">All of the above terms involve anything under this domain of <?php echo $mysite; ?>.<br /><br /></li>
    <br />
    In no event shall the authors of this website nor the company hosting it be liable for any claim, damages, or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.<br />
    <br />
    If you understand and accept the terms of service, please click 'I Agree' below. If you do not understand, or do not accept, click 'I Disagree' and you will be redirected away from this site. Please note, this is a binding contract under law. If you breach this contract, it will be legally disputed.<br />
    <br /><br />
    <form action="" method="post" name="agree">
    <input type="submit" name="dg" value=" I Disagree " /> 
    <input type="submit" name="ag" value=" I Agree " />
    </form>
    <br /><br />
    If you do not agree to the statements above and click 'I Agree', this means you are accessing the website without authorization. This is an offence under the Computer Misuse Act 1990 and is punishable by law in the USA with a fine and up to 6 months in prison. This also applies in all other countries where similar laws exist.
    <br />
    </div>
    </div>
    </center>
    <?php
    } else {
    	echo "<br />";
    	if($advanced == 1) {
    		echo "Term Version: {$UpdateVersion} - Your Version: {$tos}<br />
    		Cookie Reading: {$_COOKIE['tos']}<br />";
    		die;
    	}
    	//Uses JavaScript as redirect
    	echo "Redirecting.. You must have Javascript enabled.";
    	die("<script>window.location='{$redirectSuccess}'</script>");
    }
    
    ?>
    <!-- Created by Cameron (OneHitHS Rune-server) !-->

    2) Create another file in the SAME DIRECTORY called tosconfig.php and put this code in it
    Code:
    <?php
    if($from != 1) {
      die("You cannot access this page directly.");
    }
    $I_HAVE_MODIFIED_TOS_CONFIG = false;
    // Redirects
    $redirectSuccess = "http://myserverwebsite.com/webclient"; //Redirect to this location if the agreement is accepted or if it has already been accepted.
    $redirectDeclined = "http://google.com/"; //If they do not agree to the terms, redirect them here instead.
    $tos_php_file = "http://mywebsite.com/tos.php";
    //General
    
    $UpdateVersion = 1; //If you want players to re-agree to the terms (for instance: If you modify them), add to int (ie: 1 to 2)
    
    $advanced = 0; //For testing purposes only. This shows advanced settings when the agreement is accepted or if the cookie is detected.
    
    $mysite = "yourserverwebsite.com"; //NO WWW. NO HTTP://
    
    //CSS Settings
    
    $style['background-tos'] = "#1B1B1B";
    
    $style['background'] = "black";
    
    $style['border'] = "white";
    
    $style['border_style'] = "thin";
    
    $style['color'] = "white";
    
    //Page Settings
    
    $page['server'] = "My Server"; // Your Server Name
    
    $page['title'] = "{$page['server']} - Terms of Service";
    
    ?>
    Modify those settings to your liking. Change the
    $I_HAVE_MODIFIED_TOS_CONFIG = false;
    to
    $I_HAVE_MODIFIED_TOS_CONFIG = true;
    to make the script usable.

    3) Create the last file called "check.php" in the SAME DIRECTORY and put this code in it
    Code:
    <?php
    $from=1;
    include("tosconfig.php");
    if(!isset($_COOKIE['tos'])) {
     header("Location: {$tos_php_file}");
     die;
    }
    if($_COOKIE['tos'] != $UpdateVersion) {
     header("Location: {$tos_php_file}");
     die;
    }
    ?>

    And that's it. Your terms of service file can be accessed from [Only registered and activated users can see links. ]

    To require users to agree to the terms of service on one of your pages, open the PHP page (example: in smf it would be index.php) and put this near the top:
    Code:
    require("http://yourwebsite.com/path/to/check.php");
    Should be easy to get from there. Questions, respond.

    PS: Yes the script is basic, but it works and the code is easy to read/modify to your liking.
    just incase you decide to remove lol
    Reply With Quote  
     

  2. #22  
    Registered Member
    Join Date
    Oct 2013
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I know this is realllllly old, and I'm sorry for the bump. But the cookies aren't saving anymore. When I reopen a browser and go to my site, I have to agree to the TOS again. Is it possible to store a persistent cookie instead of a session based one?
    Reply With Quote  
     

  3. #23  
    Registered Member
    Join Date
    May 2013
    Posts
    277
    Thanks given
    31
    Thanks received
    28
    Rep Power
    11
    TOS on an illegal game, no.
    Reply With Quote  
     

  4. #24  
    Registered Member

    Join Date
    Nov 2013
    Posts
    752
    Thanks given
    185
    Thanks received
    456
    Rep Power
    5000
    interessant might use






    Reply With Quote  
     

Page 3 of 3 FirstFirst 123

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Terms of Service
    By Hazard_ in forum Website Development
    Replies: 6
    Last Post: 11-28-2011, 04:13 AM
  2. Terms of Service
    By eBiiLaXe in forum Application Development
    Replies: 2
    Last Post: 11-12-2011, 06:17 AM
  3. Terms of service
    By ruff in forum Help
    Replies: 4
    Last Post: 08-27-2011, 11:36 PM
  4. Terms of service help
    By Fat_tony in forum Application Development
    Replies: 1
    Last Post: 06-16-2009, 12:34 AM
  5. Terms of Service
    By Mrthunder23 in forum Application Development
    Replies: 10
    Last Post: 08-10-2008, 05:49 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •