How to automatically rename a WEB support user right after his registrations on a website?
Posted: Mon Dec 16, 2019 3:16 pm
The server's version is 7.0 and higher.
Use the event OnRegistered:
The script performs when a new user registers. It checks that this user has a default rights group "WEB guests". If yes, the script renames him by adding a prefix to his nickname "(websup)" from a text constant.
Script source
Use the event OnRegistered:
The script performs when a new user registers. It checks that this user has a default rights group "WEB guests". If yes, the script renames him by adding a prefix to his nickname "(websup)" from a text constant.
Script source
Code: Select all
// ---------------------------------------
// Script created by Alexey Pikurov
// 01.06.2018 15:33:51
// ---------------------------------------
const
PREFIX = '(websup)';
procedure OnRegistered(iCID, iUIN: integer; var iRole: integer; var bBlocked: boolean);
var
sGroupName, sNickName: string;
x: integer;
begin
sGroupName := mGetRoleNameByID(iRole);
if sGroupName = 'WEB guests' then begin
sNickName := mGetUserAttribute(iUIN, 'InternalNickName');
if pos(PREFIX, sNickName) = 0 then mSetUserAttribute(iUIN, 'InternalNickName', PREFIX + ' ' + sNickName);
end;
end;
begin
end.