Changeset 5162 for extensions/nbc_HistoryIPExcluder
- Timestamp:
- Mar 17, 2010, 5:44:07 PM (14 years ago)
- Location:
- extensions/nbc_HistoryIPExcluder/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.php
r5121 r5162 21 21 $v = str_replace( ",,", ",", $v ); 22 22 23 $conf[' nbc_HistoryIPExcluder'] = stripslashes($v);23 $conf['HistoryIPExcluder'] = stripslashes($v); 24 24 25 25 $query = ' 26 26 UPDATE '.CONFIG_TABLE.' 27 SET value="'.$conf[' nbc_HistoryIPExcluder'].'"28 WHERE param=" nbc_HistoryIPExcluder"27 SET value="'.$conf['HistoryIPExcluder'].'" 28 WHERE param="HistoryIPExcluder" 29 29 LIMIT 1'; 30 30 pwg_query($query); … … 35 35 elseif ( isset($_POST['CleanHist']) ) 36 36 { 37 $conf_HIPE = explode("," , $conf[' nbc_HistoryIPExcluder']);37 $conf_HIPE = explode("," , $conf['HistoryIPExcluder']); 38 38 39 39 foreach ( $conf_HIPE as $Exclusion ) … … 197 197 } 198 198 199 $conf_HIPE = explode("," , $conf[' nbc_HistoryIPExcluder']);199 $conf_HIPE = explode("," , $conf['HistoryIPExcluder']); 200 200 201 201 $template->assign( 202 202 array( 203 'HIPE_F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin§ion= nbc_HistoryIPExcluder%2Fadmin%2FHIPE_admin.php',203 'HIPE_F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin§ion=HistoryIPExcluder%2Fadmin%2FHIPE_admin.php', 204 204 'IPs_EXCLUDED' => implode("\n", $conf_HIPE), 205 205 ) -
extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.tpl
r5121 r5162 14 14 15 15 <div style="text-align:center;"> 16 <textarea name="HIPE_IPs_Excluded" rows="10" cols="60" {$TAG_INPUT_ENABLED}>{$IPs_EXCLUDED}</textarea> 16 <textarea name="HIPE_IPs_Excluded" rows="10" cols="30" {$TAG_INPUT_ENABLED}>{$IPs_EXCLUDED}</textarea> 17 17 18 </div> 18 19 -
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 ?> -
extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php
r5121 r5162 9 9 $q = ' 10 10 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 11 VALUES (" nbc_HistoryIPExcluder","","Parametres nbc History IP Excluder");11 VALUES ("HistoryIPExcluder","","History IP Excluder parameters"); 12 12 '; 13 13 14 14 pwg_query($q); 15 } 16 17 18 function plugin_activate() 19 { 20 global $conf; 21 22 /* Check for upgrade from 2.0.0 to 2.0.1 */ 23 /* *************************************** */ 24 $query = ' 25 SELECT param 26 FROM '.CONFIG_TABLE.' 27 WHERE param = "nbc_HistoryIPExcluder" 28 ;'; 29 $count = mysql_num_rows(pwg_query($query)); 30 31 if ($count == 1) 32 { 33 /* upgrade from branch 2.0.0 to 2.0.1 */ 34 /* ************************************ */ 35 upgrade_200(); 36 } 15 37 } 16 38 … … 31 53 } 32 54 55 56 function upgrade_200() 57 { 58 global $conf; 59 60 $q = ' 61 UPDATE '.CONFIG_TABLE.' 62 SET param = "HistoryIPExcluder" 63 WHERE param = "nbc_HistoryIPExcluder" 64 ;'; 65 pwg_query($q); 66 67 $q = ' 68 UPDATE '.CONFIG_TABLE.' 69 SET comment = "History IP Excluder parameters" 70 WHERE comment = "Parametres nbc History IP Excluder" 71 ;'; 72 pwg_query($q); 73 } 33 74 ?>
Note: See TracChangeset
for help on using the changeset viewer.