flags |= 0x01; $forward->name = $name; $part = explode('-', $ports); if (is_numeric($part[0]) && $part[0] > 0 && $part[0] < 65535) { $forward->portlo = $part[0]; if (is_numeric($part[1]) && $part[1] > 0 && $part[1] < 65535) $forward->porthi = $part[1]; $forward->save(); } } Helper::reload(); } function del_forward() { $forwardid = Input::getVar('forwardid', INP_GET | INP_INT | INP_DEFAULT, 0); if ($forwardid == 0) Helper::reload(); Forward::delete($forwardid); Helper::reload(); } function toggle_forward() { $forwardid = Input::getVar('forwardid', INP_GET | INP_INT | INP_DEFAULT, 0); if ($forwardid == 0) Helper::reload(); $forward = Forward::load($forwardid); $forward->toggle(); $forward->save(); Helper::reload(); } function show() { $smarty = new MySmarty(); $forwards = Forward::getAll(); $smarty->assign('forwards', $forwards); $smarty->displaySite('Bridge Configuration: Forward Ports', 'forward.tpl'); } $action = Input::getVar('action', INP_GET | INP_STRING | INP_DEFAULT, "show"); switch ($action) { case 'add_forward': add_forward(); break; case 'del_forward': del_forward(); break; case 'toggle_forward': toggle_forward(); break; default: case 'show': show(); break; } ?>