*This release of UnBlockIP is sponsored by: 
    SSLCertCheck.com - Monitor and verify your site's SSL certificate and be alerted before your cert expires.

*This module is sponsored by ServerPing.net Offer your clients a full feature monitoring service completely integrated into your existing WHMCS installation.


By using this software you agree to the BSD Modified license.

Copyright (c) 2012-2013, Hosting Playground Inc 
All rights reserved.

This module code was forked from the UnblockMe CSF WHMCS Module 2.0 by Franksworld Solutions, LLC
Copyright (c) 2012, Franksworld Solutions, LLC
All rights reserved.


** INSTALLATION **


-CSF v6.21 or later is required to be on your servers in order for this plugin to work.
-Copy the entire unblockip folder to your WHMCS instances modules/addons folder.
-Ensure the files and folder have the proper ownership/permissions for your web server.
-Active the module by logging into the WHMCS Admin area. Click Setup->Addon Modules, then click Active next to the UnBlockIP Addon.
-Next, click configure and change any options and grant access to the admin interface accordingly. 
-If you using the 5.0.3 default theme instead of the 5.1 theme, remove unblockip.tpl and rename unblockip503.tpl to unblockip.tpl
-Edit the unblockip.tpl file and make any changes needed to match your sites look and feel. The included template makes use of the default theme.
-You will now be able to access the unblockip module from the client area by going to index.php?m=unblockip'
-You can also access a search function from the WHMCS admin area under Addons->UnBlockIP which will search for an IP accross all active cPanel and DirectAdmin servers.


To make it easy for your customers to access this module, we recommend adding the following to one of your menus in your templates header.tpl. 
This menu item will only be shown if the client has an active account assoicated with a cPanel server.

{if $unblockip_isactive}
<li><a href="index.php?m=unblockip">Unblock IP</a></li>
{/if}

5.1 Default Template Example adding Unblock IP Address to the support menu.
		  <ul class="nav">
			<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">{$LANG.navsupport}&nbsp;<b class="caret"></b></a>
			  <ul class="dropdown-menu">
				<li><a href="supporttickets.php">{$LANG.navtickets}</a></li>
				<li><a href="knowledgebase.php">{$LANG.knowledgebasetitle}</a></li>
				<li><a href="downloads.php">{$LANG.downloadstitle}</a></li>
				<li><a href="serverstatus.php">{$LANG.networkstatustitle}</a></li>
				{if $unblockip_isactive}<li><a href="index.php?m=unblockip">Unblock IP Address</a></li>{/if}
			  </ul>
			</li>
		  </ul>
		  
5.0.3 Default Template Example adding Unblock IP Address to the support menu.
          <ul>
			<li class="menu">
			  <a href="#" class="menu">{$LANG.navsupport}</a>
			  <ul class="menu-dropdown">
				<li><a href="supporttickets.php">{$LANG.navtickets}</a></li>
				<li><a href="knowledgebase.php">{$LANG.knowledgebasetitle}</a></li>
				<li><a href="downloads.php">{$LANG.downloadstitle}</a></li>
				<li><a href="serverstatus.php">{$LANG.networkstatustitle}</a></li>
				{if $unblockip_isactive}<li><a href="index.php?m=unblockip">Unblock IP Address</a></li>{/if}
			  </ul>
			</li>
		  </ul>


If you enable the Automatically check for an IP Block upon client login feature, edit your clientareahome.tpl and add the following to the top 
of this template.

{if $unblockip}
{if $unblockip_alerts}
<div class="alert alert-error textcenter">
    <p><strong>Your IP Address was blocked on your server, if you were having issues accessing your server, please try again now<br>
       The block has been removed.</strong></p>
    <p>
    Detailed Block Information: <br>
    {$unblockip_alerts}</p>
</div>
{/if}
{if $unblockip_errors}
<div class="alert alert-error textcenter">
    <p><strong>Your IP Address is blocked on your server and we are unable to remove the block automatically.<br>Please open a support ticket.</strong></p>
</div>
{/if}
{/if}

If you enable the Automatically check for an IP Block upon client login feature without auto unblocking, edit your clientareahome.tpl and add the following to the top 
of this template.

{if $unblockip_alerts}
<div class="alert alert-error textcenter">
    <p><strong>
    {$unblockip_alerts}</p>
    <p><form name='ipaddresscheck' method='POST' action='index.php?m=unblockip'>
    <input type="text" size="25" name="ip_address" style="text-align: center;" value="{$smarty.server.REMOTE_ADDR}">
    <input type="hidden" name="action" value="remove_ip_block" /><br/>
    <input class="btn btn-primary" type="submit" name="unblock" value="{$LANG.request_removal_of_block}" />
    </form>    
</div>
{/if}
{if $unblockip_errors}
<div class="alert alert-error textcenter">
    <p><strong>{$LANG.ip_address_is_blocked}<br>{$LANG.please_open_a_support_ticket}</strong></p>
</div>
{/if}

You will also need to add the following to your main WHMCS language files:
$_LANG['request_removal_of_block'] = "Request Removal of Block";
$_LANG['ip_address_is_blocked'] = "Your IP Address is blocked on your server and we are unable to remove the block automatically.";
$_LANG['please_open_a_support_ticket'] = "Please open a support ticket.";