| 1 | rodolico | 1 | <?php
 | 
        
           |  |  | 2 |   | 
        
           | 36 | rodolico | 3 |    // add php_library_v2 to include path. This assumes it is a subdirectory of the directory the config file is in
 | 
        
           |  |  | 4 |    ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . realpath( __DIR__ . '/php_library_v2' ) ); 
 | 
        
           | 44 | rodolico | 5 |    // add php_users to include path. This assumes it is a subdirectory of the directory the config file is in
 | 
        
           |  |  | 6 |    ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . realpath( __DIR__ . '/php_users' ) ); 
 | 
        
           | 1 | rodolico | 7 |   | 
        
           | 43 | rodolico | 8 |    global $configuration;
 | 
        
           |  |  | 9 |    $configuration = yaml_parse_file( './camp2_config.yaml' );
 | 
        
           | 1 | rodolico | 10 |   | 
        
           | 45 | rodolico | 11 |    // fields for the Users class, adds where_clause, a TEXT object
 | 
        
           |  |  | 12 |    global $customFields = array( 
 | 
        
           |  |  | 13 |       'tables' => array(
 | 
        
           |  |  | 14 |          'users' => array(
 | 
        
           |  |  | 15 |             'fields' => array(
 | 
        
           |  |  | 16 |                'where_clause' => array(
 | 
        
           |  |  | 17 |                   // For Users class
 | 
        
           |  |  | 18 |                      // this will be the display label on the form
 | 
        
           |  |  | 19 |                      'label'  => 'Limit via SQL where clause',
 | 
        
           |  |  | 20 |                      // the input type to use for data entry
 | 
        
           |  |  | 21 |                      'html type' => 'textarea',
 | 
        
           |  |  | 22 |                      // you can only edit this if an admin and changing someone
 | 
        
           |  |  | 23 |                      // else' record
 | 
        
           |  |  | 24 |                      'restrict' => true,
 | 
        
           |  |  | 25 |                      // will be displayed on a hover in HTML5 (ie, title=)
 | 
        
           |  |  | 26 |                      'instructions' => 'This will be added to every SQL query to limit access, or 1=1 for everything',
 | 
        
           |  |  | 27 |                      // this is entered in an empty box, ie placeholder=
 | 
        
           |  |  | 28 |                      'hint'     => 'Enter an SQL where clause',
 | 
        
           |  |  | 29 |                      // for Data Source
 | 
        
           |  |  | 30 |                      'dbColumn'  =>  'where_clause',
 | 
        
           |  |  | 31 |                      // actual mySQL column type
 | 
        
           |  |  | 32 |                      'type'      => 'text',
 | 
        
           |  |  | 33 |                      // set it to not null if we build the table ourselves
 | 
        
           |  |  | 34 |                      'required'  => false,
 | 
        
           |  |  | 35 |                      // set a default value
 | 
        
           |  |  | 36 |                      'default'   => '1=1'
 | 
        
           |  |  | 37 |                      )
 | 
        
           |  |  | 38 |                   )
 | 
        
           |  |  | 39 |                )
 | 
        
           |  |  | 40 |             )
 | 
        
           |  |  | 41 |       );
 | 
        
           |  |  | 42 |   | 
        
           |  |  | 43 |   | 
        
           | 1 | rodolico | 44 | ?>
 |