Ejemplo n.º 1
0
Archivo: data.php Proyecto: horde/horde
        foreach ($contact_groups as $group) {
            $attributes = $group;
            unset($attributes['__members']);
            $group_obj = new Turba_Object_Group($driver, $attributes);
            foreach (explode(',', $group['__members']) as $uid) {
                $results = $driver->search(array('__uid' => $uid));
                if (count($results->objects)) {
                    $object = array_pop($results->objects);
                    $group_obj->addMember($object->getValue('__key'), $object->getSource());
                }
            }
            // We don't actually use the group object to save to storage since
            // it's not an existing group. We use it so it's responsible for
            // properly formatting the __members data, which we pull out and
            // place in the attributes array.
            $attributes['__members'] = $group_obj->getValue('__members');
            $attributes['__type'] = 'group';
            $driver->add($attributes);
        }
        if (!$error && $imported) {
            $notification->push(sprintf(_("%s file successfully imported."), $file_types[$data->storage->get('format')]), 'horde.success');
        }
    }
    $next_step = $data->cleanup();
}
switch ($next_step) {
    case Horde_Data::IMPORT_MAPPED:
    case Horde_Data::IMPORT_DATETIME:
        foreach ($cfgSources[$data->storage->get('target')]['map'] as $field => $null) {
            if (substr($field, 0, 2) != '__' && !is_array($null) || ($field == '__uid' || $field == '__members')) {
                if ($field == '__uid') {