fluffos/docs/apply/master/valid_database.md

35 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2018-12-30 16:43:04 -08:00
---
title: master / valid_database
---
2023-11-25 09:50:24 -08:00
# valid_database
2018-12-30 16:43:04 -08:00
### NAME
2018-12-30 16:59:01 -08:00
valid_database - protects the database efunctions.
2018-12-30 16:43:04 -08:00
### SYNOPSIS
2018-12-30 16:59:01 -08:00
mixed valid_database( object caller, string function, mixed *info );
2018-12-30 16:43:04 -08:00
### DESCRIPTION
2018-12-30 16:59:01 -08:00
2018-12-30 16:43:04 -08:00
Each of the database efunctions calls valid_database() prior to execut
ing. If valid_database returns 0, then the database efunction fails.
If valid_database returns 1, then the database efunction attempts to
succeed. The first argument 'caller' is the object that called the
database efunction. The second argument is the name of the database
efunction that is being called (e.g. db_connect() or db_commit()). The
third argument, if applicable, is an array of additional information.
Currently this is used for efun::db_connect with the form ({ string
database, string host, string user }) and for efund::dh_exec with the
form ({ string sql_query })
Returns 0 if the use of the efun is to be disallowed, for efun::db_con
nect it should return the password to be used for the connect and 1
otherwise
### SEE ALSO
2018-12-30 16:59:01 -08:00
db_connect(3), db_exec(3)