Changeset 5162 for extensions/nbc_HistoryIPExcluder/trunk/main.inc.php
- Timestamp:
- Mar 17, 2010, 5:44:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/nbc_HistoryIPExcluder/trunk/main.inc.php
r5121 r5162 1 1 <?php 2 2 /* 3 Plugin Name: NBCHistory IP Excluder4 Version: 2.0. 05 Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l historique - Excludes one IP or a range of IP from the history. plugin directement derive de Stats Ip Excluder de Eric3 Plugin Name: History IP Excluder 4 Version: 2.0.1 5 Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l historique - Excludes one IP or a range of IP from the history. 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=147 7 7 Author: Nicco, Eric … … 22 22 function HIPE_admin_menu($menu) 23 23 { 24 // +-----------------------------------------------------------------------+ 25 // | Getting plugin name | 26 // +-----------------------------------------------------------------------+ 27 $plugin = PluginNfo(HIPE_PATH); 28 $name = $plugin['name']; 29 24 30 array_push($menu, 25 31 array( 26 'NAME' => 'History IP Excluder',32 'NAME' => $name, 27 33 'URL' => get_admin_plugin_menu_link(HIPE_PATH.'admin/HIPE_admin.php') 28 34 ) … … 37 43 global $conf; 38 44 39 $conf_HIPE = explode("," , $conf[' nbc_HistoryIPExcluder']);45 $conf_HIPE = explode("," , $conf['HistoryIPExcluder']); 40 46 41 47 if (!$do_log) … … 63 69 } 64 70 } 71 72 73 /* Email sending debugger function */ 74 function DebugLog($value1,$value2) 75 { 76 $fo=fopen (HIPE_PATH.'admin/log.txt','a') ; 77 fwrite($fo,"======================\n") ; 78 fwrite($fo, "\n" . $value1 . "\r\n") ; 79 fwrite($fo, "\n" . $value2 . "\r\n") ; 80 fclose($fo) ; 81 } 82 83 /* Function called to get the plugin name */ 84 function PluginNfo($dir) 85 { 86 $path = $dir; 87 88 $plg_data = implode( '', file($path.'main.inc.php') ); 89 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) 90 { 91 $plugin['name'] = trim( $val[1] ); 92 } 93 if (preg_match("|Version: (.*)|", $plg_data, $val)) 94 { 95 $plugin['version'] = trim($val[1]); 96 } 97 if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) 98 { 99 $plugin['uri'] = trim($val[1]); 100 } 101 if ($desc = load_language('description.txt', $path.'/', array('return' => true))) 102 { 103 $plugin['description'] = trim($desc); 104 } 105 elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) 106 { 107 $plugin['description'] = trim($val[1]); 108 } 109 if ( preg_match("|Author: (.*)|", $plg_data, $val) ) 110 { 111 $plugin['author'] = trim($val[1]); 112 } 113 if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) 114 { 115 $plugin['author uri'] = trim($val[1]); 116 } 117 if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) 118 { 119 list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); 120 if (is_numeric($extension)) $plugin['extension'] = $extension; 121 } 122 // IMPORTANT SECURITY ! 123 $plugin = array_map('htmlspecialchars', $plugin); 124 125 return $plugin ; 126 } 127 65 128 ?>
Note: See TracChangeset
for help on using the changeset viewer.