<?php

	// Check nonce
	PHPCUS_PARAM::CUS_REQUIRES_NONCE();
	
	// Check Array Input
	PHPCUS_PARAM::CUS_DOES_NOT_SUPPORT_ARRAY();
	
	// Check already authenticated
	PHPCUS_PARAM::CUS_REQUIRES_AUTHENTICATION();

		Try
		{
		
			// Execute Stored Procedure
			$DATA_SET = PHPCUS_Account_Member::CUS_GET(PHPCUS_Account_Login_Session::$SESSION_AUTHENTICATED_ACCOUNT_ID);
			
			// Return JSON response
			if(empty($DATA_SET) === False)
			{
				if(isset($DATA_SET[0]['ACCOUNT_PASSWORD']) === true)
				{
					Unset($DATA_SET[0]['ACCOUNT_PASSWORD']);
				}
				if(isset($DATA_SET[0]['ACC_ACCOUNT_PASSWORD']) === true)
				{
				    Unset($DATA_SET[0]['ACC_ACCOUNT_PASSWORD']);
				}
				
				/*
				if(empty(PHPCUS_Account_Login_Session::$SESSION_AUTHENTICATED_ACCESS_RIGHTS))
				{
				    $ARR_INDEX = 0;
				    while(PHPCUS_Account_Login_Session::$SESSION_AUTHENTICATED_ACCESS_RIGHTS.length > $ARR_INDEX)
				    {
				        PHPCUS_Account_Login_Session::$SESSION_AUTHENTICATED_ACCESS_RIGHTS[$ARR_INDEX][''] . ':' .
				        PHPCUS_Account_Login_Session::$SESSION_AUTHENTICATED_ACCESS_RIGHTS[$ARR_INDEX]['']
				        $ARR_INDEX ++;
				    }
				}
				*/
				
				$DATA_SET['YOUR_IP'] = PHPRC_APP::REF_IP_INFO();
				$DATA_SET['YOUR_AR'] =  PHPCUS_Account_Login_Session::$SESSION_AUTHENTICATED_ACCESS_RIGHTS;
				PHPCUS_PARAM::CUS_JSON_SUCCESS($DATA_SET);
			}
			else
			{
				PHPCUS_PARAM::CUS_JSON_SUCCESS('');
			}
			
		}
		Catch(Exception $ERR)
		{
			PHPVC_LOG::VAR_REPORT_ERROR($ERR, 0);
			PHPCUS_PARAM::CUS_JSON_ERROR($ERR->getMessage());
		}

?>