18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
48 'is_contextable'=> TRUE,
75 'auth_filter' => Array(
85 'system_type' => Array(
87 'type' =>
'selection',
88 'default' =>
'openldap',
89 'parameters' => Array(
91 'openldap' =>
'OpenLDAP',
92 'activedirectory' =>
'Active Directory',
95 'allow_empty' => FALSE,
98 'ldap_options' => Array(
100 'type' =>
'serialise',
101 'default' => Array(),
105 'type' =>
'selection',
106 'default' =>
'LDAP_DEREF_NEVER',
107 'parameters' => Array(
109 'LDAP_DEREF_NEVER' =>
'Never dereferenced',
110 'LDAP_DEREF_SEARCHING' =>
'Dereferenced during search',
111 'LDAP_DEREF_FINDING' =>
'Dereferenced when locating the base object',
112 'LDAP_DEREF_ALWAYS' =>
'Dereferenced always',
115 'allow_empty' => FALSE,
118 'attributes' => Array(
120 'type' =>
'serialise',
121 'default' => Array(),
123 'user_attributes' => Array(
125 'type' =>
'serialise',
126 'default' => Array(),
128 'user_type' => Array(
130 'type' =>
'selection',
131 'default' =>
'ldap_backend_user',
132 'parameters' => Array(
134 'ldap_backend_user' =>
'Backend User',
135 'ldap_simple_edit_user' =>
'Simple Edit User',
136 'ldap_user' =>
'User',
139 'allow_empty' => FALSE,
157 if (!parent::_upgrade($current_version))
return FALSE;
159 $asset_name = strtoupper($this->_pm->getTypeInfo($this->getAssetType(),
'name'));
161 if (version_compare($current_version,
'0.3',
'<')) {
166 pre_echo(
'STARTING '.$asset_name.
' UPGRADE - TO VERSION 0.3');
167 $pl_ldap_bridges = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids($this->
getAssetType(), FALSE, TRUE);
168 pre_echo(
'Updating '.count($pl_ldap_bridges).
' asset(s)...');
169 foreach ($pl_ldap_bridges as $assetid => $type_code) {
170 $asset =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid, $type_code);
171 if (is_null($asset))
continue;
174 if ($asset->attr(
'system_type') ==
'openldap3') {
175 $asset->setAttrValue(
'system_type',
'openldap');
176 $asset->setAttrValue(
'ldap_options', Array(
'LDAP_OPT_PROTOCOL_VERSION' => 3));
178 $asset->saveAttributes();
181 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
185 pre_echo($asset_name.
' UPGRADE COMPLETE - FROM VERSION '.$current_version.
' TO 0.3');