
user_db.pl -- User administration
Core user administration. The user administration is based on the following:
- A persistent fact user/2
- A dynamic fact logged_in/4
- Session management
set_user_database(+File) is det
- Load user/2 from File. Changes are fully synchronous.
user_add(+Name, +Properties) is det
- Add a new user with given properties.
user_del(+Name)
- Delete named user from user-database.
set_user_property(+Name, +Property) is det
- Replace Property for user Name.
openid_add_server(+Server, +Options)
- Register an OpenID server.
openid_del_server(+Server)
- Delete registration of an OpenID server.
openid_set_property(+Server, +Property) is det
- Replace Property for OpenID Server
openid_current_server(?Server) is nondet
openid_server_properties(+Server, -Properties) is semidet
- Try find properties for the given server. Note that we generally refer to a server using its domain. The actual server may be a path on the server or a machine in the domain.
match_server(+ServerURL, +RegisteredURL) is semidet[private]
- True if ServerURL is in the domain of RegisteredURL.
openid_server_property(+Server, +Property) is semidet
- openid_server_property(+Server, -Property) is nondet
- True if OpenID Server has Property.
current_user(?User)
- True if User is a registered user.
user_property(?User, ?Property) is nondet
- user_property(+User, +Property) is semidet
- True if Property is a defined property on User. In addition to
properties explicitely stored with users, we define:
- session(SessionID)
- connection(LoginTime, Idle)
- url(URL)
- Generates reference to our own OpenID server for local login
- openid(OpenID)
- Refers to the official OpenID (possibly delegated)
- openid_server(Server)
- Refers to the OpenID server that validated the login
validate_password(+User, +Password)
- Validate the password for the given user and password.
password_hash(+Password, ?Hash)
- Generate a hash from a password or test a password against a hash. Uses crypt/2. The default hashing is Unix-compatible MD5.
logged_on(-User) is semidet
- True if User is the name of the currently logged in user.
logged_on(-User, +Default) is det
- Get the current user or unify User with Default. Typically,
Default is
anonymous
. ensure_logged_on(-User)
- Make sure we are logged in and return the current user. See openid_user/3 for details.
authorized(+Action) is det
- validate the current user is allowed to perform Action. Throws a permission error if this is not the case. Never fails.
check_permission(+User, +Operation)
- Validate that user is allowed to perform Operation.
denied(+User, +Operation)[private]
- Deny actions to all users but admin. This is a bit of a quick hack to avoid loosing data in a multi-user experiment. Do not yet rely on this,
deny_all_users(+Term)
- Deny some action to all users. See above.
login(+User:atom) is det
- Accept user as a user that has logged on into the current session.
logout(+User) is det
- Logout the specified user
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.