Index: /extensions/AntiAspi/admin.php
===================================================================
--- /extensions/AntiAspi/admin.php	(revision 31362)
+++ /extensions/AntiAspi/admin.php	(revision 31362)
@@ -0,0 +1,103 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH'))
+    die('Hacking attempt!');
+global $template, $conf, $user;
+include_once(PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php');
+load_language('plugin.lang', ANTIASPI_PATH);
+$my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugin-'; //get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+//-------------------------------------------------------- sections definitions
+if (!isset($_GET['tab']))
+    $page['tab'] = 'ipban';
+else
+    $page['tab'] = $_GET['tab'];
+
+
+
+    $tabsheet = new tabsheet();
+    $tabsheet->add('ipban', l10n('IP ban'), ANTIASPI_ADMIN . '-ipban');
+    $tabsheet->select($page['tab']);
+    $tabsheet->assign();
+
+// Tab gest
+switch ($page['tab']) {
+    case 'ipban':
+	$ipban = pwg_query("SELECT * FROM " . ANTIASPI_TABLE . ";");
+    $admin_base_url = ANTIASPI_ADMIN . '-ipban';
+        if (pwg_db_num_rows($ipban)) {
+            while ($ipban2 = pwg_db_fetch_assoc($ipban)) {
+				
+                $items = array(
+                    'ID' => $ipban2['id'],
+                    'IP' => $ipban2['ip'],
+                    'DATE' => $ipban2['date'],
+                    'U_DELETE' => $admin_base_url . '&amp;delete=' . $ipban2['id'],
+                    'U_EDIT' => $admin_base_url . '&amp;edit=' . $ipban2['id'],
+                );
+
+                $template->append('ipban2', $items);
+            }
+        }
+		
+  if (isset($_GET['delete'])) {
+
+    check_input_parameter('delete', $_GET, false, PATTERN_ID);
+    $query = 'DELETE FROM ' . ANTIASPI_TABLE . ' WHERE id = ' . $_GET['delete'] . ';';
+    pwg_query($query);
+
+    $_SESSION['page_infos'] = array(l10n('IP beleted'));
+    redirect($admin_base_url);
+  }
+
+if (isset($_GET['edit'])) {
+    check_input_parameter('edit', $_GET, false, PATTERN_ID);
+    $query = 'SELECT * FROM ' . ANTIASPI_TABLE . ' WHERE id = \'' . $_GET['edit'] . '\';';
+		$result = pwg_query($query);
+		$row = pwg_db_fetch_assoc($result);
+		$template->assign(
+			'ipban_edit', array(
+			'ID' => $row['id'],
+			'IP' => $row['ip'],
+			'DATE' => $row['date'],
+		));
+}  
+
+if (isset($_POST['submitaddipban2'])) {
+	$query = 'UPDATE ' . ANTIASPI_TABLE .' SET ip= "'.$_POST['inserip'].'" , date = "'.$_POST['inserdate'].'" WHERE id = '.$_POST['invisibleID'].';';
+	$result = pwg_query($query);
+	$_SESSION['page_infos'] = array(l10n('Ip ban update'));
+	redirect($admin_base_url);
+}
+
+//add ban
+if (isset($_POST['submitipban'])) {
+	$template->assign(
+		'ipban_add', array(
+		'nada' => l10n('nada'),
+	));
+	$template->clear_assign(
+		'ipban_edit', array(
+	));
+}
+
+if (isset($_POST['submitaddipban'])) {
+	$query = 'INSERT INTO ' . ANTIASPI_TABLE .'(ip,date) VALUES ("' . $_POST['inserip'] . '","' . $_POST['inserdate'].'");';
+	$result = pwg_query($query);
+	$_SESSION['page_infos'] = array(l10n('Ip ban insert'));
+	redirect($admin_base_url);
+}
+		
+	
+	break;
+}
+	
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/AntiAspi/admin.tpl
===================================================================
--- /extensions/AntiAspi/admin.tpl	(revision 31362)
+++ /extensions/AntiAspi/admin.tpl	(revision 31362)
@@ -0,0 +1,52 @@
+<div class="titrePage">
+  <h2>{'AntiAspi'|@translate}</h2>
+</div>
+<form method="post" >
+	<fieldset>
+		<input class="submit" name="submitipban" type="submit" value="{'Add IP ban'|@translate}" />
+	</fieldset>
+</form>
+{if isset ($ipban_add)}
+	<form method="post" >
+		<fieldset>
+			<legend>{'Add IP ban'|@translate}</legend>
+			<input type="text" name="inserip" value="" size="50" maxlenght="50">
+			<input type="text" name="inserdate" value="" size="20" maxlenght="20">
+			<br>	
+			<br>
+				<div style="text-align:center;">
+				<input class="submit" name="submitaddipban" type="submit" value="{'Submit'|@translate}" />
+				</div>
+		</fieldset>
+	</form>
+{/if}
+<form method="post" >
+	<fieldset>
+		<legend>{'List IP banned'|@translate}</legend>
+		{foreach from=$ipban2 item=ipban}
+			{$ipban.ID}   {$ipban.IP}   {$ipban.DATE}
+			<a href="{$ipban.U_EDIT}">
+				<img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" alt="{'edit'|@translate}" title="{'edit'|@translate}" />
+			</a>
+			<a href="{$ipban.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
+				<img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete'|@translate}" />
+			</a>
+		<br>
+		{/foreach}
+  	</fieldset>
+</form>
+{if isset ($ipban_edit)}
+	<form method="post" >
+		<fieldset>
+			<legend>{'IP banned edit'|@translate}</legend>
+			<input type="hidden" name="invisibleID" value="{$ipban_edit.ID}">
+			<input type="text" name="inserip" value="{$ipban_edit.IP}" size="50" maxlenght="50">
+			<input type="text" name="inserdate" value="{$ipban_edit.DATE}" size="20" maxlenght="20">
+			<br>	
+			<br>
+				<div style="text-align:center;">
+				<input class="submit" name="submitaddipban2" type="submit" value="{'Submit'|@translate}" />
+				</div>
+		</fieldset>
+	</form>
+{/if}
Index: /extensions/AntiAspi/initadmin.php
===================================================================
--- /extensions/AntiAspi/initadmin.php	(revision 31362)
+++ /extensions/AntiAspi/initadmin.php	(revision 31362)
@@ -0,0 +1,13 @@
+<?php
+//add admin menu
+add_event_handler('get_admin_plugin_menu_links', 'antiaspi_admi_menu');
+
+function antiaspi_admi_menu($menu) {
+    load_language('plugin.lang', ANTIASPI_PATH);
+    $menu[] = array(
+        'NAME' => l10n('AntiAspi'),
+        'URL' => ANTIASPI_ADMIN,
+    );
+     return $menu;
+} 
+ 
Index: /extensions/AntiAspi/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/AntiAspi/language/en_UK/plugin.lang.php	(revision 31362)
+++ /extensions/AntiAspi/language/en_UK/plugin.lang.php	(revision 31362)
@@ -0,0 +1,12 @@
+<?php
+//admin
+$lang['AntiAspi'] = 'AntiAspi';
+$lang['IP ban'] = 'IP ban';
+$lang['IP deleted'] = 'IP deleted';
+$lang['Ip ban update'] = 'Ip ban update';
+$lang['Ip ban insert'] = 'Ip ban insert';
+$lang['Add IP ban'] = 'Add IP ban';
+$lang['IP banned'] = 'IP banned';
+$lang['List IP banned'] = 'List IP banned';
+$lang['IP banned edit'] = 'IP banned edit';
+
Index: /extensions/AntiAspi/main.inc.php
===================================================================
--- /extensions/AntiAspi/main.inc.php	(revision 31361)
+++ /extensions/AntiAspi/main.inc.php	(revision 31362)
@@ -21,4 +21,5 @@
 define('ANTIASPI_TABLE' , $prefixeTable . 'antiaspi_ip_ban');
 define('ANTIASPI_LOG_TABLE' , $prefixeTable . 'antiaspi_log');
+define('ANTIASPI_ADMIN',get_root_url().'admin.php?page=plugin-'.ANTIASPI_ID);
 
 add_event_handler('loc_end_section_init', 'antiaspi');
@@ -122,2 +123,7 @@
   pwg_query($query);
 }
+
+// Plugin for admin
+if (script_basename() == 'admin') {
+    include_once(dirname(__FILE__) . '/initadmin.php');
+}
