PHP Conference Japan 2024

radius_put_string

(PECL radius >= 1.1.0)

radius_put_string附加字串屬性

說明

radius_put_string(
    資源 $radius_handle,
    整數 $type,
    字串 $value,
    整數 (int) $options = 0,
    整數 (int) $tag = ?
): 布林值 (bool)

將字串屬性附加到目前的 RADIUS 請求。一般來說,radius_put_attr() 是一個更有用的附加字串屬性函式,因為它是二進位安全的。

注意事項:

在呼叫此函式之前,必須透過 radius_create_request() 建立請求。

參數

radius_handle

RADIUS 資源。

type

屬性類型。

value

屬性值。底層函式庫預期此值以 null 終止,因此此參數不是二進位安全的。

options

屬性選項的位元遮罩。可用選項包括 RADIUS_OPTION_TAGGEDRADIUS_OPTION_SALT

tag

屬性標籤。除非設定了 RADIUS_OPTION_TAGGED 選項,否則會忽略此參數。

返回值

成功時返回 true,失敗時返回 false

更新日誌

版本 說明
PECL radius 1.3.0 新增了 optionstag 參數。

範例

範例 #1 radius_put_string() 範例

<?php
if (!radius_put_string($res, RADIUS_USER_NAME, 'billy')) {
echo
'RadiusError:' . radius_strerror($res). "\n<br />";
exit;
}
?>

參見

新增註記

使用者提供的註記

此頁面沒有使用者提供的註記。
To Top