| Description | The http_get_user_id retrieves the user identification number, when the web pages are protected with user authentication. It can be used to generate a web page, whose content is based on the connected user. This function is normally called from the cgi_func function. The http_get_user_id is a system function that is in the RL-TCPnet library. The prototype is defined in net_config.h. note - This function returns a value of 0 for system administrator account.
|
| Example |
U16 cgi_func (U8 *env, U8 *buf, U16 buflen, U32 *pcgi) {
U8 uid;
..
case 'd':
/* System password - file 'system.cgi' */
switch (env[2]) {
case '0':
/* Display the user name on web page. */
uid = http_get_user_id ();
len = sprintf((char *)buf,(const char *)&env[4],
(uid == 0) ? "admin" : users[uid-1]);
break;
case '1':
..
break;
}
break;
..
}
|