Browse Source

Show disabled Backend Auth Plugins and what is missing

Cerothen 9 years ago
parent
commit
d2f81e3434
3 changed files with 28 additions and 1 deletions
  1. 2 0
      config/.htaccess
  2. 20 0
      functions.php
  3. 6 1
      settings.php

+ 2 - 0
config/.htaccess

@@ -0,0 +1,2 @@
+order deny,allow
+deny from all

+ 20 - 0
functions.php

@@ -21,6 +21,11 @@ if (function_exists('ldap_connect')) :
 		}
 		return false;
 	}
+else :
+	// Ldap Auth Missing Dependancy
+	function plugin_auth_ldap_disabled() {
+		return 'Plex - Disabled (Dependancy: php-ldap missing!)';
+	}
 endif;
 
 // Pass credentials to FTP backend
@@ -189,6 +194,21 @@ if (function_exists('curl_version')) :
 		}
 		return false;
 	}
+else :
+	// Plex Auth Missing Dependancy
+	function plugin_auth_plex_disabled() {
+		return 'Plex - Disabled (Dependancy: php-curl missing!)';
+	}
+	
+	// Emby Connect Auth Missing Dependancy
+	function plugin_auth_emby_connect_disabled() {
+		return 'Emby Connect - Disabled (Dependancy: php-curl missing!)';
+	}
+	
+	// Emby Both Auth Missing Dependancy
+	function plugin_auth_emby_both_disabled() {
+		return 'Emby Both - Disabled (Dependancy: php-curl missing!)';
+	}
 endif;
 // ==== Auth Plugins END ====
 // ==== General Class Definitions START ====

+ 6 - 1
settings.php

@@ -1723,7 +1723,12 @@ endif;?></textarea>
                                                                                 $backendFunctions = array_filter(get_defined_functions()['user'],function($v) { return strpos($v, 'plugin_auth_') === 0; });
                                                                                 foreach ($backendFunctions as $value) {
                                                                                     $name = str_replace('plugin_auth_','',$value);
-                                                                                    echo '<option value="'.$name.'" '.(AUTHBACKEND==$name?'selected':'').'>'.ucwords(str_replace('_',' ',$name)).'</option>';
+																					if (strpos($name, 'disabled') === false) {
+																						echo '<option value="'.$name.'" '.(AUTHBACKEND==$name?'selected':'').'>'.ucwords(str_replace('_',' ',$name)).'</option>';
+																					} else {
+																						echo '<option disabled>'.$value().'</option>';
+																					}
+                                                                                    
                                                                                 }
                                                                             ?>
                                                                         </select>