static function TSystemCore.Logon(const ALogonID, APassword: string): Boolean;
const
ErrMsg = '用户%s不能登陆,因为没有分配岗位或者用户%s已经被其他用户代理.';
ErrMsg1 = '用户%s不能登陆,因为没有分配功能权限.';
var
lOperator: TOperator;
begin
CheckLogon(False);
lOperator := Opr.Logon(ALogonID, APassword);
Result := lOperator <> nil;
if Result then
begin
if not Opr.IsSystemManager(ALogonID) and
(lOperator.PositionList.Count = 0) then
begin
Opr.Logoff(lOperator);
raise Exception.CreateFmt(ErrMsg, [ALogonID, ALogonID]);
end;
if lOperator.FuncItems.Count = 0 then
begin
Opr.Logoff(lOperator);
raise Exception.CreateFmt(ErrMsg1, [ALogonID, ALogonID]);
end ;
FOperator := lOperator;
UITheme.FSpace := UITheme.GetUserUISpace(lOperator);
if Assigned(SystemInterface.OnLogonSucceed) then
SystemInterface.OnLogonSucceed(FOperator);
end;
end;