Ver código fonte

updated code from biall

Piotr Labudda 9 anos atrás
pai
commit
74997fb784
2 arquivos alterados com 8 adições e 7 exclusões
  1. 1 0
      SE/se-lib/Core/Database/Mysql.php
  2. 7 7
      SE/se-lib/Route/Debug.php

+ 1 - 0
SE/se-lib/Core/Database/Mysql.php

@@ -466,6 +466,7 @@ class Core_Database_Mysql extends Core_Database {
 
 		$primaryKey = V::geti($primary, '', $sql_obj);
 		if ($primaryKey <= 0) {
+			DBG::log(['msg'=>"Missing primary key '{$primary}' in table '{$table}'!", '$sql_obj'=>$sql_obj]);
 			$this->_set_error("Missing primary key '{$primary}' in table '{$table}'!");
 			return -3;
 		}

+ 7 - 7
SE/se-lib/Route/Debug.php

@@ -11,13 +11,13 @@ Lib::loadClass('RouteBase');
 class Route_Debug extends RouteBase {
 
   public function handleAuth() {
-		if (!User::logged()) {
+    if (!User::logged()) {
       throw new HttpException('Unauthorized', 401);
-		}
-		if (!User::hasAccess('dbg')) {// User::get('ADM_ADMIN_LEVEL') == 0
+    }
+    if (!User::hasAccess('dbg')) {// User::get('ADM_ADMIN_LEVEL') == 0
       throw new HttpException('Unauthorized - required dbg access', 401);
-		}
-	}
+    }
+  }
 
   public function defaultAction() {
     session_write_close();
@@ -25,8 +25,8 @@ class Route_Debug extends RouteBase {
   }
 
   public function defaultView($flashMsg = '') {
-		UI::gora();
-		UI::menu();
+    UI::gora();
+    UI::menu();
     UI::setTitle("Debug");
     try {
       echo UI::h('h1', [], [