本文整理匯總了PHP中NetworkPort::check方法的典型用法代碼示例。如果您正苦於以下問題:PHP NetworkPort::check方法的具體用法?PHP NetworkPort::check怎麽用?PHP NetworkPort::check使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NetworkPort
的用法示例。
在下文中一共展示了NetworkPort::check方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: NetworkPort
$np = new NetworkPort();
$nn = new NetworkPort_NetworkPort();
$npv = new NetworkPort_Vlan();
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
if (isset($_POST["add"])) {
// Is a preselected mac adress selected ?
if (isset($_POST['pre_mac'])) {
if (!empty($_POST['pre_mac'])) {
$_POST['mac'] = $_POST['pre_mac'];
}
unset($_POST['pre_mac']);
}
if (!isset($_POST["several"])) {
$np->check(-1, 'w', $_POST);
$np->splitInputForElements($_POST);
$newID = $np->add($_POST);
$np->updateDependencies(1);
Event::log($newID, "networkport", 5, "inventory", sprintf(__('%s adds an item'), $_SESSION["glpiname"]));
Html::back();
} else {
Session::checkRight("networking", "w");
$input = $_POST;
unset($input['several']);
unset($input['from_logical_number']);
unset($input['to_logical_number']);
for ($i = $_POST["from_logical_number"]; $i <= $_POST["to_logical_number"]; $i++) {
$add = "";
if ($i < 10) {
$add = "0";
示例2: NetworkPort
$np = new NetworkPort();
$nn = new NetworkPort_NetworkPort();
$npv = new NetworkPort_Vlan();
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
if (isset($_POST["add"])) {
// Is a preselected mac adress selected ?
if (isset($_POST['pre_mac'])) {
if (!empty($_POST['pre_mac'])) {
$_POST['mac'] = $_POST['pre_mac'];
}
unset($_POST['pre_mac']);
}
if (!isset($_POST["several"])) {
$np->check(-1, UPDATE, $_POST);
$np->splitInputForElements($_POST);
$newID = $np->add($_POST);
$np->updateDependencies(1);
Event::log($newID, "networkport", 5, "inventory", sprintf(__('%s adds an item'), $_SESSION["glpiname"]));
Html::back();
} else {
Session::checkRight("networking", UPDATE);
$input = $_POST;
unset($input['several']);
unset($input['from_logical_number']);
unset($input['to_logical_number']);
for ($i = $_POST["from_logical_number"]; $i <= $_POST["to_logical_number"]; $i++) {
$add = "";
if ($i < 10) {
$add = "0";