本文整理匯總了PHP中Subnets::find_inactive_hosts方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subnets::find_inactive_hosts方法的具體用法?PHP Subnets::find_inactive_hosts怎麽用?PHP Subnets::find_inactive_hosts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Subnets
的用法示例。
在下文中一共展示了Subnets::find_inactive_hosts方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
# get widget details
if (!($widget = $Tools->fetch_object("widgets", "wfile", $_REQUEST['section']))) {
$Result->show("danger", _("Invalid widget"), true);
}
# reset size and limit
$height = 350;
$slimit = 100;
# and print title
print "<div class='container'>";
print "<h4 style='margin-top:40px;'>{$widget->wtitle}</h4><hr>";
print "</div>";
}
// time_range - 30 days
$seconds = 86400 * 30;
# Find inactive hosts
$inactive_hosts = $Subnets->find_inactive_hosts($seconds, $slimit);
# check permissions
if ($inactive_hosts !== false) {
foreach ($inactive_hosts as $h) {
# fetch subnet
$subnet = $Subnets->fetch_subnet("id", $h->subnetId);
if ($subnet !== false) {
# check permission of user
$sp = $Subnets->check_permission($User->user, $subnet->id);
if ($sp != "0") {
$h->sectionId = $subnet->sectionId;
$h->subnet = $subnet->subnet;
$h->mask = $subnet->mask;
$out[] = $h;
}
$m++;