<?xml version="1.0"?>
<?xml-stylesheet 
 href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/7975/bug">
    <title>PEAR Bug #7975</title>
    <link>http://pear.php.net/bugs/7975</link>
    <description>[Closed] update of auth_user_id not possible in liveuser_perm_users table</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7975"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7975/2006-08-07+16%3A40%3A05#2006-08-07+16%3A40%3A05"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7975/2006-06-25+12%3A52%3A16#2006-06-25+12%3A52%3A16"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7975/2006-06-25+12%3A40%3A10#2006-06-25+12%3A40%3A10"/>
     </rdf:Seq>
    </items>
  </channel>
    <item rdf:about="http://pear.php.net/bugs/7975">
      <title>mahono</title>
      <link>http://pear.php.net/bugs/7975</link>
      <description><![CDATA[<pre>LiveUser_Admin Bug
Reported by mahono
2006-06-23T17:12:24-00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
Unfortunately it is not possible to update the auth_user_id using $admin-&gt;updateUser($data, $perm_user_id)

Only the perm_type is updated.

Once I change an auth_user_id, the user disappears because the join/mapping fails.

Test script:
---------------
I suggest changing the end of updateUser() after ($result===true) check this way (tested and works as expected):


if (is_null($type) &amp;&amp; !array_key_exists('auth_user_id', $data)) {
    return true;
}

$updateData = array();
if ($type) {
    $updateData['perm_type'] = $type;
}
if (array_key_exists('auth_user_id', $data)
    &amp;&amp; $permData['auth_user_id'] != $data['auth_user_id']
) {
    $updateData['auth_user_id'] = $data['auth_user_id'];
}

$filters = array('perm_user_id' =&gt; $permUserId);
return $this-&gt;perm-&gt;updateUser($updateData, $filters);</pre>]]></description>
      <content:encoded><![CDATA[<pre>LiveUser_Admin Bug
Reported by mahono
2006-06-23T17:12:24-00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
Unfortunately it is not possible to update the auth_user_id using $admin-&gt;updateUser($data, $perm_user_id)

Only the perm_type is updated.

Once I change an auth_user_id, the user disappears because the join/mapping fails.

Test script:
---------------
I suggest changing the end of updateUser() after ($result===true) check this way (tested and works as expected):


if (is_null($type) &amp;&amp; !array_key_exists('auth_user_id', $data)) {
    return true;
}

$updateData = array();
if ($type) {
    $updateData['perm_type'] = $type;
}
if (array_key_exists('auth_user_id', $data)
    &amp;&amp; $permData['auth_user_id'] != $data['auth_user_id']
) {
    $updateData['auth_user_id'] = $data['auth_user_id'];
}

$filters = array('perm_user_id' =&gt; $permUserId);
return $this-&gt;perm-&gt;updateUser($updateData, $filters);</pre>]]></content:encoded>
      <dc:date>2006-06-23T17:12:24-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7975/2006-08-07+16%3A40%3A05#2006-08-07+16%3A40%3A05">
      <title>lsmith [2006-08-07 20:40]</title>
      <link>http://pear.php.net/bugs/7975#1154983205</link>
      <description><![CDATA[<pre>This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.</pre>]]></description>
      <content:encoded><![CDATA[<pre>This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.</pre>]]></content:encoded>
      <dc:date>2006-08-07T20:40:05-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7975/2006-06-25+12%3A52%3A16#2006-06-25+12%3A52%3A16">
      <title>mahono [2006-06-25 16:52]</title>
      <link>http://pear.php.net/bugs/7975#1151254336</link>
      <description><![CDATA[<pre>ok, I think best will be to remove the if (is_null($type) &amp;&amp; ...) block (first 4 lines in my code) and insert these lines before the line &quot;$filters = array(...&quot;:

if (count($updateData) == 0) {
    return true;
}</pre>]]></description>
      <content:encoded><![CDATA[<pre>ok, I think best will be to remove the if (is_null($type) &amp;&amp; ...) block (first 4 lines in my code) and insert these lines before the line &quot;$filters = array(...&quot;:

if (count($updateData) == 0) {
    return true;
}</pre>]]></content:encoded>
      <dc:date>2006-06-25T16:52:16-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7975/2006-06-25+12%3A40%3A10#2006-06-25+12%3A40%3A10">
      <title>mahono [2006-06-25 16:40]</title>
      <link>http://pear.php.net/bugs/7975#1151253610</link>
      <description><![CDATA[<pre>like I said: it works.. but the check (permData['auth_user_id'] != $data['auth_user_id']) should be moved to the &quot;is_null($type) &amp;&amp; ...&quot; check so the data will really only get updated if auth_user_id changed to avoid the query if not needed.

or simply do a count() check before updateUser() ..?</pre>]]></description>
      <content:encoded><![CDATA[<pre>like I said: it works.. but the check (permData['auth_user_id'] != $data['auth_user_id']) should be moved to the &quot;is_null($type) &amp;&amp; ...&quot; check so the data will really only get updated if auth_user_id changed to avoid the query if not needed.

or simply do a count() check before updateUser() ..?</pre>]]></content:encoded>
      <dc:date>2006-06-25T16:40:10-00:00</dc:date>
    </item>
</rdf:RDF>