mirror of
https://github.com/civetweb/civetweb
synced 2025-03-28 21:13:27 +00:00
Rename parameter "domain" to "realm", to use the same parameter names
This commit is contained in:
parent
711562d7d1
commit
b06c3f90da
@ -7,7 +7,7 @@
|
||||
| Parameter | Type | Description |
|
||||
| :--- | :--- | :--- |
|
||||
|**`passwords_file_name`**|`const char *`|The path to the passwords file|
|
||||
|**`domain`**|`const char *`|The domain of the user record|
|
||||
|**`realm`**|`const char *`|The authentication realm (domain) of the user record|
|
||||
|**`user`**|`const char *`|Username of the record to be added, changed or deleted|
|
||||
|**`password`**|`const char *`|Password associated with the user or NULL if the record must be deleted|
|
||||
|
||||
|
@ -609,19 +609,25 @@ mg_get_ports(const struct mg_context *ctx, size_t size, int *ports, int *ssl);
|
||||
|
||||
|
||||
/* Add, edit or delete the entry in the passwords file.
|
||||
|
||||
This function allows an application to manipulate .htpasswd files on the
|
||||
fly by adding, deleting and changing user records. This is one of the
|
||||
several ways of implementing authentication on the server side. For another,
|
||||
cookie-based way please refer to the examples/chat in the source tree.
|
||||
|
||||
If password is not NULL, entry is added (or modified if already exists).
|
||||
If password is NULL, entry is deleted.
|
||||
|
||||
Return:
|
||||
1 on success, 0 on error. */
|
||||
*
|
||||
* This function allows an application to manipulate .htpasswd files on the
|
||||
* fly by adding, deleting and changing user records. This is one of the
|
||||
* several ways of implementing authentication on the server side. For another,
|
||||
* cookie-based way please refer to the examples/chat in the source tree.
|
||||
*
|
||||
* Parameter:
|
||||
* passwords_file_name: Path and name of a file storing multiple passwords
|
||||
* realm: HTTP authentication realm (authentication domain) name
|
||||
* user: User name
|
||||
* password:
|
||||
* If password is not NULL, entry modified or added.
|
||||
* If password is NULL, entry is deleted.
|
||||
*
|
||||
* Return:
|
||||
* 1 on success, 0 on error.
|
||||
*/
|
||||
CIVETWEB_API int mg_modify_passwords_file(const char *passwords_file_name,
|
||||
const char *domain,
|
||||
const char *realm,
|
||||
const char *user,
|
||||
const char *password);
|
||||
|
||||
|
1
test/protected/.htpasswd
Normal file
1
test/protected/.htpasswd
Normal file
@ -0,0 +1 @@
|
||||
user:mydomain.com:1aeed57ec85c6126e335a54789c2ecfa
|
5
test/protected/content.txt
Normal file
5
test/protected/content.txt
Normal file
@ -0,0 +1,5 @@
|
||||
Protected directory.
|
||||
|
||||
username: user
|
||||
password: pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user