3.1.7 - Enable Permission

Top  Previous  Next

 

Overview

 

SpeedCheck Java Applet checks the permission page (parameter: permission_url) everytime the user clicks the "start" button. The server-side script returns a flag (1 or 0) as plain text and tells SpeedCheck to start/stop functioning.

 

Usage example: we can query the raw data from database and tell SpeedCheck to stop working if an unique address has reached the daily transfer limit. In our online demo, we limit each user to have maximum 5 MB of transfer. If a user exceeds that limit, they will get an error message.

 

By default, this feature is turn OFF. It is optional for you to use this functionary.

 

Prerequisites

 

It is necessary to have statistics feature running sucessfully before reading this section.

 

Installation

 

Permission by default is disabled. To enable it, open up  /config/include.php and change the following:

 

$enable_permission = false;

 

change to:

 

$enable_permission = true;

 

Again, you need to have make sure you have the right username/password to access the database. See statistics section for database configuration.

 

 


Technical Details

 

SpeedCheck_permission.php returns 2 lines and SpeedCheck Java Applet reads the 2 lines to determine Applet working status.

 

Line 1: permission flag to run SpeedCheck: 1=allow, 0=not allow

Line 2: Error message to be displayed if not allowed (0) is set

 

If you VIEW SOURCE in Internet Explorer, you will see the HTML returned as the following:

 

sc_permission_response

 

Example

 

If you have enabled permission and you have exceeded the limit (the default limit is set to 5 MB, you can change it in the PHP script), you should see the following message:

 

sc_permission_over_limit