Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ns_requestauthorize(3aolserv) [debian man page]

ns_requestauthorize(3aolserver) 			    AOLserver Built-In Commands 			   ns_requestauthorize(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
ns_requestauthorize - commands SYNOPSIS
ns_requestauthorize option ?arg arg ...? _________________________________________________________________ DESCRIPTION
ns_requestauthorize method URL authuser authpassword ?ipaddr? Ask the server to check permissions using nsperm. This function does the same permission check that the AOLserver does before serving a URL. If the nsperm module is loaded, the algorithm is as follows. 1. If the authuser is "nsadmin", the password is correct, and the IP address of the client is allowed nsadmin access, then access is autho- rized. 2. Find the relevant permission record. If an exact match for the method and URL combination is not found, the end of the URL is pared down until a match is found. For example, if there is no match for `/products/cereals/raisin_bran.html,' then the server looks for a permis- sion record for the URL `/products/cereals.' If that permission record is specified as "Exact URL match is NOT required", then that per- mission record is used. By default, the server comes with a row that says GET on `/' is open to the world. If no relevant permission record is found, access is denied (forbidden). 1. If the authuser is in the "Allow Users" list, access is permitted. If the authuser is a member of a group in the "Allow Groups" list and not in the "Deny Users" list, access is permitted. 2. If the host is in the "Hosts to allow" list, access is permitted. If the host is in the "Hosts to deny" list, access is denied. 3. If the request does not come in with authorization data, access is denied. 4. The user and password are verified. If there is no password specified in the database, any password is accepted. 5. Otherwise, access is denied. Return Values: The following values can be returned by ns_requestauthorize. OK The user has permission to execute this URL and method. DENIED The user does not have permission to execute this URL and method. FORBIDDEN There is no possible user/password/IP Address combination that would give authorization. ERROR There was an error. SEE ALSO
ns_passwordcheck, ns_crypt KEYWORDS
AOLserver 4.0 ns_requestauthorize(3aolserver)

Check Out this Related Man Page

Ns_UrlToFile(3aolserver)				   AOLserver Library Procedures 				  Ns_UrlToFile(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_SetUrlToFileProc, Ns_UrlIsDir, Ns_UrlIsFile, Ns_UrlToFile - URL to file mapping procedures SYNOPSIS
#include "ns.h" void Ns_SetUrlToFileProc(char *server, Ns_UrlToFileProc *procPtr) int Ns_UrlIsDir(char *server, char *url) int Ns_UrlIsFile(char *server, char *url) int Ns_UrlToFile(Ns_DString *dsPtr, char *server, char *url) _________________________________________________________________ DESCRIPTION
These functions map URL paths to real files and directories. They are normally used to determine whether a given URL has a corresponding file or directory and to return the real filesystem path that corresponds to the URL. Ns_SetUrlToFileProc(server, procPtr) Set a pointer to a custom routine to use in place of Ns_UrlToFile. Ns_UrlIsDir(server, url) Construct a directory name by appending the URL to the current AOLserver pages directory for the specified server. Return NS_TRUE if the directory exists; NS_FALSE otherwise. Ns_UrlIsFile(server, url) Construct a file name by appending the URL to the current AOLserver pages directory for the specified server. Return NS_TRUE if the file exists and is a regular file; NS_FALSE otherwise. Example: /* IsFile - Simple request to determine if an URL is a file. */ int IsFile(Ns_Conn *conn, void *ctx) { int isfile; char *server; server = Ns_ConnServer(conn); isfile = Ns_UrlIsFile(server, conn->request->url); if (isfile) { Ns_ConnReturnNotice(conn, 200, "File", NULL); } else { Ns_ConnReturnNotice(conn, 200, "Not a File", NULL); } return NS_OK; } Ns_UrlToFile(dsPtr, server, url) The Ns_UrlToFile function writes the full path name of the file corresponding to the given URL. The result is appended to the Ns_DString. The function does not check that the file exists or is readable by the AOLserver process. This function returns a status of NS_OK or NS_ERROR. Normally this prepends the pageroot to the URL path. If you have created your own custom routine and used Ns_SetUrlToFileProc to point to it, your routine is called instead. This could be used to create, for example, a module that takes the given URL and maps it to a file in a different way than the default Ns_UrlToFile routine. Example: /* A simple page fetch request function. */ int SimpleFetch(Ns_Conn *conn, void *ctx) { Ns_DString ds; FILE fp; char *server; Ns_DStringInit(&ds); server = Ns_ConnServer(conn); Ns_UrlToFile(&ds, server, conn->request->url); fp = fopen(ds.string, "r"); Ns_ConnSendOpenFp(conn, fp, -1); fclose(fp); Ns_DStringFree(&ds); return NS_OK; } SEE ALSO
nsd(1), info(n) KEYWORDS
AOLserver 4.0 Ns_UrlToFile(3aolserver)
Man Page