Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > How to create account in 1C ?

Forum

Search UsersRules
How to create account in 1C ?
#1
Active user
Points:: 0
Joined:: Jan 14, 2013

I create 1 account that login  at the same time only 1 point in 1C

Profile
#2
Active user
Points:: 0
Joined:: Sep 26, 2012

Are you set some roles for user?

Profile
#3
Active user
Points:: 0
Joined:: Jan 14, 2013

Hi ivan avdonin!

I want this account the same 'designer' when i'm using it, nobody can use it for login.

Profile
#4
Active user
Points:: 0
Joined:: Sep 26, 2012

You can write script at event handler BeforeStart at Managed Application Module, and function at Common module, which check another connections with same user

Code
//Managed Application Module
Procedure BeforeStart(Cancel)
   If CommonFunctions.IsAnotherUser() Then
      
      Message = "The same user already open 1c. Current connection exit.";
      
      TextMessage = New TextDocument;
      TextMessage.SetText("
      |<HT ML><HEAD>
      |<MET A content=""text/html; charset=utf-8"" http-equiv=Content-Type>
      |<MET A name=GENERATOR content=""MSHTML 9.00.8112.16464""></HEAD>
      |<BODY><h2>" + StrReplace(Message, Chars.LF, "<br>") + "</h2></BODY></HTML>");

      FilePath = GetTempFileName("html");
      TextMessage.Write(FilePath);

      #If WebClient Then 
         DoMessageBox(Message, 3);
      #Else
         RunApp(FilePath);
      #EndIf
      
      Cancel = True;
   
   EndIf;   
EndProcedure

// Common module "CommonFunctions"
Function IsAnotherUser() Export 

   CurrentConnectionNumber = InfoBaseConnectionNumber();
   UserUUID = InfoBaseUsers.CurrentUser().UUID;
   
   ConnectionArray = GetInfoBaseConnections();
   
   For each CurConnection In ConnectionArray Do
      If (Find(CurConnection.ApplicationName, "1CV8") > 0) AND (NOT CurConnection.ConnectionNumber = CurrentConnectionNumber)
         AND (NOT CurConnection.User = Undefined)
         AND (CurConnection.User.UUID = UserUUID) Then
         
         Return True;
         
      EndIf;
   EndDo;
   
   Return False;

EndFunction // CheckAnotherUser()

Profile
#5
Active user
Points:: 0
Joined:: Jan 14, 2013

Hi ivan avdonin!

Thanks you.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.