<?php
/* Include Files ***************************/
require_once('../db-config.php');
require_once('../inc/lib-compat-class.php');
require_once('../inc/lib-db-class.php');
require_once('../inc/lib-login-class.php');
/*******************************************/
global $rSdb;

$user	= new userManagement();
if(  !$user->_logged_in  )
	die(__('Access denied.','recipeshelf'));

if( ! check_ajax_referer('auto-attribute', false) )
	die('0|'.__('Security Alert: Direct access not permitted!','recipeshelf'));

$q = esc_sql( (string)_rem_magic_quote(($_POST['q']) ) );
	
$sql =  "SELECT object FROM {$rSdb->DBobjects} WHERE type='2' AND object LIKE '%{$q}%' GROUP BY object LIMIT 0,50";
$entries = $rSdb->fetchArr($sql);

if ($entries) :
		foreach ($entries as $entry)
			echo "{$entry->object}\n";
endif;

?>