[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_admin/banlist.php,v $ 14 | $Revision: 1.20 $ 15 | $Date: 2007/02/11 10:33:52 $ 16 | $Author: e107steved $ 17 +----------------------------------------------------------------------------+ 18 */ 19 require_once ("../class2.php"); 20 if (!getperms("4")) { 21 header("location:".e_BASE."index.php"); 22 exit; 23 } 24 $e_sub_cat = 'banlist'; 25 require_once ("auth.php"); 26 require_once(e_HANDLER."form_handler.php"); 27 $rs = new form; 28 29 if (e_QUERY) { 30 $tmp = explode("-", e_QUERY); 31 $action = $tmp[0]; 32 $sub_action = $tmp[1]; 33 $id = $tmp[2]; 34 unset($tmp); 35 } 36 37 $_POST['ban_ip'] = trim($_POST['ban_ip']); 38 39 if (isset($_POST['add_ban']) && $_POST['ban_ip'] != "" && strpos($_POST['ban_ip'], ' ') === false) { 40 $_POST['ban_reason'] = $tp->toDB($_POST['ban_reason']); 41 admin_update($sql -> db_Insert("banlist", "'".$_POST['ban_ip']."', '".ADMINID."', '".$_POST['ban_reason']."'"), 'insert'); 42 unset($ban_ip); 43 } 44 45 if (isset($_POST['update_ban']) && $_POST['ban_ip'] != "" && strpos($_POST['ban_ip'], ' ') === false) { 46 $_POST['ban_reason'] = $tp->toDB($_POST['ban_reason']); 47 admin_update($sql -> db_Update("banlist", "banlist_ip='".$_POST['ban_ip']."', banlist_admin=".ADMINID.", banlist_reason='".$_POST['ban_reason']."' WHERE banlist_ip='".$_POST['old_ip']."'")); 48 unset($ban_ip); 49 } 50 51 if ($action == "remove" && isset($_POST['ban_secure'])) { 52 $sql -> db_Delete("generic", "gen_type='failed_login' AND gen_ip='$sub_action'"); 53 admin_update($sql -> db_Delete("banlist", "banlist_ip='$sub_action'"), 'delete'); 54 } 55 56 if ($action == "edit") { 57 $sql->db_Select("banlist", "*", "banlist_ip='$sub_action'"); 58 $row = $sql->db_Fetch(); 59 extract($row); 60 } else { 61 unset($banlist_ip, $banlist_reason); 62 if (e_QUERY && strpos($_SERVER["HTTP_REFERER"], "userinfo")) { 63 $banlist_ip = $action; 64 } 65 } 66 67 $text = ""; 68 69 70 71 $text .= "<div style='text-align:center'> 72 <form method='post' action='".e_SELF."'> 73 <table style='".ADMIN_WIDTH."' class='fborder'> 74 75 <tr> 76 <td style='width:30%' class='forumheader3'>".BANLAN_5.": {$rdns_warn}</td> 77 <td style='width:70%' class='forumheader3'> 78 <input class='tbox' type='text' name='ban_ip' size='40' value='".$banlist_ip."' maxlength='200' /> 79 </td> 80 </tr> 81 82 <tr> 83 <td style='width:20%' class='forumheader3'>".BANLAN_7.": </td> 84 <td style='width:80%' class='forumheader3'> 85 <textarea class='tbox' name='ban_reason' cols='50' rows='4'>$banlist_reason</textarea> 86 </td> 87 </tr> 88 89 <tr style='vertical-align:top'> 90 <td colspan='2' style='text-align:center' class='forumheader'>". 91 ($action == "edit" ? "<input type='hidden' name='old_ip' value='$banlist_ip' /><input class='button' type='submit' name='update_ban' value='".LAN_UPDATE."' />" : "<input class='button' type='submit' name='add_ban' value='".BANLAN_8."' />")." 92 93 </td> 94 </tr> 95 </table> 96 </form> 97 </div>"; 98 99 $text .= "<div style='text-align:center'><br />".BANLAN_13."<a href='".e_ADMIN."users.php'><img src='".e_IMAGE."admin_images/users_16.png' alt='' /></a></div>"; 100 if(!varsettrue($pref['enable_rdns'])) 101 { 102 $text .= "<div style='text-align:center'><br />".BANLAN_12."</div>"; 103 } 104 105 $ns->tablerender(BANLAN_9, $text); 106 107 if ($action != "edit") { 108 $text = $rs->form_open("post", e_SELF, "ban_form")."<div style='text-align:center'>".$rs->form_hidden("ban_secure", "1"); 109 if (!$ban_total = $sql->db_Select("banlist","*","ORDER BY banlist_ip","nowhere")) { 110 $text .= "<div style='text-align:center'>".BANLAN_2."</div>"; 111 } else { 112 $text .= "<table class='fborder' style='".ADMIN_WIDTH."'> 113 <tr> 114 <td style='width:70%' class='fcaption'>".BANLAN_10."</td> 115 <td style='width:30%' class='fcaption'>".LAN_OPTIONS."</td> 116 </tr>"; 117 $count = 0; 118 while ($row = $sql->db_Fetch()) { 119 extract($row); 120 $banlist_reason = str_replace("LAN_LOGIN_18", BANLAN_11, $banlist_reason); 121 $text .= "<tr><td style='width:70%' class='forumheader3'>$banlist_ip<br />".BANLAN_7.": $banlist_reason</td> 122 <td style='width:30%; text-align:center' class='forumheader3'>".$rs->form_button("submit", "main_edit_$count", LAN_EDIT, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?edit-$banlist_ip'\"").$rs->form_button("submit", "main_delete_$count", BANLAN_4, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?remove-$banlist_ip'\"")."</td>\n</tr>"; 123 $count++; 124 } 125 $text .= "</table>\n"; 126 } 127 $text .= "</div>".$rs->form_close(); 128 $ns->tablerender(BANLAN_3, $text); 129 } 130 131 require_once ("footer.php"); 132 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |