O5. 新工作站

新工作站已注册

为新工作站提供访问权限后,但在将相应信息记录到数据库之前调用。

数据库

参数

返回值

可使用

id ——工作站临时/固定ID,

address——工作站网络地址,

station——工作站名称,

existing——为下一工作站确认

忽略

钩子文本:

--[[

Database:

 available

 

Called:

 when newbie access granted but before information stored in database

 

Parameters:

 id             station temporary/permanent ID

 address        station network address

 station        station name

 existing       approved using existing station

 

Returned value:

 ignored

 

]]

 

local args = ... -- args.id, args.address, args.station

新工作站正在连接Dr.Web服务器

新工作站连接Dr.Web服务器时调用

数据库

参数

返回值

可使用

id——工作站临时ID,

address——工作站网络地址,

station——工作站名称,

description——工作站描述(只限Windows操作系统客户端),

ldapdn——工作站LDAP DN(只限Windows操作系统客户端),

sid——工作站SID,

mac——工作站MAC地址

nil——使用默认设置,与Dr.Web服务器常规运行时相同,

boolean——Dr.Web服务器的操作:

true——申请手动确认(类似于Newbie approval),

false——禁止访问(类似于Newbie closed),

string——确认时的基组:

empty——确认,将Everyone组设为基组(类似于Newbie open),

not-empty——确认访问并将与此行ID相符的组设为基组。注意!会对此ID是否存在进行检查,如此ID不存在,则将基组指定为Everyone组,

vector——按照默认进行确认,包含以下指令和非必要参数:

pgroup——指定基组,之后为组ID,

rate——指定资费组,之后为资费组ID,

id——指定工作站,之后为工作站ID

approve——申请以手动确认代替自动确认,

into——确认为已存在的工作站,之后为已存在工作站的ID

钩子文本:

--[[

Called:

 when newbie connected

 

Database:

 available

 

Parameters:

 id             station temporary ID

 address        station network address

 station        station name

 description    station description (Windows client only)

 ldapdn         station LDAP DN (Windows client only)

 sid            station computer SID

 mac            station computer MAC

 

Returned value:

            nil        default, standard server operation according settings

 boolean    true       request approval (like 'Newbie approval' does)

            false      reject access (like 'Newbie closed' does)

 string     empty      accept, set primary group to 'Everyone'

                         (like 'Newbie open' does)

            not-empty  accept, set primary group to this string (ID) (substring after space treated as rate group id)

                       Attention! Existence of This ID will be checked and

                       if it does not exist it will be replaced by `Everyone'

 vector                accept by default, must contain commands and optional arguments:

                       "pgroup"  - set primary group, must be followed by group id

                       "rate"    - set rate group, must be followed by rate group id

                       "id"      - set station id, must be followed by station id

                       "approve" - request approval instead of accepting

                       "into"    - accept into existing station, must be followed by existing station id

 

 

Procedure from next set will be called if returned nothing.

]]

 

local args = ... -- args.id, args.address, args.station

 

-- place my station (named ADMINISTRATOR) into `Everyone' group ignoring newbie policy and newbie's preference

if string.upper( args.station ) == 'ADMINISTRATOR' then

 return ''

end

 

-- set new UUID for any station with this id and request for manual approve, useful for cloned stations

if args.id == '01234567-89ab-cdef-0123-456789abcdef' then

 return { "id", dwcore.get_uuid(), "approve" }

end

 

-- no return => `nil' value => according server settings

已接受新工作站

为新工作站提供访问权限、工作站成功登录、在数据库创建工作站时调用。

数据库

参数

返回值

可使用

id——工作站临时ID,

address——工作站网络地址,

station——工作站名称,

compsid——工作站SID,

compmac——工作站MAC地址,

description——工作站描述

忽略

钩子文本:

--[[

Called:

 when newbie access granted, authorization is successfull

 and station created in database

 

Database:

 available

 

Parameters:

 id             station temporary ID

 address        station network address

 station        station name

 compsid        station UID (SID on Windows)

 compmac        station MAC address

 description    station description

 

Returned value:

 ignored

 

]]

 

local args = ... -- args.id, args.address, args.station, args.compsid, args.compmac, args.description