Untracking paid plugin
Untracking paid plugin

--- a/plugins/Blargle/AutoAuth/AutoAuth.php
+++ /dev/null
@@ -1,589 +1,1 @@
-<?php
-/** AutoAuth plugin - Provides a button allowing a user to log directly into supported systems
-*
-* Copyright (C) 2012 B Tasker
-* Released under GNU GPL V2
-* See LICENSE
-*
-*/
-defined('_CREDLOCK') or die;
 
-
-
-
-
-/** Central class to minimise duplication of code between the different plugin types
-*
-*/
-class plugin_AutoAuth{
-
-function getDetails(){
-$details->Name = "plg_AutoAuth";
-$details->Description = "Allows certain credtypes to display a 'Login' button";
-$details->Author = 'B Tasker';
-$details->License = 'GNU GPL V2';
-return $details;
-}
-
-
-
-
-/** Get stored settings
-*
-* @arg credtype - int
-* @arg db - db object by reference
-* @arg crypt- Crypto object by reference
-*
-* @return object
-*
-*/
-function getStoredSettings($credtype,&$db,&$crypt){
-
-$sql = "SELECT `Settings` FROM #__AutoAuth WHERE `CredType`='" . $db->stringEscape($credtype) ."'";
-$db->setQuery($sql);
-
-$settings = $db->loadResult();
-if (!$settings){return false;}
-
-return json_decode($crypt->decrypt($settings->Settings,'Cre'.$credtype));
-}
-
-}
-
-
-
-
-/**                            CREDENTIALS PLUGIN STARTS                            **/
-
-
-
-/** Credentials Plugin class
-*
-*/
-class plugin_AutoAuth_Creds{
-/** Load the plugin configuration
-*
-*/
-function config(){
-require 'conf/plugins/AutoAuth/config.php';
-}
-
-
-
-/** Return the plugin details
-*
-*/
-function getPlgDetails(){
-
-return plugin_AutoAuth::getDetails();
-
-}
-
-
-/** Get current status
-*
-*/
-function getPlgStatus(){
-$this->config();
-return $this->active;
-
-}
-
-/** Class Entry Point
-*
-* @arg data - object, will contain
-*  user - string - username of user performing the logged action
-*  cred - string - Identified for the credential, User, Group or Credential type being edited. May be null (login, logout)
-*  timestamp - PHP date format timestamp for the action. Exact format controlled by main config, use strtotime to convert if needed
-*  action - INT - Action identifier (see loggingdb documentation)
-*
-*  If you need extra data, run a query. Don't decrypt encrypted data unless you know you can do so without creating a security risk!
-*
-* return values are ignored
-*/
-function PlgCall($data){
-// Load the plugin config
-$this->config();
-
-// Check the plugin is actually enabled
-if (!$this->active){ return; }
-
-
-
-
-
-switch($data->action){
-
-    case 'display':
-    return $this->display_cred($data);
-    break;
-
-
-    
-}
-
-
-
-}
-
-
-
-
-/** Output the log-in button for the configured system
-*
-*/
-function display_cred($data){
-
-
-
-$db = new BTDB;
-$crypt = new Crypto;
-
-$settings = plugin_AutoAuth::getStoredSettings($data->cred->CredType,$db,$crypt);
-
-if (!$settings){ return; }
-
-
-
-    if (($settings->Enabled == 1) && !empty($settings->user) && !empty($settings->pass)){
-
-    $address = $crypt->decrypt($data->cred->Address,'Cre'.$data->cred->CredType);
-    $user = $crypt->decrypt($data->cred->UName,'Cre'.$data->cred->CredType);
-    $pass = $crypt->decrypt($data->cred->Hash,'Cre'.$data->cred->CredType);
-
-
-
-
-
-    if (!empty($address) && !empty($user) && !empty($pass)){
-
-
-    $onsubmit = '';
-
-	if ($this->warnredirect){
-	$onsubmit = "onsubmit=\"return confirm('This will take you to another site, are you sure you wish to continue?');\"";
-	}
-
-    $add = $address; 
-
-    if (!empty($settings->frmAutoAuthURL)){ $add = rtrim($add,"/") . $settings->frmAutoAuthURL;}
-    ob_start();
-	// We load the page using img src so that the browser has any cookies that it might need
-
-	      if ($settings->cookie == 1):?>
-		  <img src="<?php echo $address;?>" style="width: 1px; height: 1px; border: 0px">
-	     <?php endif; ?>
-
-
-
-	    <form style="margin: 0px;" target=_blank action="<?php echo $add ?>" method="POST" <?php echo $onsubmit;?>>
-	    <input type="hidden" name="<?php echo $settings->user; ?>" value="<?php echo $user; ?>"><input type="hidden" name="<?php echo $settings->pass; ?>" value="<?php echo $pass; ?>">
-	    <input type="submit" class="btn btn-primary" value="Log-In">
-
-	    <?php if (!empty($settings->additional)){
-
-
-	    $adds = explode(",",$settings->additional);
-
-		foreach ($adds as $fld){
-		    $dets = explode("=",$fld);
-
-		echo "<input type='hidden' name='{$dets[0]}' value='{$dets[1]}'>";
-
-
-		}
-
-
-
-
-	    }
-	  ?>
-	    </form>
-<?php
-
-    unset($address);
-    unset($user);
-    unset($pass);
-
-    return str_replace("\n","",str_replace("\t","",ob_get_clean()));
-
-    }
-
-
-
-    }
-
-
-
-
-}
-
-
-
-
-}
-
-
-
-
-/**                                       CREDTYPES PLUGIN STARTS                               **/
-
-
-/** Class for CredTypes
-*
-*/
-class plugin_AutoAuth_CredTypes{
-
-/** Load the plugin configuration
-*
-*/
-function config(){
-require 'conf/plugins/AutoAuth/config.php';
-}
-
-
-/** Return details for the Plugin information view
-*
-* Will be displayed in a table, with the key as the head and the value as the content
-* HTML is _NOT_ allowed
-*
-*
-* @return object
-*/
-function getPlgDetails(){
-
-return plugin_AutoAuth::getDetails();
-
-}
-
-
-
-/** Return Plugin status (i.e. is it enabled)
-*
-* 
-*
-* @return boolean
-*/
-function getPlgStatus(){
-$this->config();
-
-return $this->active;
-
-}
-
-
-
-/** Class Entry Point
-*
-*
-* return values are echoed
-*/
-function PlgCall($data){
-// Load the plugin config
-$this->config();
-
-// Check the plugin is actually enabled
-if (!$this->active){ return; }
-
-
-switch($data->action){
-
-    case 'add':
-    return $this->display_addsettings();
-    break;
-
-
-    case 'added':
-    return $this->store_addsettings($data->newid);
-    break;
-
-    case 'edit':
-    return $this->displayexisting($data);
-    break;
-
-
-    case 'edited':
-    return $this->store_edit($data->id);
-    break;
-
-    case 'del':
-    return $this->delCredType($data->id);
-    break;
-
-  }
-
-
-
-}
-
-
-/** Delete settings for the specified credtype
-*
-*/
-function delCredType($id){
-$db = new BTDB;
-$sql = "DELETE FROM #__AutoAuth WHERE `CredType`='".$db->stringEscape($id)."'";
-$db->setQuery($sql);
-
-return $db->runQuery();
-}
-
-
-
-/** Updated db table with submitted data
-*
-* @arg id - INT 
-*/
-function store_edit($id){
-
-
-      if (BTMain::getVar('frmAutoAuthEnable')){
-      $conf->Enabled = 1;
-
-      }else{
-      $conf->Enabled = 0;
-      }
-
-
-      foreach (BTMain::getVar('settings') as $key=>$value){
-      $conf->$key = $value;
-
-      }
-      
-$settings = json_encode($conf);
-
-$db = new BTDB;
-$crypt = new Crypto;
-
-
-      $settings = $crypt->encrypt($settings,'Cre'.$id);
-      $settings = $db->stringEscape($settings);
-   
-      $type = $db->stringEscape($id);
-      $sql = "INSERT INTO #__AutoAuth (`CredType`,`Settings`) VALUES('$type','$settings') ON DUPLICATE KEY UPDATE `Settings`='$settings'";
-   
-      $db->setQuery($sql);
-      $db->runQuery();
-      
-return;
-}
-
-
-
-
-/** Add a new record containing the details that have been submitted
-*
-*/
-function store_addsettings($id){
-
-    if (BTMain::getVar('frmAutoAuthEnable')){
-      // More settings to be added later
-
-      $conf->Enabled = 1;
-      foreach (BTMain::getVar('settings') as $key=>$value){
-      $conf->$key = $value;
-
-      }
-      if (!isset($conf->cookie)){ $conf->cookie = 0; }
-      
-      $settings = json_encode($conf);
-
-
-
-
-      $db = new BTDB;
-      $crypt = new Crypto;
-
-      // Make sure the settings table exists - Will make this more graceful later
-      $sql = "CREATE TABLE IF NOT EXISTS `#__AutoAuth` (  `CredType` int(11) DEFAULT NULL,  `Settings` blob, PRIMARY KEY (`CredType`));";
-      $db->setQuery($sql);
-      $db->runQuery();
-
-
-      // We encrypt using the newly created key as that'll be available when decrypting passwords
-      $settings = $crypt->encrypt($settings,'Cre'.$id);
-      $settings = $db->stringEscape($settings);
-
-
-      $sql = "INSERT INTO #__AutoAuth VALUES('$id','$settings')";
-      $db->setQuery($sql);
-      $db->runQuery();
-
-  }
-return;
-}
-
-
-
-/** Called when editing an existing credtype
-*
-*/
-function displayexisting($data){
-
-$db = new BTDB;
-$crypt = new Crypto;
-
-$settings = plugin_AutoAuth::getStoredSettings($data->id,$db,$crypt);
-
-if (!$settings){ $settings = false; }
-
-return $this->display_addsettings($settings);
-
-}
-
-
-
-
-
-/** Display form elements for editing/setting plugin values
-*
-* @arg existsvals - used when editing, otherwise null
-*
-*/
-function display_addsettings($settings = null){
-
-$user = 'user';
-$pass = 'pass';
-$url = '';
-$checked = '';
-$additional = '';
-$reqcookie = '';
-
-
-    if (is_object($settings)){
-	$user = $settings->user;
-	$pass = $settings->pass;
-	$url = $settings->frmAutoAuthURL;
-	$additional = $settings->additional;
-	
-	if ($settings->cookie == 1){ $reqcookie = ' checked';}
-
-	  if ($settings->Enabled == 1){
-	  $checked = ' checked';
-	  }
-
-     }
-
-
-ob_start();
-?>
-<div id="AAuth">
-
-
-<label for="frmAutoAuthEnable">Enable Auto Login button</label><input type="checkbox" value="1" id="frmAutoAuthEnable" name="frmAutoAuthEnable" onchange="AAuthboxChange(this.checked);" <?php echo $checked;?>>
-
-<div id="AAuthSettings" style="display: none;">
-
-<label for="frmAutoAuthPreConf">Use Preconfigured Settings</label><select onchange="AAuthPrePopSettings(this.value)" id="frmAutoAuthPreConf" name="preConfSettings">
-<option value="0">Use Settings Below</option>
-<option value="1">CPanel/WHM</option>
-<option value="2">WebMin</option>
-<option value="3">WordPress</option>
-<option value="4">Drupal</option>
-</select>
-
-
-<label for="frmAutoAuthURL">Additional address path</label><input type="text" title="Additional URL params to add, for example for CPanel you need /login/" id="frmAutoAuthURL"  value="<?php echo $url; ?>"name="settings[frmAutoAuthURL]">
-
-<label for="frmAutoAuthUser">User Field</label><input type="text" title="The field name to submit usernames as" id="frmAutoAuthUser" name="settings[user]" value="<?php echo $user; ?>">
-
-<label for="frmAutoAuthPass">Password Field</label><input type="text" title="The field name to submit usernames as" id="frmAutoAuthPass" name="settings[pass]" value="<?php echo $pass;?>">
-
-
-<label for="frmAutoAuthCookie">Requires a Cookie</label><input type="checkbox" name="settings[cookie]" id="frmAutoAuthCookie" title="Check this if the site type requires a cookie to be set to process logins" value="1" <?php echo $reqcookie; ?>>
-
-
-<label for="frmAutoAuthAdditional">Additional Fields</label><textarea id="frmAutoAuthAdditional" title="Additional field names and values, comma seperated in the format key=value" name="settings[additional]"><?php echo $additional;?></textarea>
-
-</div>
-
-</div>
-
-<script type="text/javascript">
-
-
-function AAuthPrePopSettings(v){
-if (v==0){return;}
-
-var addpath = document.getElementById('frmAutoAuthURL'),
-user = document.getElementById('frmAutoAuthUser'),
-pass = document.getElementById('frmAutoAuthPass'),
-addfld = document.getElementById('frmAutoAuthAdditional'),
-cookie = document.getElementById('frmAutoAuthCookie');
-
-
-
-  switch(v){
-
-  case '1':
-  // Populate the CPanel/WHM settings
-  addpath.value = '/login/';
-  user.value = 'user';
-  pass.value = 'pass';
-  addfld.value = '';
-  cookie.checked = false;
-  break;
-
-  case '2':
-  // Populate the Webmin settings
-  addpath.value = '/session_login.cgi';
-  user.value = 'user';
-  pass.value = 'pass';
-  addfld.value = 'page=/,';
-  cookie.checked = true;
-  break;
-
-
-  case '3':
-  // WordPress Values 
-  //requires a cookie
-  addpath.value = '/wp-login.php';
-  user.value = 'log';
-  pass.value = 'pwd';
-  addfld.value = '';
-  cookie.checked = true;
-  break;
-
-
-  case '4':
-  // Populate the Drupal values
-  addpath.value = '/?q=user';
-  user.value = 'name';
-  pass.value = 'pass';
-  addfld.value = 'form_id=user_login';
-  cookie.checked = false;
-  break;
-
-
-
-  }
-
-
-
-}
-
-function AAuthboxChange(checked){
-if (checked){
-
-document.getElementById('AAuthSettings').style.display = 'block';
-}else{
-document.getElementById('AAuthSettings').style.display = 'none';
-}
-
-}
-
-
-
-
-$('#AAuth *').tooltip({track: true, fade: 250});
-AAuthboxChange(document.getElementById('frmAutoAuthEnable').checked);
-</script>
-
-<?php
-return ob_get_clean();
-}
-
-
-
-}
-?>

