コード例 #1
0
function send_message($message)
{
    if ($message != 'Device Armed' && $message != 'Device Disarmed' && $message != 'Device Unlocked' && $message != 'Device Locked') {
        $message .= ' just opened the door';
    }
    $devices = get_all_device();
    foreach ($devices as $row) {
        $reg_id = $row->gcm_regid;
        $registration_ids = array($reg_id);
        $msg = array('notif' => $message);
        $result = send_notification($registration_ids, $msg);
        echo $result;
    }
}
コード例 #2
0
            $size = "(secondary)";
        }
        $index = array_search_ex($file, $a_extent, "path");
        if (FALSE !== $index) {
            if (!isset($uuid)) {
                continue;
            }
            if ($a_extent[$index]['uuid'] != $uuid) {
                continue;
            }
        }
        $a[$file] = htmlspecialchars("{$name}: {$size}");
    }
    return $a;
}
$a_device = get_all_device($a_iscsitarget_extent, $uuid);
$a_scsi_device = get_all_scsi_device($a_iscsitarget_extent, $uuid);
$a_zvol = get_all_zvol($a_iscsitarget_extent, $uuid);
$a_hast = get_all_hast($a_iscsitarget_extent, $uuid);
if (isset($uuid) && FALSE !== ($cnid = array_search_ex($uuid, $a_iscsitarget_extent, "uuid"))) {
    $pconfig['uuid'] = $a_iscsitarget_extent[$cnid]['uuid'];
    $pconfig['name'] = $a_iscsitarget_extent[$cnid]['name'];
    $pconfig['path'] = $a_iscsitarget_extent[$cnid]['path'];
    $pconfig['size'] = $a_iscsitarget_extent[$cnid]['size'];
    $pconfig['sizeunit'] = $a_iscsitarget_extent[$cnid]['sizeunit'];
    $pconfig['type'] = $a_iscsitarget_extent[$cnid]['type'];
    $pconfig['comment'] = $a_iscsitarget_extent[$cnid]['comment'];
    if (!isset($pconfig['sizeunit'])) {
        $pconfig['sizeunit'] = "MB";
    }
} else {