title: Vtiger web service "sorry! attempt to access restricted file" response
body: <p>I'm trying to create a lead via a web service request, but I'm getting a "sorry! attempt to access restricted file" response.
  I read that the most likely culprit is a misconfigured $root_directory url in config.inc.php, but mine is correct. The UI works fine.</p>
  
  <p>I can login and obtain a session name via the webservice but it seems like the "create" operation doesn't work.
  Here's the code for the create call:</p>
  
  <pre><code>$lead = array('lastname' =&gt; 'test', 'assigned_user_id' =&gt; '1', 'company' =&gt; 'test');
  
  $objectJson = json_encode($lead);
  $request = new HTTP_Request2($vtiger_url, 'POST');
  $request-&gt;addPostParameter(array(
      'operation' =&gt; 'create',
      'sessionName' =&gt; $sessionName,
      'element' =&gt; $objectJson,
      'elementType' =&gt; 'Leads',
  ));
  </code></pre>
  
  <p>Note that if I change the "elementType" arg to something made up (eg "fskdhfks"), I get an access denied response instead.
  If I don't add a required field to the $lead array, I (correctly) receive a mandatory field missing error in the response so clearly the create operation is getting through.</p>
  
  <p>Not sure how to proceed with troubleshooting this. Thoughts?</p>
  
  <p>Thanks!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After some debugging, I found where the error happens. The lead is never inserted into the database because the following query fails:</p>
  
  <pre><code>Tue Mar  4 04:30:31 2014,751 [13249] INFO VT - PearDatabase -&gt;ADODB error  Query Failed:insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,modifiedby,createdtime,modifiedtime) values(?,?,?,?,?,?,?,?)::-&gt;[1048]Column 'smownerid' cannot be null
  </code></pre>
  
  <p>Someway, somehow the assigned_user_id parameter doesn't get through to that piece of code. The lead's lastname and company fields are there but there is no sign of assigned_user_id.
  Straaange.</p>