<?php
	include('inc/class.uFlex.php');
	
	//Instantiate the uFlex object
	$user = new uFlex(false);
	
	//get directory to this file and return everything before html/
	//GoDaddy// --> $webroot = '/home/content/43/4063043/html/microcooltool/settings';
    //SiteGround// --> $webroot = '/home/wlv18548/public_html/microcooling.com/microcooltool/settings';
    //StudioGreen// --> 
    $webroot = '/home/microcoo/public_html/microcooltool/settings';

	//load the ini file
	$settings = parse_ini_file( $webroot.'/microcooltool.ini', true );

	//Add database credentials and information 
	$user->db['host'] = $settings['db']['dns']; 
	$user->db['user'] = $settings['db']['user'];
	$user->db['pass'] = $settings['db']['pass'];
	$user->db['name'] = $settings['db']['name'];; //Database name
	
	$user->opt['table_name'] = "usr_users";
	
	//Add web admin details and information
	$user->wb_admin['admin_email'] = $settings['admin']['email'];
	$user->wb_admin['admin_name'] = $settings['admin']['name'];
	$user->wb_admin['site_url'] = $settings['site']['dns'].$settings['site']['sub_folder'];
	$user->wb_admin['site_name'] = $settings['site']['name'];
	$user->wb_admin['newUserNotifyEmail'] = $settings['admin']['newUserNotifyEmail'];
	
	
	//Add constant contact information
	$user->cc_settings['api_key']  = $settings['constantcontact']['api_key'];
	$user->cc_settings['secret']  = $settings['constantcontact']['secret'];
	$user->cc_settings['access_token'] = $settings['constantcontact']['access_token'];
	$user->cc_settings['list_id'] = $settings['constantcontact']['list_id'];
	
	
	
	/*
	 * Instead of editing the class.uFlex.php file directly you may make
	 * the changes in this space before running the ->start() command.
	 * For example: if want to to change the default username from "Guess"
	 * to "Stranger" you do this:
	 * 
	 * 		$user->opt["default_user"]["username"] = "Stranger";
	 * 
	 * You may change and customize all the options and configurations like
	 * this, even the error messages. By exporting your customizations outside
	 * the class file it will be easier to maintain your application configuration
	 * and update the class core itself in the future. Just remember to start
	 * the object with the first parameter 'false', new uFlex(false), to halt
	 * the object construction.
	 */
		
	//Starts the object by triggering the constructor
	$user->start();
	
	include('inc/functions.php');
	
?>
