18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
56 $res = parent::_upgrade($current_version);
58 if (version_compare($current_version,
'0.2',
'<')) {
59 echo
'UPGRADING LDAP USER GROUP TO v0.2';
61 $bridge_ids = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'ldap_bridge');
62 foreach ($bridge_ids as $bridge_id) {
63 $bridge =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($bridge_id);
64 $groups = $bridge->getChildren($bridge_id);
65 foreach ($groups as $groupid => $type) {
66 if ($type !=
'ldap_user_group')
continue;
67 $asset =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($groupid,
'ldap_user_group');
68 $dn = substr($asset->id, strpos($asset->id,
':') + 1);
69 $old_data_path = $bridge->data_path.
'/'.$dn;
70 $old_data_path_public = $bridge->data_path_public.
'/'.$dn;
71 if (is_dir($old_data_path)) {
72 copy_directory($old_data_path, $asset->data_path);
73 delete_directory($old_data_path);
75 if (is_dir($old_data_path_public)) {
76 copy_directory($old_data_path_public, $asset->data_path_public);
77 delete_directory($old_data_path);