ctrlSess
(controller in module tri
)
Standard controller referenced with ng-controller=ctrlSess on the appropriated HTML div statement.
It is used to manage the authentication of the User before allowing other components to be used.
ctrlSess($scope, $http, servSess, servGAE, servCRUD);
Returns whether a valid session exists (ie. there is a logged in user).
The value returned is obtained by forwarding the call to servSess.hasSession and returning the value obtained thereby.
{Boolean}
– the value returned by servSess.hasSession
Performs initialization of input from any cached localStorage values for userids(s) and the token value.
If a token value is found it uses the servGAE.validateToken method to see if the token is valid. If so the login is deemed successful and the context is prepared. This includes calling servSess.setSession
If this is the very first time the user has used the system we do a dummy warm-up of the server (incase it is paged out). This means that when he presses the login button the GAE Server will be warmed up. If it is not the first time the validate will do a warmup.
More information concerning the token is found at servGAE.setToken and Server Interface.
Returns whether the current section is sSect
The value returned is obtained by forwarding the call to servSess.isSect and returning the value obtained thereby.
sSect – {String} –
the section to test for
{Boolean}
– the value returned by servSess.isSect
Performs the login functionality for a user in concert with the HTML sections to obtain the User information (Userid & password).
It ensures that the required fields are provided.
When sufficient data is entered the functions servSess.setUser and servGAE.login are used to perform the login and prepare the context.
If the login fails the controller informs the user via a message.
sDbl – {string} –
'DOUBLE' if double login required
Current error message or null.
Set during a login attempt as input fields are edited.