LDAP: on upgrade set homeDirs of users where it is not set. Avoids new folders (empty), depending on the configuration

This commit is contained in:
Arthur Schiwon 2012-08-30 14:54:52 +02:00
parent f2534e7428
commit 2440e500b8
2 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,7 @@ $groupBE = new \OCA\user_ldap\GROUP_LDAP();
$groupBE->setConnector($connector);
foreach($objects as $object) {
$fetchDNSql = 'SELECT `ldap_dn` FROM `*PREFIX*ldap_'.$object.'_mapping`';
$fetchDNSql = 'SELECT `ldap_dn`, `owncloud_name` FROM `*PREFIX*ldap_'.$object.'_mapping`';
$updateSql = 'UPDATE `*PREFIX*ldap_'.$object.'_mapping` SET `ldap_DN` = ?, `directory_uuid` = ? WHERE `ldap_dn` = ?';
$query = OCP\DB::prepare($fetchDNSql);
@ -45,6 +45,8 @@ foreach($objects as $object) {
$newDN = mb_strtolower($dn['ldap_dn'], 'UTF-8');
if($object == 'user') {
$uuid = $userBE->getUUID($newDN);
//fix home folder to avoid new ones depending on the configuration
$userBE->getHome($dn['owncloud_name']);
} else {
$uuid = $groupBE->getUUID($newDN);
}

View File

@ -1 +1 @@
0.2.0.26
0.2.0.28