Only import settings if there is a need to

This commit is contained in:
snipe
2016-02-11 12:06:06 -08:00
parent 2d4dee2f72
commit 855b3809d0
@@ -18,8 +18,8 @@ class ImportLdapSettings extends Migration {
// Only update the settings record if there IS an LDAP Config
// AND the Settings table doesn't already have LDAP settings in it
if ((Config::get('ldap.url')) && ($settings->ldap_server=='')) {
if ((Config::get('ldap.url')) && ($settings) && ($settings->ldap_server)) {
$settings->ldap_enabled = 1;
$settings->ldap_server = Config::get('ldap.url');
$settings->ldap_uname = Config::get('ldap.username');