[Tickets #10245] Identities values disappear after an upgrade from H3

bugs at horde.org bugs at horde.org
Tue Jun 14 14:32:39 UTC 2011


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/10245
------------------------------------------------------------------------------
  Ticket             | 10245
  Created By         | laurent.foucher at iut-tlse3.fr
  Summary            | Identities values disappear after an upgrade from H3
  Queue              | IMP
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


laurent.foucher at iut-tlse3.fr (2011-06-14 14:32) wrote:

Hi,

Upgrading from Horde3 to horde4, the identities values are no more  
considered. To fix this, i have this little script :

$query = "SELECT pref_uid, pref_value FROM horde_prefs WHERE  
pref_scope LIKE 'horde'  AND `pref_name` LIKE 'identities'";

while ($row = mysql_fetch_array($result)) {
         $unserialized = preg_replace('!s:(\d+):"(.*?)";!se',  
"'s:'.strlen('$2').':\"$2\";'", $row['pref_value'] );
         $data    = unserialize($unserialized);

         $pref_uid = $row['pref_uid'];

         $new_data=array();
         foreach ($data as $key => $val)
         {
                 foreach ($data[$key] as $id => $value) {
                         $new_data[$key][$id] = $value ;
                 }
         }
         $new_data[0]['identities'] = 'a:0:{}';
         $new_data[0]['properties'] = '';
         $new_data[0]['location'] = '';

         $new_data_serial = serialize($new_data);

         $query = sprintf("UPDATE horde_prefs SET  
`horde_prefs`.`pref_value` = '%s' WHERE `horde_prefs`.`pref_uid` LIKE  
'$pref_uid' AND `horde_prefs`.`pref_scope` LIKE 'horde' AND  
`horde_prefs`.`pref_name` LIKE 'identities'",
                         mysql_real_escape_string($new_data_serial));

......

I have only had the keys identities, properties and location in the  
horde_prefs.

Maybe could be integrated in the systemlogintask.

Thanks






More information about the bugs mailing list