/** * Delete local IP address from table * * @return boolean * @author Alberto Basso <*****@*****.**> */ function sumo_delete_intranet_ip($id = 0) { $id = intval($id); if ($id > 0) { global $SUMO; $ip = sumo_get_intranet_ip_info($id, 'id', FALSE); $SUMO['DB']->CacheFlush(); $query0 = "DELETE FROM " . SUMO_TABLE_INTRANETIP . " \n \t\t \t WHERE id=" . $id; $query1 = "SELECT * FROM " . SUMO_TABLE_INTRANETIP . " \n \t\t WHERE id=" . $id; $SUMO['DB']->Execute($query0); $SUMO['DB']->Execute($query1); // verify if deleted: $rs = $SUMO['DB']->Execute($query1); // if deleted: if ($rs->PO_RecordCount(SUMO_TABLE_INTRANETIP, "id=" . $id) == 0) { sumo_write_log('I09011X', array($ip['ip'], $id, $SUMO['user']['user']), '0,1', 3, 'system', FALSE); return TRUE; } else { return FALSE; } } else { return FALSE; } }
<?php /** * SUMO MODULE: Network | View Local IP address * * @version 0.4.0 * @link http://sumoam.sourceforge.net SUMO Access Manager * @author Alberto Basso <*****@*****.**> * @copyright Copyright © 2003-2009, Alberto Basso * @package SUMO * @category Console */ $tab = sumo_get_intranet_ip_info($_GET['id'], 'id', FALSE); switch ($tab['type']) { case 'L': $type = $language['Locale']; break; case 'P': $type = $language['Proxy']; break; default: $type = $language['Unknow']; break; } $tpl = array('GET:Theme' => $SUMO['page']['theme'], 'GET:MenuModule' => $tpl['GET:MenuModule'], 'GET:LocalIPType' => $type, 'GET:IP' => $tab['ip'], 'LINK:EditLocalIP' => "<a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=edit_localip&id=" . $tab['id'] . "\");' title='" . $language["EditDataSource"] . "'>" . $language["Modify"] . "</a>", 'LINK:Remove' => sumo_verify_permissions(4, 'sumo') ? "<a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=delete_localip&id=" . $tab['id'] . "\");' title='" . $language['Remove'] . "'>" . $language['Remove'] . "</a>" : $language['Remove'], 'BUTTON:Back' => "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"network\",\"?module=network&action=ilist\");'>");