mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Update ad_append_domain setting for backwards-compatibility with v4 and earlier
This commit is contained in:
parent
139c874308
commit
6e9f36be58
|
@ -3,6 +3,7 @@
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use App\Models\Setting;
|
||||||
|
|
||||||
class AddAdAppendDomainSettings extends Migration
|
class AddAdAppendDomainSettings extends Migration
|
||||||
{
|
{
|
||||||
|
@ -16,7 +17,13 @@ class AddAdAppendDomainSettings extends Migration
|
||||||
Schema::table('settings', function (Blueprint $table) {
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
$table->boolean('ad_append_domain')->nullable(false)->default('0');
|
$table->boolean('ad_append_domain')->nullable(false)->default('0');
|
||||||
});
|
});
|
||||||
}
|
$s = Setting::first(); // we are deliberately *not* using the ::getSettings() method, as it caches things, and our Settings table is being migrated right now
|
||||||
|
\Log::info("is ad? ".($s->is_ad)." is enabled? ".($s->ldap_enabled)." ad_domain? ".($s->ad_domain));
|
||||||
|
if($s->is_ad && $s->ldap_enabled && $s->ad_domain) { //backwards-compatibility setting; < v5 always appended AD Domains
|
||||||
|
$s->ad_append_domain = 1;
|
||||||
|
$s->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
|
|
Loading…
Reference in a new issue