--- a/plugins/Blargle/AutoAuth/README.html
+++ /dev/null
@@ -1,98 +1,1 @@
-<h2>Contents</h2>
 
-<ul>
-  <li><a href="#about">About AutoAuth</a></li>
-  <li><a href="#plgConfig">Plugin Configuration</a>
-  <li><a href="#CredType">CredType Configuration</a></li>
-      <ul><li><a href="#examples">Example Values</li></ul>
-  </li>
-  <li><a href="#unsupported">Known incompatible systems</a></li>
-
-</ul>
-
-
-<h3><a name="about">About AutoAuth</a></h3>
-AutoAuth Plugin is a plugin allowing system admins to configure PHPCredLocker to
-display a 'Log In' button for specific credtypes. When enabled, the plugin
-simply generates a form containing the credentials so that users can log into
-linked systems with one click.
-<br />
-<br />
-
-Thanks to <a href="http://www.joomlasuffolk.co.uk/" target=_blank>Joomla User
-Group Suffolk (JUGS)</a> for the feature suggestion!
-<br />
-
-
-
-<h3><a name="plgConfig">Plugin Configuration</a></h3>
-
-The configuration file contains two options<br />
-
-<ul>
-  <li><b><i>active</i></b> - Is the plugin enabled?</li>
-  <li><b><i>warnredirect</i></b> - Should a Javascript confirm box be displayed before redirecting the user</li>
-</ul>
-
-
-
-<h3><a name="CredType">CredType Configuration</a></h3>
-
-When enabled, the plugin will display additional fields when adding or editing a Credential Type. 
-The settings specified in these will define how credentials are passed to the login script of the linked system, 
-getting them wrong will result in a failed login.<br />
-
-<ul>
-<li><b><i>Enable Auto Login button:</b></i> Should the plugin be enabled for this CredType?</li>
-<li><b><i>Additional address path: </b></i> Specifies any additional URL params that need to be specified to enable login</li>
-<li><b><i>User Field:</b></i> The field name used by the login form of the linked system</li>
-<li><b><i>Password Field:</b></i> The field name use by the login form of the linked system</li>
-<li><b><i>Requires Cookies:</b></i> Some systems require a specific cookie to exist. If this is checked, the target page will be loaded as part of the form (the user won't see it) to ensure all relevant cookies are set. </li>
-<li><b><i>Additional Fields:</b></i> Some systems require additional hidden fields to be submitted. This field allows you to specify names and values in CSV format using key=value (i.e. <i>page=home,action=login</i>)
-</ul>
-<br />
-<h4><a name="examples">Example configurations</a></h4>
-
-<br /><i>Note: These examples assume you've stored the address of the server without a trailing slash (i.e. mysite:2082 rather than mysite:2082/)</i><br />
-
-
-<table class="table table-hover">
-<tr><th></th><th>CPanel</th><th>Webmin</th><th>WordPress</th></tr>
-
-<tr class='confVal'><th>Additional Address Path</th><td>/login</td><td>/session_login.cgi</td><td>/wp-login.php</td></tr>
-
-<tr class='confVal'><th>User Field</th><td>user</td><td>user</td><td>log</td></tr>
-
-<tr class='confVal'><th>Password Field</th><td>pass</td><td>pass</td><td>pwd</td></tr>
-
-<tr class='confVal'><th>Requires Cookie</th><td>No</td><td>Yes</td><td>Yes</td></tr>
-
-<tr class='confVal'><th>Additional Fields</th><td>none</td><td>page=/,</td><td></td></tr>
-</table>
-
-
-
-<h3><a name="unsupported">Known Incompatible</a></h3>
-
-Systems known not to be compatible with AutoAuth's one-click login are
-
-<ul>
-<li>Joomla! - Requires a unique form token to be submitted</li>
-<li>PHPCredLocker - Requires a unique form token to be submitted</li>
-</ul>
-
-Any system which requires a unique form token to be submitted (such as Joomla!) cannot be supported as the token changes with each session/request.
-Systems which simply require a specific cookie to be set (such as Webmin) are supported however, as are those which allow login details 
-to be submitted without further information (such as CPanel/WHM).
-
-
-
-<h3>Login button not displaying</h3>
-
-There are essentially three reasons why the login button may not display after a user has clicked 'Display Password'.<br>
-
-<ol>
-  <li>Plugin not enabled - Check plugins.conf and conf/plugins/AutoAuth/config.php</li>
-  <li>Required field not included - Credential must have URL, User and Password stored for the plugin to trigger</li>
-  <li>Internal plugin fault - Sorry! These have been well tested for, but it's possible something's been missed</li>
-</ol>

--- a/plugins/Blargle/AutoAuth/index.html
+++ /dev/null
@@ -1,8 +1,1 @@
-<html>
-  <head>
-    <title></title>
-    <meta content="">
-    <style></style>
-  </head>
-  <body></body>
-</html>
+