N°4332 - Fix table name

This commit is contained in:
Eric Espie
2021-09-29 11:30:07 +02:00
parent 142699c3b1
commit dade45308c

View File

@@ -71,11 +71,9 @@ class AuthentLDAPInstaller extends ModuleInstallerAPI
public static function AfterDataLoad(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
{
// Create missing table entries
$sTablePrefix = $oConfiguration->Get('db_subname');
if (strlen($sTablePrefix) != 0) {
$sTablePrefix .= '.';
}
$sSQL = "insert into {$sTablePrefix}priv_user_ldap (id) select U.id from {$sTablePrefix}priv_user as U left join {$sTablePrefix}priv_user_ldap as L on U.id = L.id where U.finalclass='UserLDAP' and isnull(L.id);";
$sUserLDAPTable = MetaModel::DBGetTable('UserLDAP');
$sUserTable = MetaModel::DBGetTable('User');
$sSQL = "insert into $sUserLDAPTable (id) select U.id from $sUserTable as U left join $sUserLDAPTable as L on U.id = L.id where U.finalclass='UserLDAP' and isnull(L.id);";
CMDBSource::Query($sSQL);
}
}