Index: branches/RC/core/units/admin/admin_events_handler.php =================================================================== diff -u -N -r10741 -r10749 --- branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 10741) +++ branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 10749) @@ -1052,5 +1052,49 @@ } + /** + * Starts restore process + * + * @param kEvent $event + */ + function OnSqlQuery(&$event) + { + $sql = $this->Application->GetVar('sql'); + if ($sql) { + $start = $this->getMoment(); + $result = $this->Conn->Query($sql); + $this->Application->SetVar('sql_time', $this->getMoment() - $start); + + + if ($result) + { + if (is_array($result)) + { + $this->Application->SetVar('sql_has_rows', 1); + $this->Application->SetVar('sql_rows', serialize($result)); + } + } + + $check_sql = trim(strtolower($sql)); + if ( + (substr($check_sql, 0, 6) == 'insert') + || (substr($check_sql, 0, 6) == 'update') + || (substr($check_sql, 0, 7) == 'replace') + || (substr($check_sql, 0, 6) == 'delete') + ) { + $this->Application->SetVar('sql_has_affected', 1); + $this->Application->SetVar('sql_affected', $this->Conn->getAffectedRows()); + } + + } + $this->Application->SetVar('query_status', 1); + $event->status = erFAIL; + } + + function getMoment() + { + list($usec, $sec) = explode(' ', microtime()); + return ((float)$usec + (float)$sec); + } } \ No newline at end of file