This took an ungodly long amount of time to debug as the cause of issues frontend.

This commit is contained in:
Dane Everitt 2016-01-22 21:43:50 -05:00
parent 32b6bfbbe5
commit ae843a72c6

View file

@ -121,7 +121,9 @@ class Server extends Model
}
/**
* Returns a single server specified by UUID
* Returns a single server specified by UUID.
* DO NOT USE THIS TO MODIFY SERVER DETAILS OR SAVE THOSE DETAILS.
* YOU WILL OVERWRITE THE SECRET KEY AND BREAK THINGS.
*
* @param string $uuid The Short-UUID of the server to return an object about.
* @return \Illuminate\Database\Eloquent\Collection
@ -147,17 +149,6 @@ class Server extends Model
$result->daemonSecret = self::getUserDaemonSecret($result);
}
// Prevent saving of model called in this manner.
// Prevents accidental overwrite of main daemon secret.
$result::saving(function () {
return false;
});
// Prevent deleting this model call.
$result::deleting(function () {
return false;
});
self::$serverUUIDInstance[$uuid] = $result;
return self::$serverUUIDInstance[$uuid];