alert user on login

Question ID: 105958
0
0

Is there a way for a message box to be displayed upon a user logging into a project that is not in a specific domain?

For example:
If a user logs into any project that is not in the domain "production", then a message box appears stating "You are not logged into a production project".

Marked as spam
Posted by (Questions: 122, Answers: 3)
Asked on February 27, 2015 7:01 pm
7 views
Answers (2)
0
Private answer

The example for this is below. In the Workflow - Common Script there is an event trigger section for ''CanLogin''. This workflow event is triggered before the login happens and therefore can check the users as they are attempting to log in to the project.

The project workflow assumes that you have a connection to the project and therefore do not need to create a connection. So, you can extend the OTA/COM API in the workflow as if you have just created an API connection (i.e. workflow assumes TDConnection object as your root object). Therefore, since there is a DomainName property for the TDConnection object, you can simple use that to see what domain you are currently in and make a comparison.


    'Place in Workflow - Common Script

    Function CanLogin (DomainName, ProjectName, UserName)

        If DomainName <> ''production'' Then
            MsgBox ''You are not logged into a production testing environment.''
        End If

        CanLogin = True

    End Function
Marked as spam
Posted by (Questions: 3, Answers: 168)
Answered on February 27, 2015 7:02 pm
0
Private answer

Just as a point of clarification, the suggested workflow modification would have to be made in every project that was not in the specified domain. Or, if you are using project templates, maybe you could make the change in the template and have it propagate to all the linked projects.

Otherwise, there is not support for writing such code once, in one place, and having it affect the entire system (all domains, all projects, all users).

Marked as spam
Posted by (Questions: 1, Answers: 101)
Answered on February 27, 2015 10:13 pm