Login   Register  
PHP Classes
elePHPant
Icontem

File: server/example.register.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Oliver Lillie  >  PADL (PHP Application Distribution License System)  >  server/example.register.php  >  Download  
File: server/example.register.php
Role: Example script
Content type: text/plain
Description: Demo file
Class: PADL (PHP Application Distribution License System)
Generate PHP application license keys
Author: By
Last change: name change
Date: 2005-06-21 05:56
Size: 3,587 bytes
 

Contents

Class file image Download
<?php

    
/**
    * Project:        Distrubution License Class
    * File:            example.register.php
    *
    * Copyright (C) 2005 Oliver Lillie
    * 
    * This program is free software; you can redistribute it and/or modify it 
    * under the terms of the GNU General Public License as published by  the Free 
    * Software Foundation; either version 2 of the License, or (at your option) 
    * any later version.
    *
    * This program is distributed in the hope that it will be useful, but 
    * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
    * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
    * for more details.
    *
    * You should have received a copy of the GNU General Public License along 
    * with this program; if not, write to the Free Software Foundation, Inc., 
    * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    
    *
    * @link http://www.buggedcom.co.uk/
    * @author Oliver Lillie, buggedcom <publicmail at buggedcom dot co dot uk>
    * @version 0.2
    * @history---------------------------------------------
    * see CHANGELOG
    */
    
    
if(empty($_POST))
    {
        echo 
'<link rel="stylesheet" type="text/css" href="../shared/styles.css">';
        echo 
'<body>'."\r\n";
        echo 
'<span class="header">'."\r\n";
        echo 
'<b>########################################################################</b><br />'."\r\n";
        echo 
'<b>Register Application Demonstration File</b><br />'."\r\n";
        echo 
'This file is called by the application you are binding on install. It validates the install<br />'."\r\n";
        echo 
'request and then the result is returned to the client machine.<br />'."\r\n";
        echo 
'This file is only used from a remote socket opening.<br />'."\r\n";
        echo 
'<span style="font-size: 10;">'."\r\n";
        echo 
'<b>Oliver Lillie, buggedcom [publicmail at buggedcom dot co dot uk]<br />'."\r\n";
        echo 
'<a href="http://www.buggedcom.co.uk/" target="_blank" style="color: #F00">http://www.buggedcom.co.uk/</a></b><br />'."\r\n";
        echo 
'</span>'."\r\n";
        echo 
'<b>########################################################################</b><br /><br />'."\r\n";
        echo 
'</span>'."\r\n";
        echo 
'<body>'."\r\n";
    }
    else
    {
        
# import db cofigs
        
include_once('db.config.php');
    
        
# import the classes
        
include_once('../shared/class.license.lib.php');
        include_once(
'class.license.server.php');
    
        
# initialise the class using neither server or time checking and set the use
        # of mcrypt according to the recieved data
        
$server = new license_server($_POST['MCRYPT'], truetruetrue);
        
        
# set the approval type
        # this determines if the key is automatically returned or if admin is required to
        # approve it. NOTE that is a key code is used, this overrides admin approval
        # the key code is a code generated by the server when a license is purchased
        # and links to a specific entry in the database.
        # this example requires admin approval to generate the full license, but generates
        # a temp license valid for 48 hours and binds the MAX_UPLOADS to 5 meaning that
        # the MAX_UPLOADS var could be used by the program to restrict the number of items
        # You should also note that this MAX_UPLOADS overrides the MAX_UPLOADS set in the 
        # request demo file.
        # untill a full license key is approved
        
$server->set_approval_type('ADMIN', array('TYPE'=>'Temporary Key''MAX_UPLOADS'=>5), 60*60*24*2);
        
        
# recieve the call from client server
        # return the data by echoing back the returned info
        
die($server->receive_install($_POST['POSTDATA'], $table$user$pass));
    }

?>