Index: branches/RC/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r10739 -r10749 --- branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 10739) +++ branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 10749) @@ -971,7 +971,86 @@ $filename= ereg_replace("dump","",$filename); $filename= ereg_replace($ext,"",$filename); return $filename; - } + } + + function PrintPHPinfo($params) + { + ob_start(); + + phpinfo(); + $php_info .= ob_get_contents(); + + ob_end_clean(); + + $php_info = str_replace(" width=\"600\"", " width=\"100%\" align=\"center\"", $php_info); + $php_info = str_replace("", "", $php_info); + $php_info = str_replace("", "", $php_info); + $php_info = str_replace("", "", $php_info); + $php_info = str_replace("", "", $php_info); + $php_info = str_replace("", "", $php_info); + $php_info = str_replace("", "", $php_info); + $offset = strpos($php_info, "Application->GetVar('sql_rows')); + $ret = ''; + $block = $params['render_as']; + foreach ($a_data AS $a_row) + { + foreach ($a_row AS $col => $value) + { + $ret .= $this->Application->ParseBlock(Array('name'=>$block, 'value'=>$col)); + } + break; + } + return $ret; + } + + function PrintSqlRows($params) + { + $a_data = unserialize($this->Application->GetVar('sql_rows')); + $ret = ''; + $block = $params['render_as']; + foreach ($a_data AS $a_row) + { + $cells = ''; + foreach ($a_row AS $col => $value) + { + $cells .= ''.$value.''; + } + $ret .= $this->Application->ParseBlock(Array('name'=>$block, 'cells'=>$cells)); + } + return $ret; + } } + ?> \ No newline at end of file Index: branches/RC/core/units/sections/sections_config.php =================================================================== diff -u -N -r10746 -r10749 --- branches/RC/core/units/sections/sections_config.php (.../sections_config.php) (revision 10746) +++ branches/RC/core/units/sections/sections_config.php (.../sections_config.php) (revision 10749) @@ -299,14 +299,5 @@ 'type' => stTREE, ), - 'in-portal:sql_query' => Array ( - 'parent' => 'in-portal:tools', - 'icon' => 'in-portal:tool_import', - 'label' => 'la_tab_QueryDB', - 'url' => Array ('index_file' => 'tools/sql_query.php', 'pass' => 'm'), - 'permissions' => Array ('view', 'edit'), - 'priority' => 5, - 'type' => stTREE, - ), ), ); \ No newline at end of file Index: branches/RC/core/units/admin/admin_config.php =================================================================== diff -u -N -r10746 -r10749 --- branches/RC/core/units/admin/admin_config.php (.../admin_config.php) (revision 10746) +++ branches/RC/core/units/admin/admin_config.php (.../admin_config.php) (revision 10749) @@ -24,6 +24,7 @@ 'backup' => Array('format' => '!la_performing_backup!'), 'restore' => Array('format' => '!la_performing_restore!'), 'server_info' => Array('format' => '!la_tab_ServerInfo!'), + 'sql_query' => Array('format' => '!la_tab_QueryDB!'), 'no_permissions' => Array('format' => '!la_title_NoPermissions!'), @@ -77,6 +78,17 @@ 'type' => stTREE, ), + 'in-portal:sql_query' => Array ( + 'parent' => 'in-portal:tools', + 'icon' => 'in-portal:tool_import', + 'label' => 'la_tab_QueryDB', + 'url' => Array ('t' => 'tools/sql_query', 'pass' => 'm'), + 'permissions' => Array ('view', 'edit'), + 'priority' => 5, + 'type' => stTREE, + ), + + 'in-portal:server_info' => Array ( 'parent' => 'in-portal:tools', 'icon' => 'in-portal:server_info', Index: branches/RC/kernel/units/sections/sections_config.php =================================================================== diff -u -N -r10746 -r10749 --- branches/RC/kernel/units/sections/sections_config.php (.../sections_config.php) (revision 10746) +++ branches/RC/kernel/units/sections/sections_config.php (.../sections_config.php) (revision 10749) @@ -299,14 +299,5 @@ 'type' => stTREE, ), - 'in-portal:sql_query' => Array ( - 'parent' => 'in-portal:tools', - 'icon' => 'in-portal:tool_import', - 'label' => 'la_tab_QueryDB', - 'url' => Array ('index_file' => 'tools/sql_query.php', 'pass' => 'm'), - 'permissions' => Array ('view', 'edit'), - 'priority' => 5, - 'type' => stTREE, - ), ), ); \ No newline at end of file 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 Index: branches/RC/core/admin_templates/tools/sql_query.tpl =================================================================== diff -u -N --- branches/RC/core/admin_templates/tools/sql_query.tpl (revision 0) +++ branches/RC/core/admin_templates/tools/sql_query.tpl (revision 10749) @@ -0,0 +1,87 @@ + + + + + + + + + + + + + +
+ +
+ + + +"> + + +"> + + + + + + + + "> + + + + + + "> + + + + + + + "> + + + + + + +
+ + + + +
+ +  
+ + + + + + "> + + + + + + + +
+ +
+
:  
:  
+ \ No newline at end of file Index: branches/RC/admin/install/langpacks/english.lang =================================================================== diff -u -N -r10742 -r10749 --- branches/RC/admin/install/langpacks/english.lang (.../english.lang) (revision 10742) +++ branches/RC/admin/install/langpacks/english.lang (.../english.lang) (revision 10749) @@ -8,6 +8,7 @@ QWRkZWQ= QWRkIFRv QWRtaW5pc3RyYXRpdmUgQ29uc29sZQ== + QWZmZWN0ZWQgUm93cw== QWxsb3cgZGVsZXRpbmcgTW9kdWxlIFJvb3QgQ2F0ZWdvcnk= QWx3YXlz YW5k @@ -1268,6 +1269,7 @@ UmV2aWV3cyBQZXIgUGFnZSAoU2hvcnRsaXN0KQ== RXJyb3IgdmVyaWZ5aW5nIHBhc3N3b3Jk UnVubmluZyBRdWVyeQ== + UnVudGltZQ== U2FtcGxlIFRleHQ= U2F2ZQ== U2VhcmNo