KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to reintroduce the login Users list to a built Client Server application
PRODUCT: 4D | VERSION: 12.4 | PLATFORM: Mac & Win
Published On: August 24, 2012

In a built Client-Server, when a client first attempts to logon with the client the Users list is presented. In subsequent logons the user will be presented with no dialog and will be logged on automatically or will be presentd with a dialog with one users name and request for a password.

To get the Users list back so that a user can chosen a file has to be deleted from the Favorites v11, Favorites v12, or Favorites v13/Remote/ folder. This file will have the name of the structure and one of two suffixes, ".4DLink" or ".mdp". Both of these files are XML files that contains the encrypted password attribute (md5_password="...").

The code snippet below should be placed in a project method and called as some point after the On Startup method, such as in the On Exit method or at some other strategic time. How and when to call this code is up to the developer.

If (Application type=4D Remote Mode)
    $Struct_T:=Structure file
    $Struct_T:=Substring($Struct_T;1;Position(".";$Struct_T)-1)

    $FilePath_T:=Get 4D folder(Active 4D Folder)+"Favorites v12"+Folder separator+"Remote"+Folder separator+$Struct_T+".mdp"
    If (Test path name($FilePath_T)=Is a document)
       DELETE DOCUMENT($FilePath_T)
    End if

    $FilePath_T:=Get 4D folder(Active 4D Folder)+"Favorites v12"+Folder separator+"Remote"+Folder separator+$Struct_T+".4DLink"
    If (Test path name($FilePath_T)=Is a document)
       DELETE DOCUMENT($FilePath_T)
    End if
End if


One interesting point in this code is the behavior of the 4D function Structure file. When used in Local Mode it will return the absolute path to the structure file. When used in the Remote Mode it only returns the file name.