Merge pull request #58 from cytopia/release-0.9

Release 0.9
This commit is contained in:
cytopia 2017-05-21 22:37:28 +02:00 committed by GitHub
commit 0c643f3632
316 changed files with 7155 additions and 3867 deletions

View File

@ -1,30 +0,0 @@
#!/usr/bin/env php
<?php
// TODO: logpath could also be passed via CMD argument
// so this script could be more general
$path = '/var/log/apache-2.2';
$fh_timeout = 30; // 30 sek.
$fd = fopen('php://stdin', 'r');
while (!feof($fd)) {
$row = fgets($fd);
list($vhost, $h, $l, $u, $t, $r, $s, $b, $referrer, $ua) = explode(';', $row, 10);
if (!isset(${$vhost})) {
${$vhost} = fopen($path . '/' . $vhost . '_access.log', 'a+');
}
$lastwrite[$vhost] = time();
fputs(${$vhost}, "$h $l $u $t $r $s $b $referrer $ua");
foreach ($lastwrite as $vhost => $time) {
if ((time() - ($time + 30)) >= 0) {
fclose(${$vhost});
unset(${$vhost});
unset($lastwrite[$vhost]);
}
}
}

View File

@ -1,30 +0,0 @@
#!/usr/bin/env php
<?php
// TODO: logpath could also be passed via CMD argument
// so this script could be more general
$path = '/var/log/apache-2.4';
$fh_timeout = 30; // 30 sek.
$fd = fopen('php://stdin', 'r');
while (!feof($fd)) {
$row = fgets($fd);
list($vhost, $h, $l, $u, $t, $r, $s, $b, $referrer, $ua) = explode(';', $row, 10);
if (!isset(${$vhost})) {
${$vhost} = fopen($path . '/' . $vhost . '_access.log', 'a+');
}
$lastwrite[$vhost] = time();
fputs(${$vhost}, "$h $l $u $t $r $s $b $referrer $ua");
foreach ($lastwrite as $vhost => $time) {
if ((time() - ($time + 30)) >= 0) {
fclose(${$vhost});
unset(${$vhost});
unset($lastwrite[$vhost]);
}
}
}

View File

@ -3,4 +3,4 @@
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5-fcgi
Alias /php5-fcgi /usr/local/bin/php-fcgi
FastCgiExternalServer /usr/local/bin/php-fcgi -host 172.16.238.11:9000 -pass-header Authorization
FastCgiExternalServer /usr/local/bin/php-fcgi -host php:9000 -pass-header Authorization

View File

@ -5,10 +5,14 @@ NameVirtualHost *:80
<VirtualHost _default_:80>
ServerName localhost
ServerAlias 127.0.0.1
ServerAlias 172.16.238.*
ServerAlias httpd
ServerAdmin root@localhost
ErrorLog /var/log/apache-2.2/localhost-error.log
CustomLog /var/log/apache-2.2/localhost-access.log combined
ErrorLog /var/log/apache-2.2/devilbox-error.log
CustomLog /var/log/apache-2.2/devilbox-access.log combined
DirectoryIndex index.php index.html
@ -25,7 +29,12 @@ NameVirtualHost *:80
Order allow,deny
Allow from all
</Directory>
<Location /devilbox-httpd-status>
SetHandler server-status
Order allow,deny
Allow from all
</Location>
</VirtualHost>

View File

@ -8,15 +8,16 @@
UseCanonicalName Off
ServerName localhost
ServerAlias *.loc
ServerAlias *.*
ServerAdmin root@localhost
# splitlogs.php is a custom script, which will filter the domain
# and create separate logfiles per domain.
LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon
CustomLog "|/opt/bin/splitlogs.php" vcommon
# Required for DNS checking
SetEnvIf Origin "http(s)?://(domain1.org|localhost|127.0.0.1|httpd)$" AccessControlAllowOrigin=$0$1
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
ErrorLog /var/log/apache-2.2/other-error.log
LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon
CustomLog "/var/log/apache-2.2/projects-access.log" vcommon
ErrorLog /var/log/apache-2.2/projects-error.log
DirectoryIndex index.php index.html
@ -25,6 +26,9 @@
VirtualDocumentRoot /shared/httpd/%-2+/htdocs/
php_admin_value auto_prepend_file /opt/bin/fix-virtual-docroot.php
# Devilbox API endpoint
Alias "/devilbox-api" "/var/www/default/api/devilbox-api"
<Directory "/shared/httpd/*/htdocs/">
DirectoryIndex index.php index.html
@ -38,6 +42,3 @@
Allow from all
</Directory>
</VirtualHost>

View File

@ -6,12 +6,12 @@
# If you have enough idle workers, this would only improve the performance marginally
#
# enablereuse requires Apache 2.4.11 or later
#<Proxy "fcgi://172.16.238.11:9000/" enablereuse=on max=10></Proxy>
#<Proxy "fcgi://php:9000/" enablereuse=on max=10></Proxy>
<FilesMatch "\.php$">
Require all granted
# Pick one of the following approaches
# Use the standard TCP socket
SetHandler "proxy:fcgi://172.16.238.11:9000"
# If your version of httpd is 2.4.9 or newer (or has the back-ported feature), you can use the unix domain socket
#SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/:9000"
Require all granted
# Pick one of the following approaches
# Use the standard TCP socket
SetHandler "proxy:fcgi://php:9000"
# If your version of httpd is 2.4.9 or newer (or has the back-ported feature), you can use the unix domain socket
#SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/:9000"
</FilesMatch>

View File

@ -5,10 +5,14 @@
<VirtualHost _default_:80>
ServerName localhost
ServerAlias 127.0.0.1
ServerAlias 172.16.238.*
ServerAlias httpd
ServerAdmin root@localhost
ErrorLog /var/log/apache-2.4/localhost-error.log
CustomLog /var/log/apache-2.4/localhost-access.log combined
ErrorLog /var/log/apache-2.4/devilbox-error.log
CustomLog /var/log/apache-2.4/devilbox-access.log combined
DirectoryIndex index.php index.html
@ -26,7 +30,13 @@
Allow from all
Require all granted
</Directory>
<Location /devilbox-httpd-status>
SetHandler server-status
Order allow,deny
Allow from all
Require all granted
</Location>
</VirtualHost>

View File

@ -8,15 +8,16 @@
UseCanonicalName Off
ServerName localhost
ServerAlias *.loc
ServerAlias *.*
ServerAdmin root@localhost
# splitlogs.php is a custom script, which will filter the domain
# and create separate logfiles per domain.
LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon
CustomLog "|/opt/bin/splitlogs.php" vcommon
# Required for DNS checking
SetEnvIf Origin "http(s)?://(domain1.org|localhost|127.0.0.1|httpd)$" AccessControlAllowOrigin=$0$1
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
ErrorLog /var/log/apache-2.4/other-error.log
LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon
CustomLog "/var/log/apache-2.4/projects-access.log" vcommon
ErrorLog /var/log/apache-2.4/projects-error.log
DirectoryIndex index.php index.html
@ -25,6 +26,9 @@
VirtualDocumentRoot /shared/httpd/%-2+/htdocs/
php_admin_value auto_prepend_file /opt/bin/fix-virtual-docroot.php
# Devilbox API endpoint
Alias "/devilbox-api" "/var/www/default/api/devilbox-api"
<Directory "/shared/httpd/*/htdocs/">
DirectoryIndex index.php index.html
@ -39,6 +43,3 @@
Require all granted
</Directory>
</VirtualHost>

View File

View File

@ -1,11 +1,8 @@
access_log /var/log/nginx-mainline/access.log main;
error_log /var/log/nginx-mainline/error.log warn;
charset utf-8;
send_timeout 60;
keepalive_timeout 10;
sendfile on;
sendfile off;
tcp_nopush on;
tcp_nodelay on;

View File

