array(
'users' => array(
'fields' => array(
'where_clause' => array(
// For Users class
// this will be the display label on the form
'label' => 'Limit via SQL where clause',
// the input type to use for data entry
'html type' => 'textarea',
// you can only edit this if an admin and changing someone
// else' record
'restrict' => true,
// will be displayed on a hover in HTML5 (ie, title=)
'instructions' => 'This will be added to every SQL query to limit access, or 1=1 for everything',
// this is entered in an empty box, ie placeholder=
'hint' => 'Enter an SQL where clause',
// for Data Source
'dbColumn' => 'where_clause',
// actual mySQL column type
'type' => 'text',
// set it to not null if we build the table ourselves
'required' => false
)
)
)
)
);
$connection = new usersDataSource(
null,
$customFields,
array( 'username' => 'test', 'password' => 'test', 'database' => 'test' )
);
// ensure we always have a (possibly invalid) instance of user
if ( ! isset( $_SESSION['user'] ) ) {
//print "Creating session users
";
$_SESSION['user'] = new Users( $customFields );
}
if ( isset( $_REQUEST['logout'] ) )
$_SESSION['user']->logout();
$url = htmlentities($_SERVER["PHP_SELF"]);
?>
' . print_r( $_REQUEST, true ) . "\n"; ?>