summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Mapping
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-02-17 18:45:33 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-02-17 18:45:33 +0100
commit497ee3e3e64a07c1684f4ec87aa7621d743c37e6 (patch)
tree538d5ee36d20caff89605b86d3ae506afccf7a09 /apps/user_ldap/lib/Mapping
parent45615cc940acce6ddab4c84b8f0fd38299125f37 (diff)
downloadnextcloud-server-497ee3e3e64a07c1684f4ec87aa7621d743c37e6.tar.gz
nextcloud-server-497ee3e3e64a07c1684f4ec87aa7621d743c37e6.zip
Add repair steps
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/Mapping')
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 6fb4a5436c3..755cfadbccd 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -129,6 +129,25 @@ abstract class AbstractMapping {
}
/**
+ * Updates the UUID based on the given DN
+ *
+ * required by Migration/UUIDFix
+ *
+ * @param $uuid
+ * @param $fdn
+ * @return bool
+ */
+ public function setUUIDbyDN($uuid, $fdn) {
+ $query = $this->dbc->prepare('
+ UPDATE `' . $this->getTableName() . '`
+ SET `directory_uuid` = ?
+ WHERE `ldap_dn` = ?
+ ');
+
+ return $this->modify($query, [$uuid, $fdn]);
+ }
+
+ /**
* Gets the name based on the provided LDAP DN.
* @param string $fdn
* @return string|false