Dutch PHP Conference 2025 - Call For Papers

radius_put_attr

(PECL radius >= 1.1.0)

radius_put_attrAttaches a binary attribute

Опис

radius_put_attr(
    resource $radius_handle,
    int $type,
    string $value,
    int $options = 0,
    int $tag = ?
): bool

Attaches a binary attribute to the current RADIUS request.

Зауваження:

Перед викликом цієї функції потрібно створити запит за допомогою функції radius_create_request().

Параметри

radius_handle

RADIUS-ресурс.

type

Тип атрибута.

value

The attribute value, which will be treated as a raw binary string.

options

Бітова маска параметрів атрибута. Доступні такі параметри: RADIUS_OPTION_TAGGED і RADIUS_OPTION_SALT.

tag

Тег атрибуту. Якщо встановлено параметр RADIUS_OPTION_TAGGED, то цей параметр ігнорується.

Значення, що повертаються

Повертає true у разі успіху або false в разі помилки.

Журнал змін

Версія Опис
PECL radius 1.3.0 The options and tag parameters were added.

Приклади

Приклад #1 radius_put_attr() example

<?php
mt_srand
(time());
$chall = mt_rand();
$chapval = hash('md5', pack('Ca*',1 , 'sepp' . $chall));
$pass = pack('CH*', 1, $chapval);
if (!
radius_put_attr($res, RADIUS_CHAP_PASSWORD, $pass)) {
echo
'RadiusError:' . radius_strerror($res). "\n<br />";
exit;
}
?>

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top