public function SettingsController_ProxyConnect_Create($Sender)
 {
     $Sender->Permission('Garden.Settings.Manage');
     $Sender->Title('Proxy Connect SSO');
     $Sender->Form = new Gdn_Form();
     $this->Provider = $this->LoadProviderData($Sender);
     // Load internal Integration Manager list
     $this->IntegrationManagers = array();
     $InternalPath = $this->GetResource('internal');
     try {
         // 2.0.18+
         // New PluginManager Code
         $IntegrationManagers = Gdn::PluginManager()->AvailablePluginFolders($InternalPath);
         $IntegrationList = array();
         foreach ($IntegrationManagers as $Integration) {
             $this->IntegrationManagers[$Integration] = Gdn::PluginManager()->GetPluginInfo($Integration);
         }
     } catch (Exception $e) {
         // 2.0.17.x and below
         // Old PluginManager Code
         if ($FolderHandle = opendir($InternalPath)) {
             // Loop through subfolders (ie. the actual plugin folders)
             while ($FolderHandle !== FALSE && ($Item = readdir($FolderHandle)) !== FALSE) {
                 if (in_array($Item, array('.', '..'))) {
                     continue;
                 }
                 $PluginPaths = SafeGlob($InternalPath . DS . $Item . DS . '*plugin.php');
                 $PluginPaths[] = $InternalPath . DS . $Item . DS . 'default.php';
                 foreach ($PluginPaths as $i => $PluginFile) {
                     if (file_exists($PluginFile)) {
                         $PluginInfo = Gdn::PluginManager()->ScanPluginFile($PluginFile);
                         if (!is_null($PluginInfo)) {
                             Gdn_LibraryMap::SafeCache('plugin', $PluginInfo['ClassName'], $PluginInfo['PluginFilePath']);
                             $Index = strtolower($PluginInfo['Index']);
                             $this->IntegrationManagers[$Index] = $PluginInfo;
                         }
                     }
                 }
             }
             closedir($FolderHandle);
         }
     }
     $this->IntegrationManager = C('Plugin.ProxyConnect.IntegrationManager', NULL);
     if (is_null($this->IntegrationManager)) {
         $this->SetIntegrationManager('proxyconnectmanual');
     }
     $this->EnableSlicing($Sender);
     $this->Dispatch($Sender, $Sender->RequestArgs);
 }
   'Description' => 'This plugin enables SingleSignOn (SSO) between your forum and other authorized consumers on the same domain, via cookie sharing.',
   'Version' => '1.9.7',
   'MobileFriendly' => TRUE,
   'RequiredApplications' => array('Vanilla' => '2.0.17.9'),
   'RequiredTheme' => FALSE, 
   'RequiredPlugins' => FALSE,
   'SettingsUrl' => '/dashboard/authentication/proxy',
   'SettingsPermission' => 'Garden.Settings.Manage',
   'HasLocale' => TRUE,
   'RegisterPermissions' => FALSE,
   'Author' => "Tim Gunter",
   'AuthorEmail' => '*****@*****.**',
   'AuthorUrl' => 'http://www.vanillaforums.com'
);

Gdn_LibraryMap::SafeCache('library','class.proxyauthenticator.php',dirname(__FILE__).DS.'class.proxyauthenticator.php');
class ProxyConnectPlugin extends Gdn_Plugin {
   
   public function __construct() {
      parent::__construct();
      
      // 2.0.18+
      // Ensure that when ProxyConnect is turned on, we always have its SearchPath indexed
      try {
         $ProxyConnectSearchPathName = 'ProxyConnect RIMs';
         $CustomSearchPaths = Gdn::PluginManager()->SearchPaths(TRUE);

         if (!in_array($ProxyConnectSearchPathName, $CustomSearchPaths)) {
            $InternalPluginFolder = $this->GetResource('internal');
            Gdn::PluginManager()->AddSearchPath($InternalPluginFolder, 'ProxyConnect RIMs');
         }