Reading Site Admin Parameters

 

 

User's Requirement

 

Need to read SiteAdmin Parameter

 

 

Proposed Solution

 

During the Login into the Project it is necessary to read a Site Admin Parameter. In the case there is a particular value it is not allowed to access to the Project and show the warning message.


 

___________________________________________________________________________

 

Implementation on the Product

 

Suppose the parameter consists in a value indicated if the project is in maintenance. If so only administrator could access.

 

Name of the Parameter: PROJECT_IN_MAINTENANCE

 

We will insert code into the CanLogin to verify if there is the name of the project in the parameter value. In this case, if user is not the administrator, the function will return False and a warning window will show the message.

 

 

Function CanLogin(DomainName, ProjectName, UserName)

On Error Resume Next

Dim Res

Res = True

 

'Call the function that returns:

'True if the project is in maintenance

'False otherwise

if vidCheckPrjMaintenance then

   msgbox "Project in Maintenance", vbExclamation + vbSystemModal, "Access Forbidden"

   Res = False

end if

 

CanLogin = Res

 

On Error Goto 0

End Function

 

 

Function vidCheckPrjMaintenance

On Error Resume Next

 

Dim Res

Res = False

 

'test if inside the parameter value there is the ProjectName
if instr(TDConnection.TDParams("PROJECT_IN_MAINTENANCE"), TDConnection.ProjectName) > 0 then

 'in positive case I check if user is not an administrator.
  if not (User.IsInGroup("TDAdmin")) then
   Res = True
  end if
end if

 

vidCheckPrjMaintenance = Res

 

On Error Goto0

End Function

 

 

 

 

Pag: <<    <    >    >>