Browse Source

fix: disable wizard configuration endpoint if database already exists

causefx@me.com 1 tháng trước cách đây
mục cha
commit
106cb52a3d
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      api/classes/organizr.class.php

+ 4 - 0
api/classes/organizr.class.php

@@ -3013,6 +3013,10 @@ class Organizr
 
 	public function wizardConfig($array)
 	{
+		if($this->hasConfig() && $this->hasDB()) {
+			$this->setAPIResponse('error', 'Endpoint disabled as database already exists', 401);
+			return false;
+		}
 		$array['driver'] = $array['driver'] ?? 'sqlite3';
 		$driver = $this->formatDatabaseDriver($array['driver']);
 		$dbName = $array['dbName'] ?? null;