@ -5,14 +5,35 @@
server {
listen 80 default_server;
server_name _;
server_name localhost;
server_name 127.0.0.1;
server_name httpd;
server_name 172.16.238.*;
# Root directive
root /var/www/default/htdocs;
index index.php;
access_log /var/log/nginx-mainline/localhost-access.log main;
error_log /var/log/nginx-mainline/localhost-error.log warn;
access_log /var/log/nginx-mainline/devilbox-access.log main;
error_log /var/log/nginx-mainline/devilbox-error.log warn;
# Devilbox httpd info/status
location /devilbox-httpd-status {
stub_status on;
access_log off;
}
# Devilbox API endpoint
location ~ /devilbox-api/ {
root /var/www/default/api/;
index status.json;
# Allow cross-domain requests to this domain
# Used to validate if client DNS is setup correctly
if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
}
}
# Front-controller pattern as recommended by the nginx docs
location / {
@ -35,7 +56,7 @@ server {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#### FPM Server
fastcgi_pass 172.16.238.11:9000;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;

View File

@ -4,15 +4,27 @@
server {
listen 80;
server_name ~^(?<domain>.+)\.loc$;
server_name ~^(?<domain>.+)\.[a-zA-Z]+$;
# Root directive
root /shared/httpd/$domain/htdocs/;
index index.php;
access_log /var/log/nginx-mainline/$domain-access.log main;
error_log /var/log/nginx-mainline/other-error.log warn;
access_log /var/log/nginx-mainline/projects-access.log main;
error_log /var/log/nginx-mainline/projects-error.log warn;
# Devilbox API endpoint
location ~ /devilbox-api/ {
root /var/www/default/api/;
index status.json;
access_log off;
# Allow cross-domain requests to this domain
# Used to validate if client DNS is setup correctly
if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
}
}
# Front-controller pattern as recommended by the nginx docs
location / {
@ -21,6 +33,7 @@ server {
# PHP FPM
location ~ \.php?$ {
# PHP.INI:
# ---------------------------
# // Find this:
@ -35,14 +48,12 @@ server {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#### SOCKET
fastcgi_pass 172.16.238.11:9000;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {

View File

@ -1,11 +1,8 @@
access_log /var/log/nginx-stable/access.log main;
error_log /var/log/nginx-stable/error.log warn;
charset utf-8;
send_timeout 60;
keepalive_timeout 10;
sendfile on;
sendfile off;
tcp_nopush on;
tcp_nodelay on;

View File

@ -5,14 +5,35 @@
server {
listen 80 default_server;
server_name _;
server_name localhost;
server_name 127.0.0.1;
server_name httpd;
server_name 172.16.238.*;
# Root directive
root /var/www/default/htdocs;
index index.php;
access_log /var/log/nginx-stable/localhost-access.log main;
error_log /var/log/nginx-stable/localhost-error.log warn;
access_log /var/log/nginx-stable/devilbox-access.log main;
error_log /var/log/nginx-stable/devilbox-error.log warn;
# Devilbox httpd info/status
location /devilbox-httpd-status {
stub_status on;
access_log off;
}
# Devilbox API endpoint
location ~ /devilbox-api/ {
root /var/www/default/api/;
index status.json;
# Allow cross-domain requests to this domain
# Used to validate if client DNS is setup correctly
if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
}
}
# Front-controller pattern as recommended by the nginx docs
location / {
@ -35,14 +56,12 @@ server {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#### FPM Server
fastcgi_pass 172.16.238.11:9000;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {

View File

@ -4,15 +4,27 @@
server {
listen 80;
server_name ~^(?<domain>.+)\.loc$;
server_name ~^(?<domain>.+)\.[a-zA-Z]+$;
# Root directive
root /shared/httpd/$domain/htdocs/;
index index.php;
access_log /var/log/nginx-stable/$domain-access.log main;
error_log /var/log/nginx-stable/other-error.log warn;
access_log /var/log/nginx-stable/projects-access.log main;
error_log /var/log/nginx-stable/projects-error.log warn;
# Devilbox API endpoint
location ~ /devilbox-api/ {
root /var/www/default/api/;
index status.json;
access_log off;
# Allow cross-domain requests to this domain
# Used to validate if client DNS is setup correctly
if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
}
}
# Front-controller pattern as recommended by the nginx docs
location / {
@ -21,6 +33,7 @@ server {
# PHP FPM
location ~ \.php?$ {
# PHP.INI:
# ---------------------------
# // Find this:
@ -35,14 +48,12 @@ server {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#### SOCKET
fastcgi_pass 172.16.238.11:9000;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {

View File

@ -0,0 +1 @@
{"success":"true"}

View File

@ -2,104 +2,141 @@
// Measure time
$TIME_START = microtime(true);
// PHP Error reporting
// Turn on all PHP errors
error_reporting(-1);
// Shorten DNS timeouts for gethostbyname in case DNS server is down
putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1');
$DEVILBOX_VERSION = 'v0.9';
$DEVILBOX_DATE = '2017-05-20';
$DEVILBOX_API_PAGE = 'devilbox-api/status.json';
//
// Set Directories
//
$CONF_DIR = dirname(__FILE__);
$INCL_DIR = $CONF_DIR . DIRECTORY_SEPARATOR . 'include';
$LIB_DIR = $INCL_DIR . DIRECTORY_SEPARATOR . 'lib';
$VEN_DIR = $INCL_DIR . DIRECTORY_SEPARATOR . 'vendor';
$LIB_DIR = $CONF_DIR . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR .'lib';
$VEN_DIR = $CONF_DIR . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR .'vendor';
$LOG_DIR = dirname(dirname($CONF_DIR)) . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . 'devilbox';
//
// Load Base classes
//
require $LIB_DIR . DIRECTORY_SEPARATOR . 'container' . DIRECTORY_SEPARATOR .'BaseClass.php';
require $LIB_DIR . DIRECTORY_SEPARATOR . 'container' . DIRECTORY_SEPARATOR .'BaseInterface.php';
/**
* TLD suffix for mass virtual hosts.
*
* This is currently hardcoded and must be changed here
* as well as in the webserver config.
* @var string
*/
$TLD_SUFFIX = 'loc';
//
// Set Docker addresses
//
$HTTPD_HOST_NAME = 'httpd';
$HTTPD_HOST_ADDR = gethostbyname($HTTPD_HOST_NAME);
$DNS_HOST_NAME = 'bind';
$PHP_HOST_NAME = 'php';
$PHP_HOST_ADDR = gethostbyname($PHP_HOST_NAME);
$HTTPD_HOST_NAME = 'httpd';
$MYSQL_HOST_NAME = 'mysql';
$MYSQL_HOST_ADDR = gethostbyname($MYSQL_HOST_NAME);
$PGSQL_HOST_NAME = 'pgsql';
$REDIS_HOST_NAME = 'redis';
$MEMCD_HOST_NAME = 'memcd';
$POSTGRES_HOST_NAME = 'postgres';
$POSTGRES_HOST_ADDR = gethostbyname($POSTGRES_HOST_NAME);
//
// Lazy Loader
// Lazy Container Loader
//
function loadFile($class, $base_path) {
static $_LOADED_FILE;
if (isset($_LOADED_FILE[$class])) {
return;
}
require $base_path . DIRECTORY_SEPARATOR . $class . '.php';
$_LOADED_FILE[$class] = true;
return;
}
function loadClass($class) {
global $MYSQL_HOST_ADDR;
global $POSTGRES_HOST_ADDR;
static $_LOADED_LIBS;
$LIB_DIR = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'lib';
if (isset($_LOADED_LIBS[$class])) {
return $_LOADED_LIBS[$class];
} else {
switch($class) {
$lib_dir = $GLOBALS['LIB_DIR'];
$cnt_dir = $GLOBALS['LIB_DIR'] . DIRECTORY_SEPARATOR . 'container';
switch($class) {
//
// Lib Classes
//
case 'Logger':
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
loadFile($class, $lib_dir);
$_LOADED_LIBS[$class] = \devilbox\Logger::getInstance();
break;
case 'Docker':
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
$_LOADED_LIBS[$class] = \devilbox\Docker::getInstance();
case 'Html':
loadFile($class, $lib_dir);
$_LOADED_LIBS[$class] = \devilbox\Html::getInstance();
break;
case 'Helper':
loadFile($class, $lib_dir);
$_LOADED_LIBS[$class] = \devilbox\Helper::getInstance();
break;
//
// Docker Container Classes
//
case 'Php':
loadFile($class, $cnt_dir);
$_LOADED_LIBS[$class] = \devilbox\Php::getInstance($GLOBALS['PHP_HOST_NAME']);
break;
case 'Dns':
loadFile($class, $cnt_dir);
$_LOADED_LIBS[$class] = \devilbox\Dns::getInstance($GLOBALS['DNS_HOST_NAME']);
break;
case 'Httpd':
loadFile($class, $cnt_dir);
$_LOADED_LIBS[$class] = \devilbox\Httpd::getInstance($GLOBALS['HTTPD_HOST_NAME']);
break;
case 'Mysql':
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
$Docker = loadClass('Docker');
$_LOADED_LIBS[$class] = \devilbox\Mysql::getInstance('root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR);
loadFile($class, $cnt_dir);
$_LOADED_LIBS[$class] = \devilbox\Mysql::getInstance($GLOBALS['MYSQL_HOST_NAME'], array(
'user' => 'root',
'pass' => loadClass('Helper')->getEnv('MYSQL_ROOT_PASSWORD')
));
break;
case 'Postgres':
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
$Docker = loadClass('Docker');
$_LOADED_LIBS[$class] = \devilbox\Postgres::getInstance($Docker->getEnv('POSTGRES_USER'), $Docker->getEnv('POSTGRES_PASSWORD'), $POSTGRES_HOST_ADDR);
case 'Pgsql':
loadFile($class, $cnt_dir);
$_LOADED_LIBS[$class] = \devilbox\Pgsql::getInstance($GLOBALS['PGSQL_HOST_NAME'], array(
'user' => loadClass('Helper')->getEnv('PGSQL_ROOT_USER'),
'pass' => loadClass('Helper')->getEnv('PGSQL_ROOT_PASSWORD'),
'db' => 'postgres'
));
break;
case 'Redis':
loadFile($class, $cnt_dir);
$_LOADED_LIBS[$class] = \devilbox\Redis::getInstance($GLOBALS['REDIS_HOST_NAME']);
break;
case 'Memcd':
loadFile($class, $cnt_dir);
$_LOADED_LIBS[$class] = \devilbox\Memcd::getInstance($GLOBALS['MEMCD_HOST_NAME']);
break;
// Get optional docker classes
default:
// Redis
if ($class == 'Redis' && loadClass('Docker')->getEnv('COMPOSE_OPTIONAL') == 1) {
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
$_LOADED_LIBS[$class] = \devilbox\Redis::getInstance('redis');
break;
} else {
exit('Class does not exist: '.$class);
}
exit('Class does not exist: '.$class);
}
return $_LOADED_LIBS[$class];
}
}
// VirtualHost DNS check
// Temporarily disable due to:
// https://github.com/cytopia/devilbox/issues/8
$ENABLE_VHOST_DNS_CHECK = false;

View File

@ -10,10 +10,10 @@ if (isset($_GET['database'])) {
} else if (isset($_GET['type']) && $_GET['type'] == 'postgres') {
$schema = isset($_GET['schema']) ? $_GET['schema'] : '';
echo json_encode(array(
'size' => (string)loadClass('Postgres')->getSchemaSize($_GET['database'], $schema),
'table' => (string)loadClass('Postgres')->getTableCount($_GET['database'], $schema)
'size' => (string)loadClass('Pgsql')->getSchemaSize($_GET['database'], $schema),
'table' => (string)loadClass('Pgsql')->getTableCount($_GET['database'], $schema)
));
}
} else if (isset($_GET['vhost'])) {
echo loadClass('Docker')->PHP_checkVirtualHost($_GET['vhost']);
echo loadClass('Httpd')->checkVirtualHost($_GET['vhost']);
}

View File

@ -1,3 +1,60 @@
.meter {
height: 20px; /* Can be anything */
position: relative;
background: #555;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3);
}
.meter > span {
display: block;
height: 100%;
border-top-right-radius: 20px;
border-bottom-right-radius: 20px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: rgb(43,194,83);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 2px 9px rgba(255,255,255,0.3),
inset 0 -2px 6px rgba(0,0,0,0.4);
position: relative;
overflow: hidden;
}
.dash-box {
border: 1px solid #383737;
background-color: #3d3d3d;
color: #999999;
height:100%;
}
.dash-box-head {
background-color: #383737;
color: #999999;
width:100%;
display: inline-block;
padding:10px;
font-weight: bold;
}
.dash-box-body {
padding:10px;
}
.row-margin {
margin-bottom:20px;
}
.col-margin {
margin-bottom:20px;
}
/* Bootstrap overwrites
-------------------------------------------------- */
html, body {
@ -120,3 +177,16 @@ td.break-word {
word-break: break-word;
}
/* adminer.php;
-------------------------------------------------- */
#menu {
position: absolute;
margin: 76px 0 0 !important;
}
#breadcrumb {
top: 60px !important;
}
#lang {
top: 53px !important;
}

View File

@ -2,11 +2,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<?php $FONT_AWESOME = TRUE; require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(true); ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
@ -92,11 +92,8 @@
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -0,0 +1,48 @@
<?php require '../config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>Memcached Keys</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<?php if (!loadClass('Memcd')->isAvailable()): ?>
<p>Memcached container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Memcd')->getKeys() as $data): ?>
<tr>
<td><?php print_r($data['key']);?></td>
<td><?php print_r($data['value']);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -1,13 +1,17 @@
<?php require '../config.php'; ?>
<?php $MySQL = loadClass('Mysql'); ?>
<?php
// Also required for JS calls (see bottom of this page)
$len_table = 4;
$len_size = 9;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
@ -18,40 +22,40 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php
$len_table = 4;
$len_size = 9;
?>
<?php foreach ($MySQL->getDatabases() as $name => $keys): ?>
<?php if (!loadClass('Mysql')->isAvailable()): ?>
<p>MySQL container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<td><?php echo $name;?></td>
<td><?php echo $keys['charset'];?></td>
<td><?php echo $keys['collation'];?></td>
<td><code><span class="table" id="table-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="database[]" class="database" value="<?php echo $name;?>" />
<?php endforeach; ?>
</tbody>
</table>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Mysql')->getDatabases() as $name => $keys): ?>
<tr>
<td><?php echo $name;?></td>
<td><?php echo $keys['charset'];?></td>
<td><?php echo $keys['collation'];?></td>
<td><code><span class="table" id="table-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="database[]" class="database" value="<?php echo $name;?>" />
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); ?>
<script>
// self executing function here
(function() {

View File

@ -1,13 +1,17 @@
<?php require '../config.php'; ?>
<?php $Postgres = loadClass('Postgres'); ?>
<?php
// Also required for JS calls (see bottom of this page)
$len_table = 4;
$len_size = 9;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
@ -18,50 +22,50 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php
$len_table = 4;
$len_size = 9;
?>
<?php foreach ($Postgres->getDatabases() as $name => $database): ?>
<tr class="table-info">
<th>
<?php echo $name;?>
</th>
<td><?php echo $database['charset'];?></td>
<td><?php echo $database['collation'];?></td>
<td colspan="2"></td>
</tr>
<?php foreach ($database['schemas'] as $schema => $data): ?>
<tr>
<td><?php echo $schema;?></td>
<?php if (!loadClass('Pgsql')->isAvailable()): ?>
<p>PgSQL container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Pgsql')->getDatabases() as $name => $database): ?>
<tr class="table-info">
<th>
<?php echo $name;?>
</th>
<td><?php echo $database['charset'];?></td>
<td><?php echo $database['collation'];?></td>
<td colspan="2"></td>
<td><code><span class="table" id="table-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="schema[]" data-database="<?php echo $name;?>" class="schema" value="<?php echo $schema;?>" />
<?php endforeach; ?>
<?php foreach ($database['schemas'] as $schema => $data): ?>
<tr>
<td><?php echo $schema;?></td>
<td colspan="2"></td>
<td><code><span class="table" id="table-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="schema[]" data-database="<?php echo $name;?>" class="schema" value="<?php echo $schema;?>" />
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); ?>
<script>
// self executing function here
(function() {

View File

@ -1,16 +1,12 @@
<?php require '../config.php'; ?>
<?php if (loadClass('Docker')->getEnv('COMPOSE_OPTIONAL') != 1) {
header('Location: /index.php');
exit(0);
} ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
@ -21,29 +17,32 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getKeys() as $key => $value): ?>
<?php if (!loadClass('Redis')->isAvailable()): ?>
<p>Redis container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<td><?php echo $key;?></td>
<td><?php print_r($value);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getKeys() as $key => $value): ?>
<tr>
<td><?php echo $key;?></td>
<td><?php print_r($value);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -2,11 +2,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
@ -17,8 +17,8 @@
<div class="row">
<div class="col-md-12">
<?php $errors = loadClass('Logger')->getAll(); ?>
<?php if ($errors === false): ?>
<?php $errors = loadClass('Logger')->getAll(); ?>
<?php if ($errors === false): ?>
<p>Writing to logfile is not possible. Errors will be sent as mail instead. Check the mail section.</p>
<?php elseif (count($errors) === 0): ?>
<p>No errors detected.</div>
@ -28,14 +28,29 @@
<thead class="thead-inverse">
<tr>
<th>#</th>
<th>date</th>
<th>Errors (<?php echo $total;?>)</th>
</tr>
</thead>
<tbody>
<?php for ($i=($total-1); $i>=0; --$i): ?>
<tr>
<td><?php echo ($i+1);?></td>
<td><code><?php echo $errors[$i];?></code></td>
<th><?php echo ($i+1);?></th>
<th><code><?php echo $errors[$i]['date'];?></code></th>
<th><code><?php echo $errors[$i]['head'];?></code></th>
<?php if (isset($errors[$i]['body'])): ?>
</tr>
<tr>
<td colspan="3">
<?php
$dump = implode('', $errors[$i]['body']);
//$dump = str_replace("=&gt;</font> \n", '=&gt;</font>', $dump);
?>
<code><?php echo $dump; ?></code>
</td>
</tr>
<?php endif; ?>
</tr>
<?php endfor; ?>
</tbody>
@ -47,6 +62,6 @@
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
<?php require '../config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>Httpd info</h1>
<br/>
<br/>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<iframe style="width:100%; height:100vh; position:relative;" src="/devilbox-httpd-status" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -0,0 +1,51 @@
<?php require '../config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>Memcached Info</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<?php if (!loadClass('Memcd')->isAvailable()): ?>
<p>Memcahed container is not running.</p>
<?php else: ?>
<?php foreach (loadClass('Memcd')->getInfo() as $srv => $data): ?>
<h2><?php echo $srv; ?></h2>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -0,0 +1,55 @@
<?php require '../config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>MySQL Info</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<?php if (!loadClass('Mysql')->isAvailable()): ?>
<p>MySQL container is not running.</p>
<?php else: ?>
<p>For reference see here:</p>
<ul>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html</a></li>
</ul>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Mysql')->getConfig() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -0,0 +1,48 @@
<?php require '../config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>PostgreSQL Info</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<?php if (!loadClass('Pgsql')->isAvailable()): ?>
<p>PgSQL container is not running.</p>
<?php else: ?>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Pgsql')->getConfig() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -2,11 +2,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
@ -21,6 +21,6 @@
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -0,0 +1,48 @@
<?php require '../config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>Redis Info</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<?php if (!loadClass('Redis')->isAvailable()): ?>
<p>Redis container is not running.</p>
<?php else: ?>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getInfo() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -67,7 +67,7 @@ if ($sort == 'date') {
//
// Mbox Reader
//
$MyMbox = new \devilbox\Mail('/var/mail/mailtrap');
$MyMbox = new \devilbox\Mail('/var/mail/devilbox');
// If default sort is on, use NULL, so we do not have to sort the mails after retrieval,
// because they are being read in the default sort/order anyway
@ -78,11 +78,11 @@ $messages = $MyMbox->get($sortOrderArr);
<!DOCTYPE html>
<html lang="en">
<head>
<?php $FONT_AWESOME = TRUE; require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(true); ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>Mail</h1>
@ -179,7 +179,7 @@ $messages = $MyMbox->get($sortOrderArr);
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); ?>
<script>
$(function() {
$('.subject').each(function() {

View File

@ -1,52 +0,0 @@
<?php require '../config.php'; ?>
<?php $Docker = loadClass('Docker'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<div class="container">
<h1>MySQL Info</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<p>For reference see here:</p>
<ul>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html</a></li>
</ul>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($Docker->MySQL_config() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
</body>
</html>

View File

@ -230,7 +230,7 @@ $opcache = OpCacheService::init($options);
<!doctype html>
<html>
<head>
<?php require '../include/head.php'; ?>
<?php echo loadClass('Html')->getHead(); /* devilbox edit */ ?>
<meta charset="UTF-8"/>
@ -238,7 +238,7 @@ $opcache = OpCacheService::init($options);
<title>OPcache statistics on <?php echo $opcache->getData('version', 'host'); ?></title>
<script src="/vendor/react/react.min.js"></script>
<script src="/vendor/react/react-dom.min.js"></script>
<script src="/vendor/jquery/jquery-2.2.3.min.js"></script>
<script src="/vendor/jquery/jquery-3.2.1.min.js"></script>
<style type="text/css">
body { font-family:sans-serif; font-size:90%; padding: 0; margin: 0 }
nav { padding-top: 20px; }
@ -321,7 +321,7 @@ $opcache = OpCacheService::init($options);
</head>
<body>
<?php require '../include/navbar.php'; ?>
<?php echo loadClass('Html')->getNavbar(); /* devilbox edit */?>
@ -766,6 +766,6 @@ $opcache = OpCacheService::init($options);
var filesObj = ReactDOM.render(React.createElement(Files, null), document.getElementById('filelist'));
ReactDOM.render(React.createElement(Directives, null), document.getElementById('directives'));
</script>
<?php require '../include/footer.php'; ?>
<?php echo loadClass('Html')->getFooter(); /* devilbox edit */?>
</body>
</html>

View File

@ -1,45 +0,0 @@
<?php require '../config.php'; ?>
<?php $Docker = loadClass('Docker'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<div class="container">
<h1>PostgreSQL Info</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($Docker->Postgres_config() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
</body>
</html>

View File

@ -1,49 +0,0 @@
<?php require '../config.php'; ?>
<?php $Docker = loadClass('Docker'); ?>
<?php if ($Docker->getEnv('COMPOSE_OPTIONAL') != 1 ) {
header('Location: /index.php');
exit(0);
} ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<div class="container">
<h1>Redis Info</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getInfo() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
</body>
</html>

View File

@ -0,0 +1,5 @@
language: php
php:
- '5.3'
- '7.1'
script: git diff --name-only $TRAVIS_COMMIT_RANGE | grep '\.php$' | xargs -n1 -P8 php -l | grep -v 'No syntax errors'; test $? -eq 1

View File

@ -29,7 +29,7 @@ if (!$error && $_POST) {
$call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
}
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")";
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")";
echo "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
if (!$connection->multi_query($query)) {

View File

@ -35,7 +35,6 @@ if ($_POST && !process_fields($row["fields"]) && !$error) {
$all_fields = array();
$use_all_fields = false;
$foreign = array();
ksort($row["fields"]);
$orig_field = reset($orig_fields);
$after = " FIRST";

View File

@ -62,10 +62,9 @@ if ($adminer->homepage()) {
search_tables();
}
}
echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);">';
$doc_link = doc_link(array('sql' => 'show-table-status.html'));
echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);" class="jsonly">';
echo '<th>' . lang('Table');
echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-mysql.html'));
@ -80,10 +79,11 @@ if ($adminer->homepage()) {
$tables = 0;
foreach ($tables_list as $name => $type) {
$view = ($type !== null && !preg_match('~table~i', $type));
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
echo '<th>' . (support("table") || support("indexes") ? '<a href="' . h(ME) . 'table=' . urlencode($name) . '" title="' . lang('Show structure') . '">' . h($name) . '</a>' : h($name));
$id = h("Table-" . $name);
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');", "", $id);
echo '<th>' . (support("table") || support("indexes") ? "<a href='" . h(ME) . "table=" . urlencode($name) . "' title='" . lang('Show structure') . "' id='$id'>" . h($name) . '</a>' : h($name));
if ($view) {
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '" title="' . lang('Alter view') . '">' . (preg_match('~materialized~i', $type) ? lang('Materialized View') : lang('View')) . '</a>';
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '" title="' . lang('Alter view') . '">' . (preg_match('~materialized~i', $type) ? lang('Materialized view') : lang('View')) . '</a>';
echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '" title="' . lang('Select data') . '">?</a>';
} else {
foreach (array(
@ -145,7 +145,6 @@ if ($adminer->homepage()) {
echo '<p class="links"><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
echo (support("view") ? '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n" : "");
echo (support("materializedview") ? '<a href="' . h(ME) . 'view=&amp;materialized=1">' . lang('Create materialized view') . "</a>\n" : "");
if (support("routine")) {
echo "<h3 id='routines'>" . lang('Routines') . "</h3>\n";

View File

@ -59,7 +59,8 @@ if (isset($_GET["elastic"])) {
}
function connect($server, $username, $password) {
$this->_url = "http://$username:$password@$server/";
preg_match('~^(https?://)?(.*)~', $server, $match);
$this->_url = ($match[1] ? $match[1] : "http://") . "$username:$password@$match[2]/";
$return = $this->query('');
if ($return) {
$this->server_info = $return['version']['number'];
@ -257,9 +258,9 @@ if (isset($_GET["elastic"])) {
"Engine" => "table",
"Rows" => $table["count"],
);
}
if ($name != "" && $name == $table["term"]) {
return $return[$name];
if ($name != "" && $name == $table["term"]) {
return $return[$name];
}
}
}
return $return;

View File

@ -8,7 +8,7 @@
$drivers["mssql"] = "MS SQL";
if (isset($_GET["mssql"])) {
$possible_drivers = array("SQLSRV", "MSSQL");
$possible_drivers = array("SQLSRV", "MSSQL", "PDO_DBLIB");
define("DRIVER", "mssql");
if (extension_loaded("sqlsrv")) {
class Min_DB {
@ -109,11 +109,11 @@ if (isset($_GET["mssql"])) {
}
function fetch_assoc() {
return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_ASSOC, SQLSRV_SCROLL_NEXT));
return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_ASSOC));
}
function fetch_row() {
return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_NUMERIC, SQLSRV_SCROLL_NEXT));
return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_NUMERIC));
}
function fetch_field() {
@ -164,7 +164,7 @@ if (isset($_GET["mssql"])) {
}
function query($query, $unbuffered = false) {
$result = mssql_query($query, $this->_link); //! $unbuffered
$result = @mssql_query($query, $this->_link); //! $unbuffered
$this->error = "";
if (!$result) {
$this->error = mssql_get_last_message();
@ -186,7 +186,7 @@ if (isset($_GET["mssql"])) {
}
function next_result() {
return mssql_next_result($this->_result);
return mssql_next_result($this->_result->_result);
}
function result($query, $field = 0) {
@ -234,8 +234,21 @@ if (isset($_GET["mssql"])) {
}
}
}
} elseif (extension_loaded("pdo_dblib")) {
class Min_DB extends Min_PDO {
var $extension = "PDO_DBLIB";
function connect($server, $username, $password) {
$this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
return true;
}
function select_db($database) {
// database selection is separated from the connection so dbname in DSN can't be used
return $this->query("USE " . idf_escape($database));
}
}
}
class Min_Driver extends Min_SQL {
@ -288,7 +301,7 @@ if (isset($_GET["mssql"])) {
}
function get_databases() {
return get_vals("EXEC sp_databases");
return get_vals("SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')");
}
function limit($query, $where, $limit, $offset = 0, $separator = " ") {

View File

@ -301,12 +301,16 @@ if (!defined("DRIVER")) {
* @return mixed Min_DB or string for error
*/
function connect() {
global $adminer;
global $adminer, $types, $structured_types;
$connection = new Min_DB;
$credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
$connection->set_charset(charset($connection)); // available in MySQLi since PHP 5.0.5
$connection->query("SET sql_quote_show_create = 1, autocommit = 1");
if (version_compare($connection->server_info, '5.7.8') >= 0) {
$structured_types[lang('Strings')][] = "json";
$types["json"] = 4294967295;
}
return $connection;
}
$return = $connection->error;
@ -429,7 +433,7 @@ if (!defined("DRIVER")) {
global $connection;
$return = array();
foreach (get_rows($fast && $connection->server_info >= 5
? "SELECT TABLE_NAME AS Name, Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . ($name != "" ? "AND TABLE_NAME = " . q($name) : "ORDER BY Name")
? "SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . ($name != "" ? "AND TABLE_NAME = " . q($name) : "ORDER BY Name")
: "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
) as $row) {
if ($row["Engine"] == "InnoDB") {
@ -500,10 +504,11 @@ if (!defined("DRIVER")) {
function indexes($table, $connection2 = null) {
$return = array();
foreach (get_rows("SHOW INDEX FROM " . table($table), $connection2) as $row) {
$return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? "INDEX" : "UNIQUE")));
$return[$row["Key_name"]]["columns"][] = $row["Column_name"];
$return[$row["Key_name"]]["lengths"][] = $row["Sub_part"];
$return[$row["Key_name"]]["descs"][] = null;
$name = $row["Key_name"];
$return[$name]["type"] = ($name == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? ($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE")));
$return[$name]["columns"][] = $row["Column_name"];
$return[$name]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]);
$return[$name]["descs"][] = null;
}
return $return;
}
@ -972,6 +977,14 @@ if (!defined("DRIVER")) {
return get_key_vals("SHOW STATUS");
}
/** Get replication status of master or slave
* @param string
* @return array ($name => $value)
*/
function replication_status($type) {
return get_rows("SHOW $type STATUS");
}
/** Convert field in select and edit
* @param array one element from fields()
* @return string
@ -1012,13 +1025,17 @@ if (!defined("DRIVER")) {
*/
function support($feature) {
global $connection;
return !preg_match("~scheme|sequence|type|view_trigger" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|routine|trigger|view" : "") : "") . "~", $feature);
return !preg_match("~scheme|sequence|type|view_trigger|materializedview" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|routine|trigger|view" : "") : "") . "~", $feature);
}
function kill_process($val) {
return queries("KILL " . number($val));
}
function connection_id(){
return "SELECT CONNECTION_ID()";
}
function max_connections() {
global $connection;
return $connection->result("SELECT @@max_connections");

View File

@ -186,12 +186,20 @@ if (isset($_GET["pgsql"])) {
}
function connect() {
global $adminer;
global $adminer, $types, $structured_types;
$connection = new Min_DB;
$credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
if ($connection->server_info >= 9) {
$connection->query("SET application_name = 'Adminer'");
if ($connection->server_info >= 9.2) {
$structured_types[lang('Strings')][] = "json";
$types["json"] = 4294967295;
if ($connection->server_info >= 9.4) {
$structured_types[lang('Strings')][] = "jsonb";
$types["jsonb"] = 4294967295;
}
}
}
return $connection;
}
@ -199,7 +207,7 @@ if (isset($_GET["pgsql"])) {
}
function get_databases() {
return get_vals("SELECT datname FROM pg_database ORDER BY datname");
return get_vals("SELECT datname FROM pg_database WHERE has_database_privilege(datname, 'CONNECT') ORDER BY datname");
}
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
@ -244,11 +252,11 @@ ORDER BY 1";
function table_status($name = "") {
$return = array();
foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' WHEN 'mv' THEN 'materialized view' WHEN 'f' THEN 'foreign table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids::int AS \"Oid\", reltuples as \"Rows\"
FROM pg_class
WHERE relkind IN ('r','v','mv','f')
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")
foreach (get_rows("SELECT c.relname AS \"Name\", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\", pg_relation_size(c.oid) AS \"Data_length\", pg_total_relation_size(c.oid) - pg_relation_size(c.oid) AS \"Index_length\", obj_description(c.oid, 'pg_class') AS \"Comment\", c.relhasoids::int AS \"Oid\", c.reltuples as \"Rows\", n.nspname
FROM pg_class c
JOIN pg_namespace n ON(n.nspname = current_schema() AND n.oid = c.relnamespace)
WHERE relkind IN ('r', 'm', 'v')
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY c.oid")
) as $row) { //! Index_length, Auto_increment
$return[$row["Name"]] = $row;
}
@ -311,9 +319,9 @@ ORDER BY a.attnum"
$return = array();
$table_oid = $connection2->result("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($table));
$columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2);
foreach (get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption FROM pg_index i, pg_class ci WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid", $connection2) as $row) {
foreach (get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption , (indpred IS NOT NULL)::int as indispartial FROM pg_index i, pg_class ci WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid", $connection2) as $row) {
$relname = $row["relname"];
$return[$relname]["type"] = ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX"));
$return[$relname]["type"] = ($row["indispartial"] ? "INDEX" : ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX")));
$return[$relname]["columns"] = array();
foreach (explode(" ", $row["indkey"]) as $indkey) {
$return[$relname]["columns"][] = $columns[$indkey];
@ -330,7 +338,7 @@ ORDER BY a.attnum"
function foreign_keys($table) {
global $on_actions;
$return = array();
foreach (get_rows("SELECT conname, pg_get_constraintdef(oid) AS definition
foreach (get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
FROM pg_constraint
WHERE conrelid = (SELECT pc.oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON (pn.oid = pc.relnamespace) WHERE pc.relname = " . q($table) . " AND pn.nspname = current_schema())
AND contype = 'f'::char
@ -352,7 +360,7 @@ ORDER BY conkey, conname") as $row) {
function view($name) {
global $connection;
return array("select" => $connection->result("SELECT pg_get_viewdef(" . q($name) . ")"));
return array("select" => trim($connection->result("SELECT pg_get_viewdef(" . q($name) . ")")));
}
function collations() {
@ -488,7 +496,7 @@ ORDER BY conkey, conname") as $row) {
function drop_tables($tables) {
foreach ($tables as $table) {
$status = table_status($table);
$status = table_status($table);
if (!queries("DROP " . strtoupper($status["Engine"]) . " " . table($table))) {
return false;
}
@ -506,18 +514,21 @@ ORDER BY conkey, conname") as $row) {
return true;
}
function trigger($name) {
function trigger($name, $table = null) {
if ($name == "") {
return array("Statement" => "EXECUTE PROCEDURE ()");
}
$rows = get_rows('SELECT trigger_name AS "Trigger", condition_timing AS "Timing", event_manipulation AS "Event", \'FOR EACH \' || action_orientation AS "Type", action_statement AS "Statement" FROM information_schema.triggers WHERE event_object_table = ' . q($_GET["trigger"]) . ' AND trigger_name = ' . q($name));
if ($table === null) {
$table = $_GET['trigger'];
}
$rows = get_rows('SELECT t.trigger_name AS "Trigger", t.action_timing AS "Timing", (SELECT STRING_AGG(event_manipulation, \' OR \') FROM information_schema.triggers WHERE event_object_table = t.event_object_table AND trigger_name = t.trigger_name ) AS "Events", t.event_manipulation AS "Event", \'FOR EACH \' || t.action_orientation AS "Type", t.action_statement AS "Statement" FROM information_schema.triggers t WHERE t.event_object_table = ' . q($table) . ' AND t.trigger_name = ' . q($name));
return reset($rows);
}
function triggers($table) {
$return = array();
foreach (get_rows("SELECT * FROM information_schema.triggers WHERE event_object_table = " . q($table)) as $row) {
$return[$row["trigger_name"]] = array($row["condition_timing"], $row["event_manipulation"]);
$return[$row["trigger_name"]] = array($row["action_timing"], $row["event_manipulation"]);
}
return $return;
}
@ -606,6 +617,111 @@ AND typelem = 0"
return $return;
}
/** Get SQL command to create table
* @param string
* @param bool
* @return string
*/
function create_sql($table, $auto_increment) {
global $connection;
$return = '';
$return_parts = array();
$sequences = array();
$status = table_status($table);
$fields = fields($table);
$indexes = indexes($table);
ksort($indexes);
$fkeys = foreign_keys($table);
ksort($fkeys);
$triggers = triggers($table);
if (!$status || empty($fields)) {
return false;
}
$return = "CREATE TABLE " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " (\n ";
// fields' definitions
foreach ($fields as $field_name => $field) {
$part = idf_escape($field['field']) . ' ' . $field['full_type']
. (is_null($field['default']) ? "" : " DEFAULT $field[default]")
. ($field['attnotnull'] ? " NOT NULL" : "");
$return_parts[] = $part;
// sequences for fields
if (preg_match('~nextval\(\'([^\']+)\'\)~', $field['default'], $matches)) {
$sequence_name = $matches[1];
$sq = reset(get_rows("SELECT * FROM $sequence_name"));
$sequences[] = "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value] START " . ($auto_increment ? $sq['last_value'] : 1) . " CACHE $sq[cache_value];";
}
}
// adding sequences before table definition
if (!empty($sequences)) {
$return = implode("\n\n", $sequences) . "\n\n$return";
}
// primary + unique keys
foreach ($indexes as $index_name => $index) {
switch($index['type']) {
case 'UNIQUE': $return_parts[] = "CONSTRAINT " . idf_escape($index_name) . " UNIQUE (" . implode(', ', array_map('idf_escape', $index['columns'])) . ")"; break;
case 'PRIMARY': $return_parts[] = "CONSTRAINT " . idf_escape($index_name) . " PRIMARY KEY (" . implode(', ', array_map('idf_escape', $index['columns'])) . ")"; break;
}
}
// foreign keys
foreach ($fkeys as $fkey_name => $fkey) {
$return_parts[] = "CONSTRAINT " . idf_escape($fkey_name) . " $fkey[definition] " . ($fkey['deferrable'] ? 'DEFERRABLE' : 'NOT DEFERRABLE');
}
$return .= implode(",\n ", $return_parts) . "\n) WITH (oids = " . ($status['Oid'] ? 'true' : 'false') . ");";
// "basic" indexes after table definition
foreach ($indexes as $index_name => $index) {
if ($index['type'] == 'INDEX') {
$return .= "\n\nCREATE INDEX " . idf_escape($index_name) . " ON " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " USING btree (" . implode(', ', array_map('idf_escape', $index['columns'])) . ");";
}
}
// coments for table & fields
if ($status['Comment']) {
$return .= "\n\nCOMMENT ON TABLE " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " IS " . q($status['Comment']) . ";";
}
foreach ($fields as $field_name => $field) {
if ($field['comment']) {
$return .= "\n\nCOMMENT ON COLUMN " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . "." . idf_escape($field_name) . " IS " . q($field['comment']) . ";";
}
}
// triggers
foreach ($triggers as $trg_id => $trg) {
$trigger = trigger($trg_id, $status['Name']);
$return .= "\n\nCREATE TRIGGER " . idf_escape($trigger['Trigger']) . " $trigger[Timing] $trigger[Events] ON " . idf_escape($status["nspname"]) . "." . idf_escape($status['Name']) . " $trigger[Type] $trigger[Statement];";
}
return rtrim($return, ';');
}
/** Get SQL commands to create triggers
* @param string
* @param string
* @return string
*/
//@TODO
function trigger_sql($table, $style) {
$return = "";
//foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_\\")), null, "-- ") as $row) {
// $return .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "")
// . "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . table($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
//}
//return $return;
return false;
}
function use_sql($database) {
return "\connect " . idf_escape($database);
}
@ -631,11 +747,15 @@ AND typelem = 0"
function support($feature) {
global $connection;
return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col|kill)$~', $feature); //! routine|
return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col|kill|dump)$~', $feature); //! routine|
}
function kill_process($val) {
return queries("SELECT pg_terminate_backend(" . number($val).")");
return queries("SELECT pg_terminate_backend(" . number($val) . ")");
}
function connection_id(){
return "SELECT pg_backend_pid()";
}
function max_connections() {

View File

@ -6,6 +6,7 @@ if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) {
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: immutable");
if ($_GET["file"] == "favicon.ico") {
header("Content-Type: image/x-icon");
@ -18,7 +19,7 @@ if ($_GET["file"] == "favicon.ico") {
echo lzw_decompress(compile_file('../adminer/static/functions.js;static/editing.js', 'minify_js'));
} elseif ($_GET["file"] == "jush.js") {
header("Content-Type: text/javascript; charset=utf-8");
echo lzw_decompress(compile_file('../externals/jush/modules/jush.js;../externals/jush/modules/jush-textarea.js;../externals/jush/modules/jush-txt.js;../externals/jush/modules/jush-sql.js;../externals/jush/modules/jush-pgsql.js;../externals/jush/modules/jush-sqlite.js;../externals/jush/modules/jush-mssql.js;../externals/jush/modules/jush-oracle.js;../externals/jush/modules/jush-simpledb.js', 'minify_js'));
echo lzw_decompress(compile_file('../externals/jush/modules/jush.js;../externals/jush/modules/jush-textarea.js;../externals/jush/modules/jush-txt.js;../externals/jush/modules/jush-js.js;../externals/jush/modules/jush-sql.js;../externals/jush/modules/jush-pgsql.js;../externals/jush/modules/jush-sqlite.js;../externals/jush/modules/jush-mssql.js;../externals/jush/modules/jush-oracle.js;../externals/jush/modules/jush-simpledb.js', 'minify_js'));
} else {
header("Content-Type: image/gif");
switch ($_GET["file"]) {

View File

@ -7,13 +7,15 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-
$message = ($_POST["drop"] ? lang('Foreign key has been dropped.') : ($name != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.')));
$location = ME . "table=" . urlencode($TABLE);
$row["source"] = array_filter($row["source"], 'strlen');
ksort($row["source"]); // enforce input order
$target = array();
foreach ($row["source"] as $key => $val) {
$target[$key] = $row["target"][$key];
if (!$_POST["drop"]) {
$row["source"] = array_filter($row["source"], 'strlen');
ksort($row["source"]); // enforce input order
$target = array();
foreach ($row["source"] as $key => $val) {
$target[$key] = $row["target"][$key];
}
$row["target"] = $target;
}
$row["target"] = $target;
if ($jush == "sqlite") {
queries_redirect($location, $message, recreate_table($TABLE, $TABLE, array(), array(), array(" $name" => ($_POST["drop"] ? "" : " " . format_foreign_key($row)))));
@ -60,13 +62,13 @@ $referencable = array_keys(array_filter(table_status('', true), 'fk_support'));
<input type="hidden" name="change-js" value="">
<noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript>
<table cellspacing="0">
<thead><tr><th><?php echo lang('Source'); ?><th><?php echo lang('Target'); ?></thead>
<thead><tr><th id="label-source"><?php echo lang('Source'); ?><th id="label-target"><?php echo lang('Target'); ?></thead>
<?php
$j = 0;
foreach ($row["source"] as $key => $val) {
echo "<tr>";
echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key]);
echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1), "label-source");
echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key], 1, "label-target");
$j++;
}
?>

View File

@ -110,7 +110,7 @@ focus(document.getElementById('username'));
function login($login, $password) {
global $jush;
if ($jush == "sqlite") {
return lang('Implement %s method to use SQLite.', 'login()');
return lang('<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.', '<code>login()</code>');
}
return true;
}
@ -197,6 +197,15 @@ focus(document.getElementById('username'));
;
}
/** Query printed in SQL command before execution
* @param string query to be executed
* @return string escaped query to be printed
*/
function sqlCommandQuery($query)
{
return shorten_utf8(trim($query), 1000);
}
/** Description of a row in a table
* @param string
* @return string SQL expression, empty string for no description
@ -232,7 +241,10 @@ focus(document.getElementById('username'));
function selectVal($val, $link, $field, $original) {
$return = ($val === null ? "<i>NULL</i>" : (preg_match("~char|binary~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "<code>$val</code>" : $val));
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($original));
$return = "<i>" . lang('%d byte(s)', strlen($original)) . "</i>";
}
if (preg_match('~json~', $field["type"])) {
$return = "<code class='jush-js'>$return</code>";
}
return ($link ? "<a href='" . h($link) . "'" . (is_url($link) ? " rel='noreferrer'" : "") . ">$return</a>" : $return);
}
@ -246,6 +258,45 @@ focus(document.getElementById('username'));
return $val;
}
/** Print table structure in tabular format
* @param array data about individual fields
* @return null
*/
function tableStructurePrint($fields) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . (support("comment") ? "<td>" . lang('Comment') : "") . "</thead>\n";
foreach ($fields as $field) {
echo "<tr" . odd() . "><th>" . h($field["field"]);
echo "<td><span title='" . h($field["collation"]) . "'>" . h($field["full_type"]) . "</span>";
echo ($field["null"] ? " <i>NULL</i>" : "");
echo ($field["auto_increment"] ? " <i>" . lang('Auto Increment') . "</i>" : "");
echo (isset($field["default"]) ? " <span title='" . lang('Default value') . "'>[<b>" . h($field["default"]) . "</b>]</span>" : "");
echo (support("comment") ? "<td>" . nbsp($field["comment"]) : "");
echo "\n";
}
echo "</table>\n";
}
/** Print list of indexes on table in tabular format
* @param array data about all indexes on a table
* @return null
*/
function tableIndexesPrint($indexes) {
echo "<table cellspacing='0'>\n";
foreach ($indexes as $name => $index) {
ksort($index["columns"]); // enforce correct columns order
$print = array();
foreach ($index["columns"] as $key => $val) {
$print[] = "<i>" . h($val) . "</i>"
. ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : "")
. ($index["descs"][$key] ? " DESC" : "")
;
}
echo "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
}
echo "</table>\n";
}
/** Print columns box in select
* @param array result of selectColumnsProcess()[0]
* @param array selectable columns
@ -352,8 +403,9 @@ focus(document.getElementById('username'));
echo "var indexColumns = ";
$columns = array();
foreach ($indexes as $index) {
if ($index["type"] != "FULLTEXT") {
$columns[reset($index["columns"])] = 1;
$current_key = reset($index["columns"]);
if ($index["type"] != "FULLTEXT" && $current_key) {
$columns[$current_key] = 1;
}
}
$columns[""] = 1;
@ -806,11 +858,14 @@ focus(document.getElementById('username'));
$connection->select_db(DB);
$tables = table_status('', true);
}
if (support("sql")) {
?>
?>
<script type="text/javascript" src="../externals/jush/modules/jush.js"></script>
<script type="text/javascript" src="../externals/jush/modules/jush-textarea.js"></script>
<script type="text/javascript" src="../externals/jush/modules/jush-txt.js"></script>
<script type="text/javascript" src="../externals/jush/modules/jush-js.js"></script>
<?php
if (support("sql")) {
?>
<script type="text/javascript" src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>
<script type="text/javascript">
<?php
@ -886,17 +941,18 @@ bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info,
* @return null
*/
function tablesPrint($tables) {
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
echo "<ul id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $table => $status) {
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
$name = $this->tableName($status);
echo (support("table") || support("indexes")
? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"'
. bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : ""), "structure")
. bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : "structure"))
. " title='" . lang('Show structure') . "'>$name</a>"
: "<span>$name</span>"
) . "<br>\n";
) . "\n";
}
echo "</ul>\n";
}
}

View File

@ -120,7 +120,6 @@ function unset_permanent() {
*/
function auth_error($error) {
global $adminer, $has_token;
$error = h($error);
$session_name = session_name();
if (isset($_GET["username"])) {
header("HTTP/1.1 403 Forbidden"); // 401 requires sending WWW-Authenticate header
@ -168,7 +167,7 @@ if (isset($_GET["username"])) {
$driver = new Min_Driver($connection);
if (!is_object($connection) || ($login = $adminer->login($_GET["username"], get_password())) !== true) {
auth_error((is_string($connection) ? $connection : (is_string($login) ? $login : lang('Invalid credentials.'))));
auth_error((is_string($connection) ? h($connection) : (is_string($login) ? $login : lang('Invalid credentials.'))));
}
if ($auth && $_POST["token"]) {

View File

@ -12,11 +12,12 @@ function connect_error() {
page_header(lang('Select database'), $error, false);
echo "<p class='links'>\n";
foreach (array(
'database' => lang('Create new database'),
'database' => lang('Create database'),
'privileges' => lang('Privileges'),
'processlist' => lang('Process list'),
'variables' => lang('Variables'),
'status' => lang('Status'),
'replication' => lang('Replication'),
) as $key => $val) {
if (support($key)) {
echo "<a href='" . h(ME) . "$key='>$val</a>\n";
@ -43,8 +44,9 @@ function connect_error() {
foreach ($databases as $db => $tables) {
$root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . ">" . (support("database") ? "<td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"])) : "");
echo "<th><a href='$root'>" . h($db) . "</a>";
$id = h("Db-" . $db);
echo "<tr" . odd() . ">" . (support("database") ? "<td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]), "", "", "", $id) : "");
echo "<th><a href='$root' id='$db'>" . h($db) . "</a>";
$collation = nbsp(db_collation($db, $collations));
echo "<td>" . (support("database") ? "<a href='$root" . ($scheme ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>$collation</a>" : $collation);
echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>";
@ -76,7 +78,7 @@ if (isset($_GET["import"])) {
$_GET["sql"] = $_GET["import"];
}
if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]) || $_GET["script"] == "connect" || $_GET["script"] == "kill")) {
if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["replication"]) || isset($_GET["variables"]) || $_GET["script"] == "connect" || $_GET["script"] == "kill")) {
if (DB != "" || $_GET["refresh"]) {
restart_session();
set_session("dbs", null);

View File

@ -18,6 +18,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
?>
<!DOCTYPE html>
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
<?php /* devilbox edit */ echo loadClass('Html')->getHead(); error_reporting(6135); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex">
@ -29,21 +30,18 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<?php if ($adminer->head()) { ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">
<?php require '../../../../include/head.php'; ?>
<?php if (file_exists("adminer.css")) { ?>
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?>
<?php } ?>
<body class="<?php echo lang('ltr'); ?> nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);"<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " onload=\"verifyVersion('$VERSION');\""); ?>>
<?php /* devilbox edit */ echo loadClass('Html')->getNavbar(); error_reporting(6135);?>
<script type="text/javascript">
document.body.className = document.body.className.replace(/ nojs/, ' js');
var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
</script>
<?php require '../../../../config.php'; ?>
<?php error_reporting(6135); ?>
<?php require '../../../../include/navbar.php'; ?>
<?php error_reporting(6135); ?>
<div id="help" class="jush-<?php echo $jush; ?> jsonly hidden" onmouseover="helpOpen = 1;" onmouseout="helpMouseout(this, event);"></div>
<div id="content">
@ -138,5 +136,5 @@ function page_footer($missing = "") {
</div>
<script type="text/javascript">setupSubmitHighlight(document);</script>
<?php
}?>
<?php require '../../../../include/footer.php'; ?>
/* devilbox edit */ echo loadClass('Html')->getFooter(); error_reporting(6135);
}

View File

@ -141,7 +141,7 @@ function edit_type($key, $field, $collations, $foreign_keys = array()) {
global $structured_types, $types, $unsigned, $on_actions;
$type = $field["type"];
?>
<td><select name="<?php echo h($key); ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"<?php echo on_help("getTarget(event).value", 1); ?>><?php
<td><select name="<?php echo h($key); ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"<?php echo on_help("getTarget(event).value", 1); ?> aria-labelledby="label-type"><?php
if ($type && !isset($types[$type]) && !isset($foreign_keys[$type])) {
array_unshift($structured_types, $type);
}
@ -150,7 +150,7 @@ if ($foreign_keys) {
}
echo optionlist($structured_types, $type);
?></select>
<td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); ?> onchange="editingLengthChange(this);" onkeyup="this.onchange();"><td class="options"><?php //! type="number" with enabled JavaScript
<td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); ?> onchange="editingLengthChange(this);" onkeyup="this.onchange();" aria-labelledby="label-length"><td class="options"><?php //! type="number" with enabled JavaScript
echo "<select name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match('~((^|[^o])int|float|double|decimal)$~', $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), $field["on_update"]) . '</select>' : '');
@ -238,20 +238,20 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
?>
<thead><tr class="wrap">
<?php if ($type == "PROCEDURE") { ?><td>&nbsp;<?php } ?>
<th><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
<td><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;" onblur="editingLengthBlur(this);"></textarea>
<td><?php echo lang('Length'); ?>
<td><?php echo lang('Options'); ?>
<th id="label-name"><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
<td id="label-type"><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;" onblur="editingLengthBlur(this);"></textarea>
<td id="label-length"><?php echo lang('Length'); ?>
<td><?php echo lang('Options'); /* no label required, options have their own label */ ?>
<?php if ($type == "TABLE") { ?>
<td>NULL
<td><input type="radio" name="auto_increment_col" value=""><acronym title="<?php echo lang('Auto Increment'); ?>">AI</acronym><?php echo doc_link(array(
<td id="label-null">NULL
<td><input type="radio" name="auto_increment_col" value=""><acronym id="label-ai" title="<?php echo lang('Auto Increment'); ?>">AI</acronym><?php echo doc_link(array(
'sql' => "example-auto-increment.html",
'sqlite' => "autoinc.html",
'pgsql' => "datatype.html#DATATYPE-SERIAL",
'mssql' => "ms186775.aspx",
)); ?>
<td><?php echo lang('Default value'); ?>
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . ">" . lang('Comment') : ""); ?>
<td id="label-default"><?php echo lang('Default value'); ?>
<?php echo (support("comment") ? "<td id='label-comment'" . ($comments ? "" : " class='hidden'") . ">" . lang('Comment') : ""); ?>
<?php } ?>
<td><?php echo "<input type='image' class='icon' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
</thead>
@ -264,21 +264,21 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
?>
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
<?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]) : ""); ?>
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="editingNameChange(this);<?php echo ($field["field"] != "" || count($fields) > 1 ? '' : ' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);'); ?>" maxlength="64" autocapitalize="off"><?php } ?>
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="editingNameChange(this);<?php echo ($field["field"] != "" || count($fields) > 1 ? '' : ' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);'); ?>" maxlength="64" autocapitalize="off" aria-labelledby="label-name"><?php } ?>
<input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>">
<?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
<?php if ($type == "TABLE") { ?>
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block"); ?>
<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }"></label><td><?php
echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;">
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "'>" : ""); ?>
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block", "label-null"); ?>
<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }" aria-labelledby="label-ai"></label><td><?php
echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "label-default"); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;" aria-labelledby="label-default">
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "' aria-labelledby='label-comment'>" : ""); ?>
<?php } ?>
<?php
echo "<td>";
echo (support("move_col") ?
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editingAddRow(this, 1);'>&nbsp;"
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>&nbsp;"
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>&nbsp;"
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "' onclick='return !editingMoveRow(this, 1);'>&nbsp;"
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "' onclick='return !editingMoveRow(this, 0);'>&nbsp;"
: "");
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'fields\$1[field]');\">" : "");
echo "\n";
@ -290,7 +290,6 @@ echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input nam
* @return bool
*/
function process_fields(&$fields) {
ksort($fields);
$offset = 0;
if ($_POST["up"]) {
$last = 0;
@ -432,9 +431,9 @@ function create_routine($routine, $row) {
}
/** Remove current user definer from SQL command
* @param string
* @return string
*/
* @param string
* @return string
*/
function remove_definer($query) {
return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $query); //! proper escaping of user
}

View File

@ -69,7 +69,7 @@ function remove_slashes($process, $filter = false) {
*/
function bracket_escape($idf, $back = false) {
// escape brackets inside name="x[]"
static $trans = array(':' => ':1', ']' => ':2', '[' => ':3');
static $trans = array(':' => ':1', ']' => ':2', '[' => ':3', '"' => ':4');
return strtr($idf, ($back ? array_flip($trans) : $trans));
}
@ -112,11 +112,13 @@ function nl_br($string) {
* @param string
* @param string
* @param string
* @param string
* @return string
*/
function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "") {
function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "", $labelled_by = "") {
$return = "<input type='checkbox' name='$name' value='" . h($value) . "'"
. ($checked ? " checked" : "")
. ($labelled_by ? " aria-labelledby='$labelled_by'" : "")
. ($onclick ? ' onclick="' . h($onclick) . '"' : '')
. ">"
;
@ -152,11 +154,15 @@ function optionlist($options, $selected = null, $use_keys = false) {
* @param array
* @param string
* @param string true for no onchange, false for radio
* @param string
* @return string
*/
function html_select($name, $options, $value = "", $onchange = true) {
function html_select($name, $options, $value = "", $onchange = true, $labelled_by = "") {
if ($onchange) {
return "<select name='" . h($name) . "'" . (is_string($onchange) ? ' onchange="' . h($onchange) . '"' : "") . ">" . optionlist($options, $value) . "</select>";
return "<select name='" . h($name) . "'"
. (is_string($onchange) ? ' onchange="' . h($onchange) . '"' : "")
. ($labelled_by ? " aria-labelledby='$labelled_by'" : "")
. ">" . optionlist($options, $value) . "</select>";
}
$return = "";
foreach ($options as $key => $val) {
@ -237,7 +243,7 @@ function json_row($key, $val = null) {
echo "{";
}
if ($key != "") {
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'undefined');
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\t\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'null');
$first = false;
} else {
echo "\n}\n";
@ -406,10 +412,10 @@ function where($where, $fields = array()) {
$key = bracket_escape($key, 1); // 1 - back
$column = escape_key($key);
$return[] = $column
. (($jush == "sql" && preg_match('~^[0-9]*\\.[0-9]*$~', $val)) || $jush == "mssql"
? " LIKE " . q(addcslashes($val, "%_\\"))
. ($jush == "sql" && preg_match('~^[0-9]*\\.[0-9]*$~', $val) ? " LIKE " . q(addcslashes($val, "%_\\"))
: ($jush == "mssql" ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val))
: " = " . unconvert_field($fields[$key], q($val))
) // LIKE because of floats but slow with ints, in MS SQL because of text
)) // LIKE because of floats but slow with ints, in MS SQL because of text
; //! enum and set
if ($jush == "sql" && preg_match('~char|text~', $fields[$key]["type"]) && preg_match("~[^ -@]~", $val)) { // not just [a-z] to catch non-ASCII characters
$return[] = "$column = " . q($val) . " COLLATE " . charset($connection) . "_bin";
@ -471,18 +477,12 @@ function convert_fields($columns, $fields, $select = array()) {
*/
function cookie($name, $value, $lifetime = 2592000) { // 2592000 - 30 days
global $HTTPS;
$params = array(
$name,
(preg_match("~\n~", $value) ? "" : $value), // HTTP Response Splitting protection in PHP < 5.1.2
($lifetime ? time() + $lifetime : 0),
preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]),
"",
$HTTPS
);
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
$params[] = true; // HttpOnly
}
return call_user_func_array('setcookie', $params);
return header("Set-Cookie: $name=" . urlencode($value)
. ($lifetime ? "; expires=" . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT" : "")
. "; path=" . preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"])
. ($HTTPS ? "; secure" : "")
. "; HttpOnly; SameSite=lax",
false);
}
/** Restart stopped session
@ -744,7 +744,7 @@ function is_utf8($val) {
* @return string escaped string with appended ...
*/
function shorten_utf8($string, $length = 80, $suffix = "") {
if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{10FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match);
}
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>...</i>");
@ -884,6 +884,9 @@ function input($field, $value, $function) {
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
if ($input != "") {
echo $input;
} elseif (preg_match('~bool~', $field["type"])) {
echo "<input type='hidden'$attrs value='0'>" .
"<input type='checkbox'" . (in_array(strtolower($value), array('1', 't', 'true', 'y', 'yes', 'on')) ? " checked='checked'" : "") . "$attrs value='1'>";
} elseif ($field["type"] == "set") { //! 64 bits
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {
@ -901,7 +904,7 @@ function input($field, $value, $function) {
$attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
}
echo "<textarea$attrs>" . h($value) . '</textarea>';
} elseif ($function == "json") {
} elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
} else {
// int(3) is only a display hint
@ -911,8 +914,8 @@ function input($field, $value, $function) {
}
// type='date' and type='time' display localized value which may be confusing, type='datetime' uses 'T' as date and time separator
echo "<input"
. ((!$has_function || $function === "") && preg_match('~(?<!o)int~', $field["type"]) ? " type='number'" : "")
. " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "")
. ((!$has_function || $function === "") && preg_match('~(?<!o)int~', $field["type"]) && !preg_match('~\[\]~', $field["full_type"]) ? " type='number'" : "")
. " value='" . h($value) . "'" . ($maxlength ? " data-maxlength='$maxlength'" : "")
. (preg_match('~char|binary~', $field["type"]) && $maxlength > 20 ? " size='40'" : "")
. "$attrs>"
;
@ -1135,7 +1138,7 @@ function select_value($val, $link, $field, $text_length) {
$link = "mailto:$val";
}
if ($protocol = is_url($val)) {
$link = (($protocol == "http" && $HTTPS) || preg_match('~WebKit~i', $_SERVER["HTTP_USER_AGENT"]) // WebKit supports noreferrer since 2009
$link = (($protocol == "http" && $HTTPS) || preg_match('~WebKit|Firefox~i', $_SERVER["HTTP_USER_AGENT"]) // WebKit supports noreferrer since 2009, Firefox since version 38
? $val // HTTP links from HTTPS pages don't receive Referer automatically
: "https://www.adminer.org/redirect/?url=" . urlencode($val) // intermediate page to hide Referer
);
@ -1181,7 +1184,7 @@ function is_url($string) {
* @return bool
*/
function is_shortable($field) {
return preg_match('~char|text|lob|geometry|point|linestring|polygon|string~', $field["type"]);
return preg_match('~char|text|lob|geometry|point|linestring|polygon|string|bytea~', $field["type"]);
}
/** Get query to compute number of found rows
@ -1209,7 +1212,7 @@ function slow_query($query) {
$db = $adminer->database();
$timeout = $adminer->queryTimeout();
if (support("kill") && is_object($connection2 = connect()) && ($db == "" || $connection2->select_db($db))) {
$kill = $connection2->result("SELECT CONNECTION_ID()"); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
$kill = $connection2->result(connection_id()); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
?>
<script type="text/javascript">
var timeout = setTimeout(function () {

View File

@ -30,7 +30,7 @@ $langs = array(
'pt' => 'Português', // André Dias
'pt-br' => 'Português (Brazil)', // Gian Live - gian@live.com, Davi Alexandre davi@davialexandre.com.br, RobertoPC - http://www.robertopc.com.br
'ro' => 'Limba Română', // .nick .messing - dot.nick.dot.messing@gmail.com
'ru' => 'Русский язык', // Maksim Izmaylov
'ru' => 'Русский', // Maksim Izmaylov; Andre Polykanine - https://github.com/Oire/
'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com, Juraj Krivda - http://www.jstudio.cz
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com
'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com

View File

@ -16,10 +16,10 @@ if (extension_loaded('pdo')) {
try {
parent::__construct($dsn, $username, $password);
} catch (Exception $ex) {
auth_error($ex->getMessage());
auth_error(h($ex->getMessage()));
}
$this->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
$this->server_info = $this->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
$this->server_info = @$this->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
}
/*abstract function select_db($database);*/

View File

@ -0,0 +1,2 @@
<?php
$VERSION = "4.3.1";

View File

@ -1,12 +1,14 @@
<?php
/** Adminer - Compact database management
* @link https://www.adminer.org/
* @author Jakub Vrana, http://www.vrana.cz/
* @author Jakub Vrana, https://www.vrana.cz/
* @copyright 2007 Jakub Vrana
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
/* devilbox inject */ require '../../../../config.php'; error_reporting(6135);
include "./include/bootstrap.inc.php";
include "./include/tmpfile.inc.php";
@ -65,6 +67,8 @@ if (isset($_GET["download"])) {
include "./user.inc.php";
} elseif (isset($_GET["processlist"])) {
include "./processlist.inc.php";
} elseif (isset($_GET["replication"])) {
include "./replication.inc.php";
} elseif (isset($_GET["select"])) {
include "./select.inc.php";
} elseif (isset($_GET["variables"])) {

View File

@ -5,6 +5,9 @@ $table_status = table_status($TABLE, true);
if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.6 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
$index_types[] = "FULLTEXT";
}
if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.7 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
$index_types[] = "SPATIAL";
}
$indexes = indexes($TABLE);
$primary = array();
if ($jush == "mongo") { // doesn't support primary key
@ -93,9 +96,9 @@ if (!$row) {
<form action="" method="post">
<table cellspacing="0" class="nowrap">
<thead><tr>
<th><?php echo lang('Index Type'); ?>
<th><input type="submit" style="left: -1000px; position: absolute;"><?php echo lang('Column (length)'); ?>
<th><?php echo lang('Name'); ?>
<th id="label-type"><?php echo lang('Index Type'); ?>
<th><input type="submit" class="wayoff"><?php echo lang('Column (length)'); ?>
<th id="label-name"><?php echo lang('Name'); ?>
<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>&nbsp;
</thead>
<?php
@ -110,24 +113,24 @@ if ($primary) {
$j = 1;
foreach ($row["indexes"] as $index) {
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1));
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1), "label-type");
echo "<td>";
ksort($index["columns"]);
$i = 1;
foreach ($index["columns"] as $key => $column) {
echo "<span>" . select_input(
" name='indexes[$j][columns][$i]' onchange=\"" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . h(js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_")) . "');\"",
" name='indexes[$j][columns][$i]' onchange=\"" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . h(js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_")) . "');\" title='" . lang('Column') . "'",
($fields ? array_combine($fields, $fields) : $fields),
$column
);
echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "'>" : "");
echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "' title='" . lang('Length') . "'>" : "");
echo ($jush != "sql" ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
echo " </span>";
$i++;
}
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off'>\n";
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n";
echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n";
}
$j++;

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'كلمة المرور',
'Select database' => 'اختر قاعدة البيانات',
'Invalid database.' => 'قاعدة البيانات غير صالحة.',
'Create new database' => 'أنشئ فاعدة بيانات جديدة',
'Table has been dropped.' => 'تم حذف الجدول.',
'Table has been altered.' => 'تم تعديل الجدول.',
'Table has been created.' => 'تم إنشاء الجدول.',

View File

@ -82,7 +82,6 @@ $translations = array(
'Use' => 'Избор',
'Select database' => 'Избор на база данни',
'Invalid database.' => 'Невалидна база данни.',
'Create new database' => 'Нова база данни',
'Database has been dropped.' => 'Базата данни беше премахната.',
'Databases have been dropped.' => 'Базите данни бяха премехнати.',
'Database has been created.' => 'Базата данни беше създадена.',
@ -182,13 +181,12 @@ $translations = array(
'Values' => 'Стойности',
'View' => 'Изглед',
'Materialized View' => 'Запаметен изглед',
'Materialized view' => 'Запаметен изглед',
'View has been dropped.' => 'Изгледа беше премахнат.',
'View has been altered.' => 'Изгледа беше променен.',
'View has been created.' => 'Изгледа беше създаден.',
'Alter view' => 'Промяна на изглед',
'Create view' => 'Създаване на изглед',
'Create materialized view' => 'Създаване на запаметен изглед',
'Indexes' => 'Индекси',
'Indexes have been altered.' => 'Индексите бяха променени.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'পাসওয়ার্ড',
'Select database' => 'ডাটাবেজ নির্বাচন করো',
'Invalid database.' => 'ভুল ডাটাবেজ।',
'Create new database' => 'নতুন ডাটাবেজ তৈরী করো',
'Table has been dropped.' => 'টেবিল মুছে ফেলা হয়েছে।',
'Table has been altered.' => 'টেবিল সম্পাদনা করা হয়েছে।',
'Table has been created.' => 'টেবিল তৈরী করা হয়েছে।',

View File

@ -77,7 +77,6 @@ $translations = array(
'Use' => 'Koristi',
'Select database' => 'Izaberite bazu',
'Invalid database.' => 'Neispravna baza podataka.',
'Create new database' => 'Napravi novu bazu podataka',
'Database has been dropped.' => 'Baza podataka je izbrisana.',
'Databases have been dropped.' => 'Baze podataka su izbrisane.',
'Database has been created.' => 'Baza podataka je spašena.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Contrasenya',
'Select database' => 'Selecciona base de dades',
'Invalid database.' => 'Base de dades invàlida.',
'Create new database' => 'Crea una nova base de dades',
'Table has been dropped.' => 'S\'ha suprimit la taula.',
'Table has been altered.' => 'S\'ha modificat la taula.',
'Table has been created.' => 'S\'ha creat la taula.',

View File

@ -11,7 +11,7 @@ $translations = array(
'Logged as: %s' => 'Přihlášen jako: %s',
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
'Implement %s method to use SQLite.' => 'Pro přihlášení k SQLite implementujte metodu %s.',
'<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.' => 'Pro přihlášení k SQLite <a href="https://www.adminer.org/cs/extension/" target="_blank">implementujte</a> metodu %s.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minutu.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minuty.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minut.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Platnost hlavního hesla vypršela. <a href="https://www.adminer.org/cs/extension/" target="_blank">Implementujte</a> metodu %s, aby platilo stále.',
'Language' => 'Jazyk',
@ -45,6 +45,10 @@ $translations = array(
'Variables' => 'Proměnné',
'Status' => 'Stav',
'Replication' => 'Replikace',
'Master status' => 'Master status',
'Slave status' => 'Slave status',
'SQL command' => 'SQL příkaz',
'%d query(s) executed OK.' => array('%d příkaz proběhl v pořádku.', '%d příkazy proběhly v pořádku.', '%d příkazů proběhlo v pořádku.'),
'Query executed OK, %d row(s) affected.' => array('Příkaz proběhl v pořádku, byl změněn %d záznam.', 'Příkaz proběhl v pořádku, byly změněny %d záznamy.', 'Příkaz proběhl v pořádku, bylo změněno %d záznamů.'),
@ -84,7 +88,6 @@ $translations = array(
'Use' => 'Vybrat',
'Select database' => 'Vybrat databázi',
'Invalid database.' => 'Nesprávná databáze.',
'Create new database' => 'Vytvořit novou databázi',
'Database has been dropped.' => 'Databáze byla odstraněna.',
'Databases have been dropped.' => 'Databáze byly odstraněny.',
'Database has been created.' => 'Databáze byla vytvořena.',
@ -184,13 +187,12 @@ $translations = array(
'Values' => 'Hodnoty',
'View' => 'Pohled',
'Materialized View' => 'Materializovaný pohled',
'Materialized view' => 'Materializovaný pohled',
'View has been dropped.' => 'Pohled byl odstraněn.',
'View has been altered.' => 'Pohled byl změněn.',
'View has been created.' => 'Pohled byl vytvořen.',
'Alter view' => 'Pozměnit pohled',
'Create view' => 'Vytvořit pohled',
'Create materialized view' => 'Vytvořit materializovaný pohled',
'Indexes' => 'Indexy',
'Indexes have been altered.' => 'Indexy byly změněny.',
@ -337,4 +339,8 @@ $translations = array(
'Type has been dropped.' => 'Typ byl odstraněn.',
'Type has been created.' => 'Typ byl vytvořen.',
'Alter type' => 'Pozměnit typ',
'Replication' => null,
'Master status' => null,
'Slave status' => null,
);

View File

@ -68,7 +68,6 @@ $translations = array(
'Use' => 'Brug',
'Select database' => 'Vælg database',
'Invalid database.' => 'Ugyldig database.',
'Create new database' => 'Opret ny database',
'Database has been dropped.' => 'Databasen er blevet slettet.',
'Databases have been dropped.' => 'Databasene er blevet slettet.',
'Database has been created.' => 'Databasen er oprettet.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Passwort',
'Select database' => 'Datenbank auswählen',
'Invalid database.' => 'Datenbank ungültig.',
'Create new database' => 'Datenbank erstellen',
'Table has been dropped.' => 'Tabelle wurde entfernt.',
'Table has been altered.' => 'Tabelle wurde geändert.',
'Table has been created.' => 'Tabelle wurde erstellt.',

View File

@ -83,7 +83,6 @@ $translations = array(
'Use' => 'χρήση',
'Select database' => 'Επιλέξτε Β.Δ.',
'Invalid database.' => 'Άκυρη Β.Δ.',
'Create new database' => 'Δημιουργία νέας Β.Δ.',
'Database has been dropped.' => 'Η Β.Δ. διαγράφηκε.',
'Databases have been dropped.' => 'Οι Β.Δ. διαγράφηκαν.',
'Database has been created.' => 'Η Β.Δ. δημιουργήθηκε.',
@ -183,13 +182,12 @@ $translations = array(
'Values' => 'Τιμές',
'View' => 'Προβολή',
'Materialized View' => 'Υλοποιημένη Προβολή',
'Materialized view' => 'Υλοποιημένη προβολή',
'View has been dropped.' => 'Η προβολή διαγράφηκε.',
'View has been altered.' => 'Η προβολή τροποποιήθηκε.',
'View has been created.' => 'Η προβολή δημιουργήθηκε.',
'Alter view' => 'Τροποποίηση προβολής',
'Create view' => 'Δημιουργία προβολής',
'Create materialized view' => 'Δημιουργία Υλοποιημένης προβολής',
'Indexes' => 'Δείκτες',
'Indexes have been altered.' => 'Οι δείκτες τροποποιήθηκαν.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Contraseña',
'Select database' => 'Seleccionar Base de datos',
'Invalid database.' => 'Base de datos incorrecta.',
'Create new database' => 'Crear nueva base de datos',
'Table has been dropped.' => 'Tabla eliminada.',
'Table has been altered.' => 'Tabla modificada.',
'Table has been created.' => 'Tabla creada.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Parool',
'Select database' => 'Vali andmebaas',
'Invalid database.' => 'Tundmatu andmebaas.',
'Create new database' => 'Loo uus andmebaas',
'Table has been dropped.' => 'Tabel on edukalt kustutatud.',
'Table has been altered.' => 'Tabeli andmed on edukalt muudetud.',
'Table has been created.' => 'Tabel on edukalt loodud.',

View File

@ -81,7 +81,6 @@ $translations = array(
'Use' => 'استفاده',
'Select database' => 'انتخاب پایگاه داده',
'Invalid database.' => 'پایگاه داده نامعتبر.',
'Create new database' => 'ایجاد پایگاه داده جدید',
'Database has been dropped.' => 'پایگاه داده حذف شد.',
'Databases have been dropped.' => 'پایگاه های داده حذف شدند.',
'Database has been created.' => 'پایگاه داده ایجاد شد.',
@ -181,13 +180,12 @@ $translations = array(
'Values' => 'مقادیر',
'View' => 'نمایش',
'Materialized View' => 'نمایه مادی',
'Materialized view' => 'نمایه مادی',
'View has been dropped.' => 'نمایش حذف شد.',
'View has been altered.' => 'نمایش ویرایش شد.',
'View has been created.' => 'نمایش ایجاد شد.',
'Alter view' => 'حذف نمایش',
'Create view' => 'ایجاد نمایش',
'Create materialized view' => 'ایجاد نمایه مادی',
'Indexes' => 'ایندکسها',
'Indexes have been altered.' => 'ایندکسها ویرایش شدند.',

View File

@ -83,7 +83,6 @@ $translations = array(
'Use' => 'Käytä',
'Select database' => 'Valitse tietokanta',
'Invalid database.' => 'Tietokanta ei kelpaa.',
'Create new database' => 'Luo uusi tietokanta',
'Database has been dropped.' => 'Tietokanta on poistettu.',
'Databases have been dropped.' => 'Tietokannat on poistettu.',
'Database has been created.' => 'Tietokanta on luotu.',
@ -183,13 +182,12 @@ $translations = array(
'Values' => 'Arvot',
'View' => 'Näkymä',
'Materialized View' => 'Materialisoitunut näkymä',
'Materialized view' => 'Materialisoitunut näkymä',
'View has been dropped.' => 'Näkymä on poistettu.',
'View has been altered.' => 'Näkymää on muutettu.',
'View has been created.' => 'Näkymä on luotu.',
'Alter view' => 'Muuta näkymää',
'Create view' => 'Luo näkymä',
'Create materialized view' => 'Luo materialisoitunut näkymä',
'Indexes' => 'Indeksit',
'Indexes have been altered.' => 'Indeksejä on muutettu.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Mot de passe',
'Select database' => 'Sélectionner la base de données',
'Invalid database.' => 'Base de données invalide.',
'Create new database' => 'Créer une base de données',
'Table has been dropped.' => 'La table a été effacée.',
'Table has been altered.' => 'La table a été modifiée.',
'Table has been created.' => 'La table a été créée.',
@ -283,8 +282,7 @@ $translations = array(
'Saving' => 'Enregistrement',
'yes' => 'oui',
'no' => 'non',
'Materialized View' => 'Vue matérialisée',
'Create materialized view' => 'Créer une vue matérialisée',
'Materialized view' => 'Vue matérialisée',
'%d / ' => '%d / ',
'Limit rows' => 'Limiter les lignes',
'Default value' => 'Valeur par défaut',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Contrasinal',
'Select database' => 'Seleccionar Base de datos',
'Invalid database.' => 'Base de datos incorrecta.',
'Create new database' => 'Crear nova base de datos',
'Table has been dropped.' => 'Eliminouse a táboa.',
'Table has been altered.' => 'Modificouse a táboa.',
'Table has been created.' => 'Creouse a táboa.',
@ -267,10 +266,9 @@ $translations = array(
'Edit all' => 'Editar todo',
'HH:MM:SS' => 'HH:MM:SS',
'Tables have been optimized.' => 'Optimizáronse as táboas',
'Materialized View' => 'Vista materializada',
'Materialized view' => 'Vista materializada',
'Vacuum' => 'Baleirar',
'Selected' => 'Selección',
'Create materialized view' => 'Crear vista materializada',
'File must be in UTF-8 encoding.' => 'O ficheiro ten que estar codificado con UTF-8',
'Modify' => 'Modificar',
'Loading' => 'Cargando',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Jelszó',
'Select database' => 'Adatbázis kiválasztása',
'Invalid database.' => 'Érvénytelen adatbázis.',
'Create new database' => 'Új adatbázis',
'Table has been dropped.' => 'A tábla eldobva.',
'Table has been altered.' => 'A tábla módosult.',
'Table has been created.' => 'A tábla létrejött.',

View File

@ -10,11 +10,11 @@ $translations = array(
'Logout' => 'Keluar',
'Logged as: %s' => 'Masuk sebagai: %s',
'Logout successful.' => 'Berhasil keluar.',
'Invalid credentials.' => 'Akses invalid.',
'Invalid credentials.' => 'Akses tidak sah.',
'Language' => 'Bahasa',
'Invalid CSRF token. Send the form again.' => 'Token CSRF invalid. Kirim ulang formulir.',
'No extension' => 'Ekstensi tidak tersedia',
'None of the supported PHP extensions (%s) are available.' => 'Ekstensi PHP yang didukung (%s) tidak tersedia.',
'Invalid CSRF token. Send the form again.' => 'Token CSRF tidak sah. Kirim ulang formulir.',
'No extension' => 'Ekstensi tidak ada',
'None of the supported PHP extensions (%s) are available.' => 'Ekstensi PHP yang didukung (%s) tidak ada.',
'Session support must be enabled.' => 'Dukungan sesi harus aktif.',
'Session expired, please login again.' => 'Sesi habis, silakan masuk lagi.',
'%s version: %s through PHP extension %s' => 'Versi %s: %s dengan ekstensi PHP %s',
@ -44,26 +44,26 @@ $translations = array(
'SQL command' => 'Perintah SQL',
'%d query(s) executed OK.' => '%d kueri berhasil dijalankan.',
'Query executed OK, %d row(s) affected.' => 'Kueri berhasil, %d baris terpengaruh.',
'No commands to execute.' => 'Tiada perintah untuk dijalankan.',
'Error in query' => 'Kesalahan dalam kueri',
'No commands to execute.' => 'Tidak ada perintah untuk dijalankan.',
'Error in query' => 'Galat dalam kueri',
'Execute' => 'Jalankan',
'Stop on error' => 'Hentikan pada kesalahan',
'Show only errors' => 'Hanya tampilkan kesalahan',
'Stop on error' => 'Hentikan jika galat',
'Show only errors' => 'Hanya tampilkan galat',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Riwayat',
'Clear' => 'Bersihkan',
'Edit all' => 'Edit semua',
'Edit all' => 'Sunting semua',
'File upload' => 'Unggah berkas',
'From server' => 'Dari server',
'Webserver file %s' => 'Berkas server web %s',
'Run file' => 'Jalankan berkas',
'File does not exist.' => 'Berkas tidak ditemukan.',
'File does not exist.' => 'Berkas tidak ada.',
'File uploads are disabled.' => 'Pengunggahan berkas dimatikan.',
'Unable to upload a file.' => 'Tidak dapat mengunggah berkas.',
'Maximum allowed file size is %sB.' => 'Besar berkas yang diizinkan adalah %s bita.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Data POST terlalu besar. Kurangi data atau perbesar pengarah konfigurasi %s.',
'Maximum allowed file size is %sB.' => 'Besar berkas yang diizinkan adalah %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Data POST terlalu besar. Kurangi data atau perbesar direktif konfigurasi %s.',
'Export' => 'Ekspor',
'Output' => 'Hasil',
@ -76,19 +76,18 @@ $translations = array(
'database' => 'basis data',
'Use' => 'Gunakan',
'Select database' => 'Pilih basis data',
'Invalid database.' => 'Basis data invalid.',
'Create new database' => 'Buat basis data baru',
'Invalid database.' => 'Basis data tidak sah.',
'Database has been dropped.' => 'Basis data berhasil dihapus.',
'Databases have been dropped.' => 'Basis data berhasil dihapus.',
'Database has been created.' => 'Basis data berhasil dibuat.',
'Database has been renamed.' => 'Basis data berhasil diganti nama.',
'Database has been renamed.' => 'Basis data berhasil diganti namanya.',
'Database has been altered.' => 'Basis data berhasil diubah.',
'Alter database' => 'Ubah basis data',
'Create database' => 'Buat basis data',
'Database schema' => 'Skema basis data',
// link to current database schema layout
'Permanent link' => 'Tautan permanen',
'Permanent link' => 'Pranala permanen',
// thousands separator - must contain single byte
',' => '.',
@ -113,9 +112,9 @@ $translations = array(
'Tables have been copied.' => 'Tabel berhasil disalin.',
'Routines' => 'Rutin',
'Routine has been called, %d row(s) affected.' => array('Rutin telah dipanggil, %d baris terpengaruh.', 'Rutin telah dipanggil, %d baris terpengaruh'),
'Routine has been called, %d row(s) affected.' => 'Rutin telah dipanggil, %d baris terpengaruh.',
'Call' => 'Panggilan',
'Parameter name' => 'Nama paramater',
'Parameter name' => 'Nama parameter',
'Create procedure' => 'Buat prosedur',
'Create function' => 'Buat fungsi',
'Routine has been dropped.' => 'Rutin berhasil dihapus.',
@ -123,14 +122,14 @@ $translations = array(
'Routine has been created.' => 'Rutin berhasil dibuat.',
'Alter function' => 'Ubah fungsi',
'Alter procedure' => 'Ubah prosedur',
'Return type' => 'Jenis balikan',
'Return type' => 'Jenis pengembalian',
'Events' => 'Peristiwa',
'Event has been dropped.' => 'Peristiwa berhasil dihapus.',
'Event has been altered.' => 'Peristiwa berhasil diubah.',
'Event has been created.' => 'Peristiwa berhasil dibuat.',
'Alter event' => 'Ubah peristiwa',
'Create event' => 'Buat peristiwa',
'Events' => 'Even',
'Event has been dropped.' => 'Even berhasil dihapus.',
'Event has been altered.' => 'Even berhasil diubah.',
'Event has been created.' => 'Even berhasil dibuat.',
'Alter event' => 'Ubah even',
'Create event' => 'Buat even',
'At given time' => 'Pada waktu tertentu',
'Every' => 'Setiap',
'Schedule' => 'Jadwal',
@ -141,7 +140,7 @@ $translations = array(
'Tables' => 'Tabel',
'Tables and views' => 'Tabel dan tampilan',
'Table' => 'Tabel',
'No tables.' => 'Tiada tabel.',
'No tables.' => 'Tidak ada tabel.',
'Alter table' => 'Ubah tabel',
'Create table' => 'Buat tabel',
'Table has been dropped.' => 'Tabel berhasil dihapus.',
@ -156,16 +155,16 @@ $translations = array(
'Column name' => 'Nama kolom',
'Type' => 'Jenis',
'Length' => 'Panjang',
'Auto Increment' => 'Kenaikan Otomatis',
'Auto Increment' => 'Inkrementasi Otomatis',
'Options' => 'Opsi',
'Comment' => 'Komentar',
'Default values' => 'Nilai bawaan',
'Drop' => 'Hapus',
'Are you sure?' => 'Anda yakin',
'Are you sure?' => 'Anda yakin?',
'Move up' => 'Naik',
'Move down' => 'Turun',
'Remove' => 'Hapus',
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Jumlah ruas maksimum yang diizinkan dilewati. Harap naikkan %s.',
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Sudah lebih dumlah ruas maksimum yang diizinkan. Harap naikkan %s.',
'Partition by' => 'Partisi menurut',
'Partitions' => 'Partisi',
@ -202,15 +201,15 @@ $translations = array(
'ON UPDATE' => 'ON UPDATE',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Kolom sumber dan sasaran harus memiliki jenis data yang sama. Kolom sasaran harus memiliki indeks dan data rujukan harus ada.',
'Triggers' => 'Picu',
'Add trigger' => 'Tambah picu',
'Trigger has been dropped.' => 'Picu berhasil dihapus.',
'Trigger has been altered.' => 'Picu berhasil diubah.',
'Trigger has been created.' => 'Picu berhasil dibuat.',
'Alter trigger' => 'Ubah picu',
'Create trigger' => 'Buat picu',
'Triggers' => 'Pemicu',
'Add trigger' => 'Tambah pemicu',
'Trigger has been dropped.' => 'Pemicu berhasil dihapus.',
'Trigger has been altered.' => 'Pemicu berhasil diubah.',
'Trigger has been created.' => 'Pemicu berhasil dibuat.',
'Alter trigger' => 'Ubah pemicu',
'Create trigger' => 'Buat pemicu',
'Time' => 'Waktu',
'Event' => 'Peristiwa',
'Event' => 'Even',
'Name' => 'Nama',
'select' => 'pilih',
@ -221,14 +220,14 @@ $translations = array(
'Search' => 'Cari',
'anywhere' => 'di mana pun',
'Search data in tables' => 'Cari data dalam tabel',
'Sort' => 'Urutan',
'Sort' => 'Urutkan',
'descending' => 'menurun',
'Limit' => 'Limit',
'Limit' => 'Batas',
'Text length' => 'Panjang teks',
'Action' => 'Tindakan',
'Full table scan' => 'Pindai tabel lengkap',
'Unable to select the table' => 'Gagal memilih tabel',
'No rows.' => 'Tiada baris.',
'No rows.' => 'Tidak ada baris.',
'%d row(s)' => '%d baris',
'Page' => 'Halaman',
'last' => 'terakhir',
@ -239,7 +238,7 @@ $translations = array(
'%d row(s) have been imported.' => '%d baris berhasil diimpor.',
// in-place editing in select
'Use edit link to modify this value.' => 'Gunakan tautan edit untuk mengubah nilai ini.',
'Use edit link to modify this value.' => 'Gunakan pranala suntingan untuk mengubah nilai ini.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Entri%s berhasil disisipkan.',
@ -247,30 +246,30 @@ $translations = array(
'Item has been updated.' => 'Entri berhasil diperbarui.',
'%d item(s) have been affected.' => '%d entri terpengaruh.',
'New item' => 'Entri baru',
'original' => 'orisinal',
'original' => 'asli',
// label for value '' in enum data type
'empty' => 'kosong',
'edit' => 'edit',
'Edit' => 'Edit',
'edit' => 'sunting',
'Edit' => 'Sunting',
'Insert' => 'Sisipkan',
'Save' => 'Simpan',
'Save and continue edit' => 'Simpan dan terus mengedit',
'Save and insert next' => 'Simpan dan sisipkan yang lain',
'Save and continue edit' => 'Simpan dan lanjut menyunting',
'Save and insert next' => 'Simpan dan sisipkan berikutnya',
'Clone' => 'Gandakan',
'Delete' => 'Hapus',
'E-mail' => 'Surel',
'From' => 'Dari',
'Subject' => 'Subjek',
'Subject' => 'Judul',
'Attachments' => 'Lampiran',
'Send' => 'Kirim',
'%d e-mail(s) have been sent.' => array('%d surel berhasil dikirim.', '%d surel berhasil dikirim'),
'%d e-mail(s) have been sent.' => '%d surel berhasil dikirim.',
// data type descriptions
'Numbers' => 'Angka',
'Date and time' => 'Tanggal dan waktu',
'Strings' => 'String',
'Binary' => 'Biner',
'Binary' => 'Binari',
'Lists' => 'Daftar',
'Network' => 'Jaringan',
'Geometry' => 'Geometri',
@ -298,7 +297,7 @@ $translations = array(
'Schema has been created.' => 'Skema berhasil dibuat.',
'Schema has been altered.' => 'Skema berhasil diubah.',
'Schema' => 'Skema',
'Invalid schema.' => 'Skema invalid.',
'Invalid schema.' => 'Skema tidak sah.',
// PostgreSQL sequences support
'Sequences' => 'Deret',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Password',
'Select database' => 'Seleziona database',
'Invalid database.' => 'Database non valido.',
'Create new database' => 'Crea nuovo database',
'Table has been dropped.' => 'Tabella eliminata.',
'Table has been altered.' => 'Tabella modificata.',
'Table has been created.' => 'Tabella creata.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'パスワード',
'Select database' => 'データベースを選択してください',
'Invalid database.' => '不正なデータベース',
'Create new database' => '新規にデータベースを作成',
'Table has been dropped.' => 'テーブルを削除しました',
'Table has been altered.' => 'テーブルを変更しました',
'Table has been created.' => 'テーブルを作成しました',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => '비밀번호',
'Select database' => '데이터베이스를 선택하십시오.',
'Invalid database.' => '잘못된 데이터베이스입니다.',
'Create new database' => '새 데이터베이스 만들기',
'Table has been dropped.' => '테이블을 삭제했습니다.',
'Table has been altered.' => '테이블을 변경했습니다.',
'Table has been created.' => '테이블을 만들었습니다.',

View File

@ -77,7 +77,6 @@ $translations = array(
'Use' => 'Naudoti',
'Select database' => 'Pasirinkti duomenų bazę',
'Invalid database.' => 'Neteisinga duomenų bazė.',
'Create new database' => 'Sukurti naują duomenų bazę',
'Database has been dropped.' => 'Duomenų bazė panaikinta.',
'Databases have been dropped.' => 'Duomenų bazės panaikintos.',
'Database has been created.' => 'Duomenų bazė sukurta.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Wachtwoord',
'Select database' => 'Database selecteren',
'Invalid database.' => 'Ongeldige database.',
'Create new database' => 'Nieuwe database',
'Table has been dropped.' => 'Tabel verwijderd.',
'Table has been altered.' => 'Tabel aangepast.',
'Table has been created.' => 'Tabel aangemaakt.',
@ -61,7 +60,7 @@ $translations = array(
'Action' => 'Acties',
'edit' => 'bewerk',
'Page' => 'Pagina',
'Query executed OK, %d row(s) affected.' => array('Query uitgevoerd, %d rij geraakt.', 'Query uitgevoerd, %d rijen geraakt.'),
'Query executed OK, %d row(s) affected.' => array('Query uitgevoerd, %d rij geraakt.', 'Query uitgevoerd, %d rijen beïnvloed.'),
'Error in query' => 'Fout in query',
'Execute' => 'Uitvoeren',
'Table' => 'Tabel',

View File

@ -68,7 +68,6 @@ $translations = array(
'Use' => 'Bruk',
'Select database' => 'Velg database',
'Invalid database.' => 'Ugyldig database.',
'Create new database' => 'Lag ny database',
'Database has been dropped.' => 'Databasen har blitt slettet.',
'Databases have been dropped.' => 'Databasene har blitt slettet.',
'Database has been created.' => 'Databasen er opprettet.',

View File

@ -82,7 +82,6 @@ $translations = array(
'Use' => 'Wybierz',
'Select database' => 'Wybierz bazę danych',
'Invalid database.' => 'Nie znaleziono bazy danych.',
'Create new database' => 'Utwórz nową bazę danych',
'Database has been dropped.' => 'Baza danych została usunięta.',
'Databases have been dropped.' => 'Bazy danych zostały usunięte.',
'Database has been created.' => 'Baza danych została utworzona.',
@ -182,13 +181,12 @@ $translations = array(
'Values' => 'Wartości',
'View' => 'Perspektywa',
'Materialized View' => 'Zmaterializowana perspektywa',
'Materialized view' => 'Zmaterializowana perspektywa',
'View has been dropped.' => 'Perspektywa została usunięta.',
'View has been altered.' => 'Perspektywa została zmieniona.',
'View has been created.' => 'Perspektywa została utworzona.',
'Alter view' => 'Zmień perspektywę',
'Create view' => 'Utwórz perspektywę',
'Create materialized view' => 'Utwórz zmaterializowaną perspektywę',
'Indexes' => 'Indeksy',
'Indexes have been altered.' => 'Indeksy zostały zmienione.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Senha',
'Select database' => 'Selecionar Base de dados',
'Invalid database.' => 'Base de dados inválida.',
'Create new database' => 'Criar nova base de dados',
'Table has been dropped.' => 'A Tabela foi eliminada.',
'Table has been altered.' => 'A Tabela foi alterada.',
'Table has been created.' => 'A Tabela foi criada.',

View File

@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Senha',
'Select database' => 'Selecionar Base de dados',
'Invalid database.' => 'Base de dados inválida.',
'Create new database' => 'Criar nova base de dados',
'Table has been dropped.' => 'Tabela eliminada.',
'Table has been altered.' => 'Tabela modificada.',
'Table has been created.' => 'Tabela criada.',

Some files were not shown because too many files have changed in this diff Show More