|
| iMatix home page | << | < | > | >> |
SMTVersion 2.81 |
#include "smtdefn.h" int smtauth_init (void)
Initialises the SMT authorisation agent. Returns 0 if initialised okay, -1 if there was an error. Supports these public methods:
| OPEN | Create a protected url symbol table. |
| REOPEN | Reload authorisation data |
| CHECK URL | Check if a url is protected. |
| CHECK NAME | Check user name and password for a url; returns user name. |
| CLOSE | Free symbol table and end thread. |
{
AGENT *agent; /* Handle for our agent */
THREAD *thread; /* Handle to console thread */
# include "smtauth.i" /* Include dialog interpreter */
/* Method name Event value Priority */
/* Shutdown event comes from Kernel */
method declare (agent, "SHUTDOWN", shutdown_event, SMT_PRIORITY_MAX);
/* Public methods supported by this agent */
method declare (agent, "OPEN", open_event, 0);
method declare (agent, "REOPEN", reopen_event, 0);
method declare (agent, "CHECK_URL", check_url_event, 0);
method declare (agent, "CHECK_NAME", check_name_event, 0);
method declare (agent, "CLOSE", close_event, 0);
/* Ensure that operator console is running, else start it up */
smtoper init ();
if ((thread = thread lookup (SMT_OPERATOR, "")) != NULL)
console = thread-> queue-> qid;
else
return (-1);
/* Signal okay to caller that we initialised okay */
return (0);
}
| | << | < | > | >> |
|