there is another issue here.
if using a 4Dlink file (and maybe if not)
the password is/can be saved in the link file.
I have code in my startup routine that handles this issue too.
this code locates the link file, and then removes the password from the
file.
$Link_File_Path:=System folder(User Preferences_User)
$Database_Name:=utl_Database_Name
$Database_Name:=$Database_Name+".4DLink" //becaus ethe link file does
not carry that part of the database name
If (Folder separator=Colon_Char) //link file is in a specific location
$Link_File_Path:=$Link_File_Path+"4D:Favorites
v13:Remote:"+$Database_Name
Else //windows - link file may be in either of 2 locations
$Database_Name:=txtutl_Strip_Characters ($Database_Name) //windows
does not like leading spaces
$Link_File_Path:=System folder(Desktop)
If (Test path name($Link_File_Path)#Is a document) //file Does NOT
exist
$Link_File_Path:=System folder(User Preferences_User)
End if
$Link_File_Path:=$Link_File_Path+$Database_Name
End if
If (Test path name($Link_File_Path)=Is a document) //file exists
$xml:=DOM Parse XML source($Link_File_Path)
DOM SET XML ATTRIBUTE($xml;"md5_password";"")
DOM EXPORT TO FILE($xml;$Link_File_Path)
End if
On Wed, 22 Aug 2018 21:05:30 -0500, Tim Nevels via 4D_Tech wrote:
> Here is some code I wrote today due to a request by a client to stop
> allowing users to remember their password when using the built in 4D
> user login window. This is that “Remember password” checkbox that you
> can’t make go away. The workaround is to just delete the file that
> stores the user name and password that is remembered.
>
> There is an article in the 4D Knowledge Base about this, but it is
> for older versions of 4D where the path to this saved “.mdp” file has
> different. I used that as a starting point and the got it to work
> with the 4D v14 version that I needed. Should work with 4D v14+.
>
> Works on macOS and Windows. You do need to provide the “application
> name” because I could not reliably determine this with so many
> possible variations like: using 4D, using merged single-user
> application, using merged client application or user has changed the
> application name.
>
> // ===========================================
> // PROJECT METHOD: RemoveRememberedPassword
>
> // PARAMETERS: $1 = application name
>
> // DESCRIPTION: When using the 4D password system
> // you can choose the "Remember password" option which
> // will save your username and password. This will allow
> // you to bypass the login prompt and automatically log in from then on.
>
> // When the "Remember Password" option is selected, the 4D user name
> // and password are saved to a file. File name is the application
> name+".mdp"
> // This method will delete that file, if it exists.
>
> // Should work with 4D v14+ versions. (Unless they change the
> location, again.)
>
> // Windows path
> //
> C:\Users\{username}\AppData\Roaming\{applicationName}\Favorites
> v{applicationMajorVersion}\Remote\
>
> // macOS Path
> // /users/{username}/Library/Application
> Support/{applicationName}/Favorites v{applicationMajorVersion}/Remote/
>
> // CREATED BY: Tim Nevels, Innovative Solutions ©2018
> // DATE: 8/22/18
> // LAST MODIFIED:
> // ============================================
> C_TEXT($1;$applicationName_t)
> $applicationName_t:=$1
>
> // declare local variables
> C_TEXT($applicationMajorVersion_t;$filePath_t)
>
> // get 4D application major version
> $applicationMajorVersion_t:=Substring(Application version;1;2)
>
> // strip off extension
> If (<>macOS)
> $applicationName_t:=Replace string($applicationName_t;".app";"")
> Else
> $applicationName_t:=Replace string($applicationName_t;".exe";"")
> End if
>
> // build file path to the .mdp file
> $filePath_t:=Get 4D folder(Active 4D Folder)+"Favorites
> v"+$applicationMajorVersion_t+Folder separator+\
> "Remote"+Folder separator+$applicationName_t+".mdp"
>
> // delete file if it is there
> If (Test path name($filePath_t)=Is a document)
> DELETE DOCUMENT($filePath_t)
> End if
>
>
> Tim
>
> *****************************************
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> [email protected]
> *****************************************
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive: http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************