diff --git a/run b/run old mode 100644 new mode 100755 diff --git a/src/LonaDB/Actions/set_variable.php b/src/LonaDB/Actions/set_variable.php index 1ea683e..3454e87 100644 --- a/src/LonaDB/Actions/set_variable.php +++ b/src/LonaDB/Actions/set_variable.php @@ -1,7 +1,7 @@ false, "err" => "bad_table_name", "process" => $data['process']]); socket_write($client, $response); @@ -11,14 +11,14 @@ return new class { $tableName = $data['table']['name']; - if (!$lona->TableManager->GetTable($tableName)) { + if (!$LonaDB->TableManager->GetTable($tableName)) { $response = json_encode(["success" => false, "err" => "table_missing", "process" => $data['process']]); socket_write($client, $response); socket_close($client); return; } - $table = $lona->TableManager->GetTable($tableName); + $table = $LonaDB->TableManager->GetTable($tableName); if (!$table->CheckPermission($data['login']['name'], "write")) { $response = json_encode(["success" => false, "err" => "missing_permissions", "process" => $data['process']]); diff --git a/src/LonaDB/Plugins/PluginManager.php b/src/LonaDB/Plugins/PluginManager.php index 683c161..cd12dd7 100644 --- a/src/LonaDB/Plugins/PluginManager.php +++ b/src/LonaDB/Plugins/PluginManager.php @@ -14,7 +14,7 @@ class PluginManager{ public function __construct(LonaDB $lonaDB) { $this->LonaDB = $lonaDB; - $this->Tables = array(); + $this->Plugins = array(); } public function LoadPlugins () : void { diff --git a/src/LonaDB/Tables/Table.php b/src/LonaDB/Tables/Table.php index 21423b7..a647408 100644 --- a/src/LonaDB/Tables/Table.php +++ b/src/LonaDB/Tables/Table.php @@ -95,8 +95,6 @@ class Table{ } public function CheckPermission(string $user, string $permission) : bool { - $this->LonaDB->Logger->Table("(".$this->file.") Checkin permission '".$permission."' for user '".$user."'"); - if($user === $this->Owner) return true; if($this->LonaDB->UserManager->GetRole($user) === "Administrator" || $this->LonaDB->UserManager->GetRole($user) === "Superuser") return true; if($this->permissions[$user]["admin"]) return true; @@ -106,10 +104,7 @@ class Table{ } public function CheckVariable(string $name, string $user) : bool { - $this->LonaDB->Logger->Table("(".$this->file.") Checkin if variable '".$name."' exists for user '".$user."'"); - if(!$this->CheckPermission($user, 'read')) return false; - if(!$this->data[$name]) return false; return true; }