Importación inicial

git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoArmarios_Web/trunk@8 5f5cdc87-09bc-1947-a3a7-c45bb6b47c2a
This commit is contained in:
David Arranz 2007-06-18 10:53:18 +00:00
parent ecdadd4b41
commit 39292d680f
1544 changed files with 133485 additions and 0 deletions

30
Source/Disk Start.vbs Normal file
View File

@ -0,0 +1,30 @@
' Name: Start MS-DOS File
' Created By: The Uniform Server Development Team
' Edited Last By: Olajide Olaolorun (empirex)
' Comment: Re-Arranged everything to look nicely.
' To Developers: Added the MySQL start option.
Dim WSHShell, dir, fso, f1
Set fso = CreateObject("Scripting.FileSystemObject")
Set WSHShell = WScript.CreateObject("WScript.Shell")
' Uncoment next line to ask about virtual disk for server (useful for CD or USB stick distributions)
s=InputBox("Specify a Disk Drive for the Server to use... (one character please)","Server Disk","W")
If intDoIt = vbCancel Then
WScript.Quit
End If
s=mid(s,1,1)
t=MsgBox("Start the MySQL Database Server?", vbYesNo + vbQuestion, "Database Support")
If intDoIt = vbNo Then
m=""
Else
m=" mysql"
End If
WSHShell.run "Server_Start.bat "&s&m,0,0
WScript.sleep(1000)
' --- If you do not want to open default browser at server start - Not needed, Commented
'WSHShell.run "udrive\home\admin\www\redirect.html"

64
Source/Server_Start.bat Normal file
View File

@ -0,0 +1,64 @@
: Name: Start Server File
: Created By: The Uniform Server Development Team
: Edited Last By: Olajide Olaolorun (empirex)
: Comment: After start, go to apanel directly.
: To Developers: Implemented %www%, and %apanel% :)
@echo off
rem use: start mysql console - to start mysql at server start and display console
rem use: start mysql - to start mysql at server start
rem use: start nomysql console - to display console
udrive\home\admin\program\pskill.exe Apache.exe
if errorlevel 2 goto :PAUSE
if not errorlevel 1 goto :STARTED
set Disk=%1
if "%Disk%"=="" set Disk=w
rem create the disk
subst %Disk%: "udrive"
if errorlevel 1 goto :HINT
set apachepath=\usr\local\apache2\
set apacheit=%Disk%:%apachepath%bin\Apache.exe -f %apachepath%conf\httpd.conf -d %apachepath%.
set programit=%Disk%:\home\admin\program\
set closeit=%programit%close.bat %Disk%
%Disk%:
cd \usr\local\php
if "%2"=="mysql" start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf
CLS
echo The server is working on the disk %Disk%:\ [http/127.0.0.1/apanel/]
set www=\www\
set apanel=\home\admin\www\
start %apanel%\redirect.html
if "%3"=="console" goto :CONSOLE
start %programit%uniserv.exe "%apacheit%" "%closeit%"
goto :END
:CONSOLE
%apacheit%
%closeit%
goto :END
:HINT
CLS
echo The disk %Disk% is busy. Use start.bat [disk letter]
goto :PAUSE
:STARTED
CLS
echo ERROR!!!
echo One of the instances of Apache server is started. Use stop.bat
:PAUSE
echo .
pause
:END

16
Source/Stop.bat Normal file
View File

@ -0,0 +1,16 @@
: Name: Stop Server File
: Created By: The Uniform Server Development Team
: Edited Last By: Olajide Olaolorun (empirex)
: Comment: Tara's new syetm of shutting down the server
: To Developers: Implemented a new system of server shutdown
@echo off
udrive\home\admin\program\pskill.exe Apache.exe c
if errorlevel 2 goto :PAUSE
:PAUSE
echo .
pause
:END

BIN
Source/UniController.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
[ViewState]
Mode=
Vid=
FolderType=Documents

View File

@ -0,0 +1,216 @@
-------------------------
Uniform Server Change Log
-------------------------
3.4 - phpMyAdmin updated to 2.10.1;
- eAccelerator 0.9.5.1 + Control Panel
- MySQL updated to 5.0.41;
- Apache updated to 2.0.59;
- PHP & PHP Extensions updated to 5.2.3;
- ActivePerl updated to 5.8.8.820;
- phpMyBackupPro updated to - 2.1;
- Admin Panel 2.0 Updated;
- Service Scripts Updated/Bug Fixes;
- Scroller Fixed/Removed
- core server arcitecture/structure updated;
...
3.3 - phpMyAdmin updated to 2.6.4-pl4;
- MySQL updated to 5.1.17;
- Apache updated to 2.0.55;
- PHP & PHP Extensions updated to 5.1.1;
- ActivePerl updated to 5.8.7.815;
- phpMyBackupPro Added - 1.7.1;
- New Admin Panel 2.0 - Alpha Release;
- Multilingual;
- SSL PreInstalled;
- Service Scripts Updated/Bug Fix
- New Start Page;
- Plugin System Suitable;
- core server arcitecture/structure updated;
...
3.2a - Apache updated to 2.0.54;
- PHP updated to 5.0.4;
- MySQL updated to 4.1.12a;
- ActivePerl updated to 5.8.7.813;
- phpMyAdmin updated to 2.6.3-rc1;
3.2 - Apache updated to 2.0.50;
- PHP updated to 5.0.0;
- MySQL updated to 4.0.20d;
- ActivePerl updated to 5.8.4.810;
- phpMyAdmin updated to 2.6.0-beta2;
- PHP GD2,mysql and sockets extentions included;
- Script to convert server to NTservices works again;
- Turck MMCache removed;
- core server arcitecture improved;
...
3.1 - ActivePerl updated to 5.8.0.809;
- MySQL updated to 4.0.18;
- phpMyAdmin updated to 2.5.6;
- secure.pm allow from 127.0.0.1;
- bugfix in start.bat "subst /D";
- AddType Application/x-httpd-php-source .phps
3.0 - ActivePerl updated to 5.8.0.808;
- MySQL updated to 4.0.17;
- phpMyAdmin updated to 2.5.5-RC2;
- Check for old Apache in start.bat.
- perl location changed to \usr\bin;
- \home\unix deleted;
- mod_dav for dav-fs support added;
- many minor and major corrections;
- now it is possible to change the server disk!
- Script to convert server to NTservices temporally disabled;
- very new concept!!!
2.8a - PHP updated to 4.3.4;
- Turck MMCache 2.4.6 added;
- Kill old Apache in start.bat.
- PHP: go-pear.bat added;
- mod_deflate for output compression added;
- few minor corrections;
2.8 - Apache updated to 2.0.48;
- PHP updated to 4.3.4RC3;
- phpMyAdmin updated to 2.5.4;
- MySQL updated to 4.0.16;
- 1 second pause in start.vbs.
- PHP Zend Optimizer removed (module may be);
2.7 - Apache updated to 2.0.47;
- PHP updated to 4.3.3;
- PHP Zend Optimizer v2.1.0 included;
- phpMyAdmin updated to 2.5.3;
- MySQL updated to 4.0.15;
2.6 - phpMyAdmin updated to 2.5.1;
- PHP updated to 4.3.2;
- AddHandler in httpd.conf resolved;
2.5 - Apache updated to 2.0.46;
- PHP updated to 4.3.2RC4;
- MySQL updated to 4.0.13;
- phpMyAdmin updated to 2.5.1-rc1;
- ActivePerl updated to 5.8.0.806;
- AddHandler in httpd.conf still not resolved;
2.4 - Apache updated to 2.0.45;
- a bug with AddHandler in httpd.conf corrected;
2.3 - phpMyAdmin updated to 2.4.0;
- MySQL updated to 4.0.12 and included by default;
2.3a1 - PHP updated to 4.3.1;
- phpMyAdmin updated to 2.4.0-rc2;
- PrcView updated to 3.7.2.5;
- double php.ini removed;
- configuration script corrected;
- Some Perl modules added by default;
2.2 - Server directory renamed to UniServer_XX for better compatibility;
- phpMyAdmin updated to 2.4.0-rc1;
- by default PHP loads as "Apache 2.0 Filter";
- in "httpd.conf" one can chouse way in which PHP interacts with Apache;
- the server serves two copies of php.ini see php.ini;
- a patch to correct win98 error applied to Apache 2.0.44;
- my-small.cnf corrected "skip-innodb" by default;
- Start.vbs added options for start of MySQL and browser;
- Start.vbs starts browser by default;
- a lot of minor corrections;
2.1 - Apache updated to 2.0.44;
- ActivePerl updated to ActivePerl 5.8.0.804;
- Uniconfig.php corrected;
- Start.vbs for hidden start added;
2.0 - PHP updated to 4.3.0;
- MySQL updated to 3.23.54a;
- phpMyAdmin updated to 2.3.3pl1;
- Few mistakes corrected.
2b4 - MySQL configuration file created;
- phpMyAdmin updated to 2.3.3;
- MySQL control scripts changed;
- Few minor bugs corrected;
2b3 - MySQL updated to 3.23.53-max;
- PrcView updated to 3.7.2.4;
- phpMyAdmin updated to 2.3.2;
2b2 - Apache updated to 2.0.43;
- Added security check in administration scripts;
- In php.ini session.save_path =w:/tmp;
2b1 - Apache updated to 2.0.42;
- PHP updated to 4.2.3;
- phpMyAdmin updated to 2.3.1;
- Added update script;
- A bug in MySQL control scripts corrected;
2a2 - MySQL updated to 3.23.52;
- PERl updated to 5.6.1.633;
- Added script to convert server to NTservices;
- Additional futures of PhpMyAdmin preconfigured;
- Added plugis directory;
- A lot of minor and major corrections;
2a1 - The server combined into one distribution;
- WSH is not required any more;
- "Serveradmin" directory renamed to "admin";
- administration scripts modified;
- execution of cgi scripts outside of defined aliases restricted;
- phpMyAdmin updated to 2.3.0;
- 7z archive used for is distribution packages;
- Added scripts to control Apache2 as service on windows NT.
1.10.NT - Uniform server configuration script extended;
- windows to unix script bug corrected;
- phpMyAdmin updated to 2.3.0-rc4
- start.vbs - starts browser;
- short documentation added;
- Register globals in PHP.ini is on by default!!!
(not most secure but compatible with old scripts);
- A lot of minor corrections;
1.9.NT - PHP updated to 4.2.2.
1.8.NT - PHP.ini minor bug corrected;
- unused apache modules deleted;
- The distributions are split for 95, 98 or ME and NT, 2000 or XP;
1.8 - Design of main page optimized;
- Apache configuration added;
- Administration scripts corrected;
1.7 - Apache, MySQL, PhpMyadmin - Updated;
- Minor bugfix and optimization;
1.6.1 - The problem with mysql stop corrected;
1.6 - Minor bugfix;
- Server temporally directory improved;
- httpd.conf -> LogFormat -> combined;
1.5 - Major bugfix;
- documentation links added;
1.4 - Bug fix;
- security update;
- test pages added;
1.3 - First public release.
-----------------------------------------------------------
Copyright 2002-2007 The Uniform Server Development Team
All rights reserved.
The authors were trying to make the best product so they
cannot be held responsible for any type of damage or
problems caused by using this or another software.

View File

@ -0,0 +1,35 @@
----------------------
Uniform Server License
----------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------
Copyright 2002-2007 The Uniform Server Development Team
All rights reserved.
The authors were trying to make the best product so they
cannot be held responsible for any type of damage or
problems caused by using this or another software.

View File

@ -0,0 +1,59 @@
------------
Read Me File
------------
The Uniform Server is a free product and do not contain commercial software!
You can use it for free.
- No installation required!
-------------------
System Requirements
-------------------
- Windows 95 or 98 or ME or NT or 2000 or XP.
- TCP/IP protocol support.
-----------------------
To enable Apache server
-----------------------
- Switch on TCP/IP network protocol (if you have no network card just install something).
-------------------
Starting the server
-------------------
- Run Server Start.vbs or Start.bat (and you will have by default W:\ disk that is server).
- It should automatically open up a browser that will connect to http://localhost/apanel/ or by IP address http://127.0.0.1/apanel/.
- To start as service on NT run plugins\Services\Run.bat (!!! be sure you know what you are doing).
------------------------
Shutting down the server
------------------------
- To correctly shutdown run Stop.bat.
- Admin Panel link also works.
--------------------------
Troubleshooting the server
--------------------------
- If Disk W already exists, use Disk Start.vbs
- Make sure you are online to get the news feed if using Admin Panel Pro.
- If Port 80 is already opened, disable the program or whatever it is that is using it.
- If others, go to http://forum.uniformserver.com
-----------------------------------------------------------
Copyright 2002-2007 The Uniform Server Development Team
All rights reserved.
The authors were trying to make the best product so they
cannot be held responsible for any type of damage or
problems caused by using this or another software.

View File

@ -0,0 +1,123 @@
--------------------
The Server Structure
--------------------
w:\www
Document root (/).
By default:
ReadmeName README.html
HeaderName HEADER.html
server-parsed .shtml .shtm .sht
DirectoryIndex index.html index.shtml index.html.var
index.htm index.php3 index.php index.pl
index.cgi
w:\www\images
Images directory
w:\cgi-bin
Script root (/cgi-bin/).
By default:
cgi-script .bat .exe .pl .cgi
w:\home
Users home page.
w:\home\admin
Administration page.
w:\home\admin\Www
Server administration pages root (/apanel/);
w:\home\admin\www/cgi-bin
Server administration script root (/apanel/cgi-bin/);
w:\home\admin\program
Server administration programs;
w:\home\admin\Www\phpMyAdmin
MySQL administrator (/apanel/phpMyAdmin/)
w:\home\admin\Www\plugins
Admin Plugins directory.
w:\home\admin\www\icons
Admin Panel Icons
w:\home\admin\www\images
Admin Panel Images
w:\home\admin\www\rss
RSS Parser
W:\usr
User Program directory
w:\usr\bin
PERL folder.
w:\usr\lib
Selected PERL libraries. To have all libraries download "perl_modules"
w:\usr\local
Program folder.
w:\usr\local\apache2
Apache2 folder.
w:\usr\local\apache2\bin
Apache2 binaries.
A copy of php.ini should be placed here for php module!
w:\usr\local\apache2\conf
Apache2 configuration files. (see httpd.conf)
w:\usr\local\apache2\icons
Apache2 icons.
w:\usr\local\apache2\logs
Apache2 logs.
w:\usr\local\apache2\modules
w:\usr\local\mysql
MySQL folder.
w:\usr\local\mysql\bin
MySQL binaries.
w:\usr\local\mysql\data
MySQL databases.
w:\usr\local\mysql\share
MySQL share.
w:\usr\local\php
PHP folder. (see php.ini)
By default:
register_globals = On - But you should do your best to write
your scripts so that they do not require register_globals to be on.
The easy way to use such variables "$step=$HTTP_POST_VARS['Submit'];".
Or "import_request_variables("gP", "st");" - see PHP documentation.
w:\usr\local\php\logs
PHP log files
w:\usr\local\php\extensions
PHP Extensions
w:\tmp
Temporally folder.
W:\plugins
Server Plugins durectory.
w:\plugins\Services
Uniform Server Sercives Script (For NT)
w:\docs
Uniform Server Documentation (/docs/)
w:\docs\src
Uniform Server Source Files
w:\htpasspwd
Uniform Server HTPASSWD dirctory
By default:
Contains the dir for the htpasswds of admin and www
-----------------------------------------------------------
Copyright 2002-2007 The Uniform Server Development Team
All rights reserved.
The authors were trying to make the best product so they
cannot be held responsible for any type of damage or
problems caused by using this or another software.

View File

@ -0,0 +1,290 @@
// Copyright 2004 - 2007 The Uniform Server Development Team
// Kills application
// version 1.1
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <stddef.h>
#include <tlhelp32.h>
enum tagErrorCodes
{
ERROR_SYSTEM = 2,
ERROR_PLATFORM,
ERROR_USAGE
};
/*
* type definition for application-defined callback function
*/
typedef BOOL (CALLBACK *LPCALLBACK)(DWORD, LPTSTR, LPTSTR, LPARAM);
/*
* callback function for application-defined logic
* return: TRUE - to continue enumeration
* FALSE - to stop enumeration
*/
BOOL CALLBACK
EnumCallback(DWORD dwProcessID, LPTSTR lpProcessName,
LPTSTR lpTargetName, LPARAM lParam)
{
if ( _tcsicmp(lpProcessName, lpTargetName) == 0 )
if ( (BOOL)lParam ) // query only
{
_tprintf(_T("%s is running.\n"), lpProcessName);
return FALSE;
}
else // kill if matched
{
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE,
FALSE, dwProcessID);
if ( hProcess )
{
TerminateProcess(hProcess, (DWORD) -1);
CloseHandle(hProcess);
}
}
return TRUE;
}
/*
* exit the current process after printing an optional error message
*/
static void
ErrorExit(LPTSTR lpErrMsg, UINT uExitCode)
{
if ( lpErrMsg )
switch ( uExitCode )
{
case ERROR_SYSTEM:
_tprintf(_T("System error: %s\n"), lpErrMsg);
break;
case ERROR_USAGE:
_tprintf(_T("%s\n\n"), lpErrMsg); // print an extra blank line
break; // above the usage message
default:
_tprintf(_T("%s\n"), lpErrMsg);
break;
}
// print usage on usage error regardless of lpErrMsg
if ( uExitCode == ERROR_USAGE )
_tprintf(_T("%s\n\n%s\n%s\n"),
_T("Usage: pskill <ProcessName> [c]"),
_T(" with c - kill the process"),
_T(" without c - query only"));
ExitProcess(uExitCode);
}
/*
* enumerate processes using PSAPI
*/
static int
EnumPSAPI(LPCALLBACK lpCallback, LPTSTR lpTargetName, LPARAM lParam)
{
typedef BOOL (WINAPI *LPEP)(DWORD *, DWORD, DWORD *);
typedef BOOL (WINAPI *LPEPM)(HANDLE, HMODULE *, DWORD, LPDWORD);
typedef DWORD (WINAPI *LPGMBN)(HANDLE, HMODULE, LPTSTR, DWORD);
LPEP lpEnumProcesses;
LPEPM lpEnumProcessModules;
LPGMBN lpGetModuleBaseName;
DWORD aProcesses[1024], cbNeeded, cProcesses, i;
BOOL bContinue;
HINSTANCE hDLL = LoadLibrary("psapi.dll");
if ( !hDLL )
ErrorExit(_T("LoadLibrary"), ERROR_SYSTEM);
lpEnumProcesses = (LPEP)GetProcAddress(hDLL, "EnumProcesses");
lpEnumProcessModules = (LPEPM)GetProcAddress(hDLL, "EnumProcessModules");
lpGetModuleBaseName = (LPGMBN)GetProcAddress(hDLL, "GetModuleBaseNameA");
if ( lpEnumProcesses && lpEnumProcessModules && lpGetModuleBaseName )
bContinue = lpEnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded);
else
{
FreeLibrary(hDLL);
ErrorExit(_T("GetProcAddress"), ERROR_SYSTEM);
}
if ( !bContinue )
{
FreeLibrary(hDLL);
ErrorExit(_T("EnumProcesses"), ERROR_SYSTEM);
}
for ( i = 0, cProcesses = cbNeeded / sizeof(DWORD);
i < cProcesses && bContinue;
i++ )
{
TCHAR szProcessName[MAX_PATH] = "";
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
FALSE, aProcesses[i]);
if ( hProcess )
{
HMODULE hMod;
DWORD cbModules;
// get the process name, which is in the 1st module
if ( lpEnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbModules) )
lpGetModuleBaseName(hProcess, hMod, szProcessName, MAX_PATH);
CloseHandle(hProcess);
}
// let the callback function do the application-defined logic
// regardless of the outcome of OpenProcess
bContinue = lpCallback(aProcesses[i], szProcessName, lpTargetName, lParam);
}
FreeLibrary(hDLL);
return ( bContinue ) ? 1 : 0;
}
/*
* enumerate processes using Tool Help
*/
static int
EnumToolHelp(LPCALLBACK lpCallback, LPTSTR lpTargetName, LPARAM lParam)
{
typedef HANDLE (WINAPI *LPCT32S)(DWORD, DWORD);
typedef BOOL (WINAPI *LPP32F)(HANDLE, PROCESSENTRY32 *);
typedef BOOL (WINAPI *LPP32N)(HANDLE, PROCESSENTRY32 *);
LPCT32S lpCreateToolhelp32Snapshot;
LPP32F lpProcess32First;
LPP32N lpProcess32Next;
HANDLE hSnapshot;
PROCESSENTRY32 pe32;
BOOL bContinue;
HINSTANCE hDLL = GetModuleHandle("Kernel32.dll");
if ( !hDLL )
ErrorExit(_T("GetModuleHandle"), ERROR_SYSTEM);
lpCreateToolhelp32Snapshot =
(LPCT32S)GetProcAddress(hDLL, "CreateToolhelp32Snapshot");
lpProcess32First = (LPP32F)GetProcAddress(hDLL, "Process32First");
lpProcess32Next = (LPP32N)GetProcAddress(hDLL, "Process32Next");
if (lpCreateToolhelp32Snapshot && lpProcess32First && lpProcess32Next )
hSnapshot = lpCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
else
ErrorExit(_T("GetProcAddress"), ERROR_SYSTEM);
if ( hSnapshot == INVALID_HANDLE_VALUE )
ErrorExit(_T("CreateToolhelp32Snapshot"), ERROR_SYSTEM);
pe32.dwSize = sizeof(PROCESSENTRY32);
if ( !lpProcess32First(hSnapshot, &pe32) )
{
CloseHandle(hSnapshot);
ErrorExit(_T("Process32First"), ERROR_SYSTEM);
}
do
{
LPTSTR lpProcessName;
// check if the value of szExeFile has been written to the structure
if ( pe32.dwSize > offsetof(PROCESSENTRY32, szExeFile) )
{
lpProcessName = _tcsrchr(pe32.szExeFile, _T('\\'));
// strip path, if any
if ( lpProcessName )
lpProcessName++;
else
lpProcessName = pe32.szExeFile;
}
else
lpProcessName = "";
// let the callback function do the application-defined logic
// regardless of whether szExeFile can be retrieved or not
bContinue = lpCallback(pe32.th32ProcessID, lpProcessName,
lpTargetName, lParam);
// reset dwSize as it might have been changed by Process32First/Next
if ( bContinue )
pe32.dwSize = sizeof(PROCESSENTRY32);
else
break;
}
while ( lpProcess32Next(hSnapshot, &pe32) );
CloseHandle(hSnapshot);
return ( bContinue ) ? 1 : 0;
}
int
main(int argc, LPTSTR argv[])
{
BOOL bQueryOnly;
OSVERSIONINFO osvi;
int nExitCode;
switch ( argc )
{
case 1:
ErrorExit(_T("Missing argument(s)."), ERROR_USAGE);
case 2:
bQueryOnly = TRUE;
break;
case 3:
if ( _tcsicmp(argv[2], _T("c")) != 0 )
ErrorExit(_T("Unrecognized option."), ERROR_USAGE);
bQueryOnly = FALSE;
break;
default:
ErrorExit(_T("Invalid number of arguments."), ERROR_USAGE);
}
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if ( !GetVersionEx(&osvi) )
ErrorExit(_T("GetVersionEx"), ERROR_SYSTEM);
switch ( osvi.dwPlatformId )
{
case VER_PLATFORM_WIN32_NT:
nExitCode = EnumPSAPI((LPCALLBACK)EnumCallback, argv[1], bQueryOnly);
break;
case VER_PLATFORM_WIN32_WINDOWS:
nExitCode = EnumToolHelp((LPCALLBACK)EnumCallback, argv[1], bQueryOnly);
break;
case VER_PLATFORM_WIN32s:
ErrorExit(_T("Win32s is not supported."), ERROR_PLATFORM);
default:
ErrorExit(_T("Unknown platform."), ERROR_PLATFORM);
}
return nExitCode;
}

View File

@ -0,0 +1,95 @@
// Copyright 2004 - 2007 The Uniform Server Development Team
// File: unicmd.c
// Author: Deepak Thukral
// Date: 12/20/2006
// Usage: [FILE].exe start/stop [start options: DRIVE LETTER(char), MY SQL(string = mysql)]
// version 0.1
// Include Headers
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <stddef.h>
// End include headers
// Start Server funtion. Arguments required (drive letter and mysql option)
int startServer(char drive, int opt)
{
if(tolower(drive) == 'b' || tolower(drive) < 97 || tolower(drive) >122){
printf("Invalid Drive Letter, plese choose [A-Z] exculding drive B");
return 1;
}
drive = toupper(drive);
char buff1[100];
char buff2[100];
sprintf(buff1, "Server_start.bat %c mysql 0 0", drive);
sprintf(buff2, "Server_start.bat %c", drive);
if(opt)
system(buff1);
else
system(buff2);
return 0;
}
// Stop Server
int stopServer(int a)
{
system("Stop.bat");
return 0;
}
// Print Usage
void printUsage(int a){
printf("Usage:\n unicmd.exe start [start options: w(drive letter), mysql]\n e.g\n unicmd.exe start w mysql\n unicmd.exe stop");
return;
}
// Main
int main(int argc, char *argv[])
{
//Check arguments
if(argc < 2 || argc > 4) {printUsage(1);return 0;}
if(_tcsicmp(argv[1],"start") && _tcsicmp(argv[1],"stop")){printUsage(1);return 0;}
//Start is supplied
if(_tcsicmp(argv[1],"start") == 0){
int excode;
if(argc == 2){
excode = startServer('w', 0);
if(!excode)printf("Uniform Server has started successfully.");
return 0;
}
if(argc == 3){
excode = startServer(argv[2][0], 0);
if(!excode)printf("Uniform Server has started successfully.");
return 0;
}
else{
if(argv[3] == "mysql")
excode = startServer(argv[2][0], 1);
else
excode = startServer(argv[2][0], 0);
}
if(!excode)printf("Uniform Server has started successfully.");
return 0;
}
// Stop is supplied
if(_tcsicmp(argv[1],"stop") == 0){
int excode = stopServer(1);
if(!excode)printf("Uniform Server has stopped successfully.");
return 0;
}
return 0;
}

View File

@ -0,0 +1,158 @@
// Copyright 2004 - 2007 The Uniform Server Development Team
// UniController Application, Starts and Stop server components.
// version 1.1
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <shellapi.h>
#include "unicontrollerres.h"
#define APPNAME "UniController"
#define APPVERSION "1.0Beta"
#define CORENAME "The Uniform Server" //Editted
#define AUTHOR "The Uniform Server Development Team" //Editted
#define URL "http://www.uniformserver.com" //Editted
#define BTN_STARTSERVER 1
#define BTN_STOPSERVER 2
#define EDT_MESSAGE 3
#pragma comment(lib,"shell32.lib")
LRESULT CALLBACK WndProc( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam)
{
switch(message){
case WM_COMMAND:
if(LOWORD(wParam)==BTN_STARTSERVER || LOWORD(wParam)==IDM_START){
char string[256], buff1[256];
GetDlgItemText(hWnd, EDT_MESSAGE, string, 256);
if(string[0] == 'b' || string[0] == 'B') {
MessageBox(hWnd, "Cannot Start Server: Invalid Drive - B", APPNAME ,MB_OK);
break;
}
if((string[0] >= 'a' && string[0] <= 'z') || (string[0] >= 'A' && string[0] <= 'Z')){
sprintf(buff1, "Server_start.bat %c mysql 0 0", string[0]);
system(buff1);
MessageBox(hWnd, "Server is running! \nplease visit http://localhost:<port>/", APPNAME ,MB_OK);
}
else {
MessageBox(hWnd, "Cannot Start Server: Invalid Drive", APPNAME ,MB_OK);
break;
}
}
if(LOWORD(wParam)==BTN_STOPSERVER || LOWORD(wParam)==IDM_STOP){
system("Stop.bat");
MessageBox(hWnd, "Server has been stopped", APPNAME ,MB_OK);
}
if(LOWORD(wParam)==IDM_EXIT){
PostQuitMessage(WM_QUIT);
}
if(LOWORD(wParam)==IDM_ABOUT){
char str[1024];
sprintf(str, "%s - %s \n\n%s \n%s \n%s", APPNAME, APPVERSION, CORENAME, AUTHOR, URL);
MessageBox(hWnd, str, APPNAME ,MB_OK);
}
if(LOWORD(wParam)==IDM_UNICENTER){
ShellExecute(NULL, "open", "http://center.uniformserver.com/?_r=menu", "", "", SW_SHOWNORMAL);
}
if(LOWORD(wParam)==IDM_HOME){
ShellExecute(NULL, "open", "http://www.uniformserver.com/?_r=menu", "", "", SW_SHOWNORMAL);
}
//Newly Added
if(LOWORD(wParam)==IDM_FORUM){
ShellExecute(NULL, "open", "http://forum.uniformserver.com/?_r=menu", "", "", SW_SHOWNORMAL);
}
if(LOWORD(wParam)==IDM_WIKI){
ShellExecute(NULL, "open", "http://wiki.uniformserver.com/?_r=menu", "", "", SW_SHOWNORMAL);
}
//End
if(LOWORD(wParam)==IDM_BUG){
ShellExecute(NULL, "open", "http://sourceforge.net/tracker/?group_id=53691&atid=471253", "", "", SW_SHOWNORMAL);
}
break;
}
return DefWindowProc(hWnd,message,wParam,lParam);
}
INT WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, INT nCmdShow)
{
// Create A Window Class Structure
WNDCLASSEX wc;
wc.cbClsExtra = 0;
wc.cbSize = sizeof(wc);
wc.cbWndExtra = 0;
wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
wc.hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
wc.hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_ASTERISK));
wc.hIconSm = LoadIcon(NULL, MAKEINTRESOURCE(IDI_ASTERISK));
wc.hInstance = GetModuleHandle(NULL);
wc.lpfnWndProc = WndProc;
wc.lpszClassName = "Uni";
wc.lpszMenuName = MAKEINTRESOURCE(IDMAINMENU);;
wc.style = CS_VREDRAW|CS_HREDRAW|CS_OWNDC;
// Register Window Class
RegisterClassEx(&wc);
// Create a Window
HWND hWnd = CreateWindowEx(0,
"Uni", "UniController 1.0Beta",
WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX, 100,100,400,200,
NULL,NULL,wc.hInstance,0);
// Create a label
HWND text = CreateWindowEx(0,
"STATIC", "Welcome to UniController!",
WS_CHILD|WS_VISIBLE, 10,10,250,20,
hWnd,NULL,NULL,0);
// Create a label
HWND lblDrive = CreateWindowEx(0,
"STATIC", "Drive Letter [A Or C-Z]",
WS_CHILD|WS_VISIBLE, 10,40,170,40,
hWnd,NULL,NULL,0);
HWND editDrive = CreateWindowEx(0,
"EDIT", "W",
WS_CHILD|WS_VISIBLE|WS_BORDER, 220,40,100,20,
hWnd,(HMENU)EDT_MESSAGE,NULL,0);
// Create a label
HWND lblServer = CreateWindowEx(0,
"STATIC", "Uniform Server Core",
WS_CHILD|WS_VISIBLE, 10,80,70,40,
hWnd,NULL,NULL,0);
//Editted Start to Server Start
HWND btnStart = CreateWindowEx(0,
"BUTTON", "Server Start",
WS_CHILD|WS_VISIBLE, 100,80,100,20,
hWnd,(HMENU)BTN_STARTSERVER,NULL,0);
//Editted Stop to Server Stop
HWND btnStop = CreateWindowEx(0,
"BUTTON", "Server Stop",
WS_CHILD|WS_VISIBLE, 220,80,100,20,
hWnd,(HMENU)BTN_STOPSERVER,NULL,0);
ShowWindow(hWnd,SW_SHOW);
// Message Loop
MSG msg;
while(GetMessage(&msg,hWnd,0,0)>0){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}

View File

@ -0,0 +1,73 @@
// Copyright 2004 - 2007 The Uniform Server Development Team
// UniController Application, Starts and Stop server components.
// version 1.1
#include <windows.h>
#include "unicontrollerres.h"
/* --- The following code comes from K:\lcc\lib\wizard\default.rc. */
IDMAINMENU MENU
BEGIN
POPUP "&Commands"
BEGIN
//MENUITEM "&Configure",IDM_CONFIG
MENUITEM "&Server Start",IDM_START
MENUITEM "&Server S&top",IDM_STOP
MENUITEM "&E&xit",IDM_EXIT
END
POPUP "&WWW"
BEGIN
MENUITEM "&Uniform Server > Home", IDM_HOME //Look
MENUITEM "&Uniform Server > Forum", IDM_FORUM //Look
MENUITEM "&Uniform Server > Wiki", IDM_WIKI //Look
MENUITEM "&Uniform Server > UniCenter", IDM_UNICENTER //Look
MENUITEM "&Uniform Server > Bug Report", IDM_BUG //Look
END
POPUP "&Help"
BEGIN
MENUITEM "&About",IDM_ABOUT
END
END
IDACCEL ACCELERATORS
BEGIN
"Q", IDM_EXIT,VIRTKEY,CONTROL
END
/* --- The following code comes from K:\lcc\lib\wizard\menustr.tpl. */
// This tables contains the explanation strings to be shown in the status
// bar when the uses moves the mouse in an open menu.
// Organization:
// For each popup menu, there is the identifier of the popup itself, followed
// by the strings for all items in that menu. The ID of each string is its
// command #define.
//
STRINGTABLE DISCARDABLE
BEGIN
IDM_START "Start Uniform Server"
IDM_STOP "Stop Uniform Server"
//IDM_CONFIG "Configure Uniform Server settings"
//IDS_FILEMENU "Create, open, save, or print documents"
//IDM_NEW "Creates a new document"
//IDM_OPEN "Opens an existing document"
//IDM_SAVE "Saves the active document"
//IDM_SAVEAS "Saves the active document under a different name"
//IDM_CLOSE "Closes the active document"
END
STRINGTABLE DISCARDABLE
BEGIN
IDM_EXIT "Quits this application"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_HELPMENU "Get help"
IDM_UNICENTER "Visit online resource center"
IDM_ABOUT "Displays information about this application"
END
/* --- The following code comes from K:\lcc\lib\wizard\aboutdlgrc.tpl. */
IDD_ABOUT DIALOG 6, 18, 180, 180
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "UniController is a small application used to control core Uniform Server systems."
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Close", IDOK, 129, 156, 40, 14
END

View File

@ -0,0 +1,31 @@
// Copyright 2004 - 2007 The Uniform Server Development Team
/* --- The following code comes from K:\lcc\lib\wizard\stddef.tpl */
// This are the definitions for all symbols used in menus or string
// version 1.1
#define IDACCEL 10000
#define IDM_NEW 200
#define IDM_OPEN 210
#define IDM_SAVE 220
#define IDM_SAVEAS 230
#define IDM_CLOSE 240
#define IDM_PRINT 250
#define IDM_PAGESETUP 260
#define IDM_EXIT 300
#define IDM_ABOUT 510
#define IDMAINMENU 600
#define IDAPPLICON 710
#define IDAPPLCURSOR 810
#define IDS_FILEMENU 2000
#define IDS_HELPMENU 2010
#define IDS_SYSMENU 2030
#define IDM_STATUSBAR 3000
#define IDD_ABOUT 100
#define IDM_UNICENTER 500
#define IDM_CONFIG 270
#define IDM_START 280
#define IDM_STOP 290
#define IDM_BUG 520
#define IDM_HOME 530
#define IDM_FORUM 540 //New ~Ola
#define IDM_WIKI 550 //New ~Ola

View File

@ -0,0 +1,43 @@
// Copyright 2004 - 2007 The Uniform Server Development Team
// Runs a hidden process. Waits till it ends then next one. [windows application]
// Compile with lcc-win32
// version 1.1
#include <windows.h>
#include <stdio.h>
int main( int argc, char *argv[] )
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
if (argc>1) {
memset(&si, 0, sizeof(si));
// ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
si.wShowWindow = SW_HIDE;
si.dwFlags = STARTF_USESHOWWINDOW;
ZeroMemory( &pi, sizeof(pi) );
// Start the child process.
CreateProcess( NULL, // No module name (use command line).
TEXT(argv[1]), // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ); // Pointer to PROCESS_INFORMATION structure.
// Wait until child process exits.
if (argc>2) {
WaitForSingleObject( pi.hProcess, INFINITE );
CreateProcess( NULL, TEXT(argv[2]), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
}
// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
return 0;
}

View File

@ -0,0 +1,4 @@
[ViewState]
Mode=
Vid=
FolderType=Documents

View File

@ -0,0 +1,8 @@
@echo off
set Disk=%1
IF "%Disk%"=="" set Disk=w
%Disk%:\home\admin\program\pskill.exe mysqld-opt.exe
IF ERRORLEVEL 1 goto nomysql
%Disk%:\usr\local\mysql\bin\mysqladmin.exe --character-sets-dir="/usr/local/mysql/share/charsets/" --user=root --password=root shutdown
:nomysql
subst %Disk%: /D

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,22 @@
# This file provides security to the server limiting access to the localhost only.
# Comment to deactivate.
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
# To disallow execution of cgi scripts in this directory comment next two lines.
AddHandler cgi-script .bat .exe .pl .cgi
Options +ExecCGI
#--
# Activate this to use the Admin Panel Feature!
#--
# To lock Admin Panel, uncomment the next 4 lines.
# Defaults: Username - root; Password - root
#AuthName "Uniform Server - Admin Panel 2.0"
#AuthType Basic
#AuthUserFile /htpasswd/home/admin/www/.htpasswd
#Require valid-user

View File

@ -0,0 +1,163 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
include "includes/header.php";
include "includes/secure.php";
?>
<div id="main">
<h2>&#187; <?=$US['aconfig-head']?></h2>
<h3><?=$US['aconfig-conf']?></h3>
<?
# -- Determines Apache version.
if (preg_match("/Apache\/2/i", $_SERVER["SERVER_SOFTWARE"])) {
$Apache2 = True;
}
else {
$Apache2 = False;
}
# --
# -- Determines PHP mode
if (!preg_match("/^cgi/",php_sapi_name())) {
$PHPmod = True;
}
else {
$PHPmod = False;
}
# --
$apache = new Config ("/usr/local/apache2/conf/httpd.conf","#");
$apache->Var_Name =array ("ServerName","ServerAdmin","DirectoryIndex","AddHandler server-parsed","ServerSignature","Listen");
$apache->Var_Text =array (
"".$US['aconfig-sname']."","".$US['aconfig-wemail']."","".$US['aconfig-difiles']."",
"".$US['aconfig-ssi']."","".$US['aconfig-ssig']."","".$US['aconfig-listen']."");
$apache->Var_Help =array (
"http://httpd.apache.org/docs/mod/core.html#servername",
"http://httpd.apache.org/docs/mod/core.html#serveradmin",
"http://httpd.apache.org/docs/mod/mod_dir.html#directoryindex",
"http://httpd.apache.org/docs/mod/mod_include.html",
"http://httpd.apache.org/docs/mod/core.html#serversignature",
"http://httpd.apache.org/docs/2.0/bind.html");
// import_request_variables("gP", "st");
$step=$HTTP_POST_VARS['Submit'];
if ($step == "next") {
echo "<p>".$US['aconfig-text-0']."</p>";
}
else {
if ($step == "Save") {
$apache->replace_values ($HTTP_POST_VARS);
echo "<p><font color=\"red\">".$US['aconfig-text-1']."</font><p>";
}
?>
<form action="
<?
echo $_SERVER["PHP_SELF"]."\" name=\"f\" method=\"post\">";
$apache->echo_values ();
?>
<br />
<input type="submit" value="<?=$US['aconfig-save']?>" name="Submit" />
</form>
<br />
<?
if ($PHPmod==True) {
echo "<p><font color=\"red\">".$US['aconfig-module']."</font></p>";
}
else {
echo "<p><font color=\"red\">".$US['aconfig-cgi']."</font></p>";
}
}
//--------------------------------------------------------------------
class Config
{
var $contents;
var $name;
var $comments;
var $Var_Name;
var $Var_Text;
var $Var_Help;
var $classnum;
function Config ($file_name, $comments)
{
$this->comments=$comments;
$this->name=$file_name;
$fd = fopen ($this->name, "r");
$this->contents = fread ($fd, filesize ($file_name));
fclose ($fd);
$this->classnumber=$GLOBALS["$Configclassnumber"]=$GLOBALS["$Configclassnumber"]+1;
}
function f_write ()
{
$fd = fopen ($this->name, "w");
$ok = fwrite ($fd, $this->contents);
fclose ($fd);
}
function echo_values ()
{
include "includes/lang/".file_get_contents("includes/.lang").".php";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
$item=0;
foreach ($this->Var_Name as $loop){
$Var_ID="C".$this->classnumber."i".$item;
$Var_Name=$this->Var_Name[$item];
$Var_Text=$this->Var_Text[$item];
$Var_Help=$this->Var_Help[$item];
$comments=$this->comments;
preg_match("/\n\s*$Var_Name\s+([^$comments^\n]+)/i", $this->contents, $tag);
echo "
<tr>
<td width=\"150\"><p>$Var_Text:</p></td>
<td>
<p><input type=\"text\" name=\"$Var_ID\" size=\"31\" maxlength=\"2048\" value='$tag[1]' /> ";
if ($Var_Help != "") {echo "<a href=\"$Var_Help\" target=\"_help\">".$US['aconfig-help']."</a>";};
echo "</p>";
echo "</td>";
echo "</tr>";
$item=$item+1;
}
echo "</table>";
}
function replace_values ($HTTP_POST_VARS)
{
$item=0;
foreach ($this->Var_Name as $loop){
$Var_ID="C".$this->classnumber."i".$item;
$data=$HTTP_POST_VARS[$Var_ID];
$comments=$this->comments;
$this->contents=preg_replace("/\n(\s*$loop)\s+([^$comments]+)/i", "\n\\1 $data\n\n", $this->contents, 1);
$item=$item+1;
}
$this->f_write ();
}
}
?>
</div>
<?
// Footer
include "includes/footer.php";
?>

View File

@ -0,0 +1,94 @@
<?
/*
####################################################
# Name: The Uniform Server Setup
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
include "includes/header.php";
include "includes/secure.php";
if ( !(file_exists($aphtpasswd)) ) {
$FHandle = fopen($aphtpasswd, 'w');
fclose($FHandle);
}
if ($_POST['submit']) {
$nwuser = $_POST['apuser'];
$nwpass = $_POST['appass'];
$urdata = "$nwuser:$nwpass";
$wfile = fopen($aphtpasswd, 'w') ;
fwrite($wfile, $urdata);
fclose($wfile);
?>
<div id="main">
<h2>&#187; <?=$US['apsetup-head']?></h2>
<h3><?=$US['apsetup-sub-0']?></h3>
<p>
<?=$US['apsetup-success']?>
<br />
<br />
<?=$US['apsetup-user']?>: <?=$_POST['apuser'];?>
<br />
<?=$US['apsetup-pass']?>: <?=$_POST['appass'];?>
</p>
</div>
<?
}
else {
$tfile = fopen($aphtpasswd, "r");
$fcontents = fgets($tfile);
$ucontents = explode(":", $fcontents);
?>
<div id="main">
<h2>&#187; <?=$US['apsetup-head']?></h2>
<h3><?=$US['apsetup-sub-0']?></h3>
<p><?=$US['apsetup-text-0']?></p>
<form action="<?=$PHP_SELF?>" method="post">
<table width="100%">
<tr>
<td width="80">
<p><?=$US['apsetup-user']?></p>
</td>
<td>
<input type="text" name="apuser" value="<?=$ucontents[0]?>" />
</td>
</tr>
<tr>
<td width="80">
<p><?=$US['apsetup-pass']?></p>
</td>
<td>
<input type="text" name="appass" value="<?=$ucontents[1]?>" />
</td>
</tr>
</table>
<br />
<input type="submit" name="submit" value="<?=$US['apsetup-change']?>" />
</form>
</div>
<?
fclose($tfile);
}
// Footer
include "includes/footer.php";
?>

View File

@ -0,0 +1,23 @@
#!/usr/bin/perl
sub urldecode{
local($val)=@_;
$val=~s/\+/ /g;
$val=~s/%([0-9A-H]{2})/pack('C',hex($1))/ge;
return $val;
}
require header;
print "
<div id=\"main\">
<h2>&#187; CGI Enviroment</h2>
<h3>Displaying CGI Environment</h3>";
foreach $env_var (keys %ENV){
print "<p><b>$env_var</b> = <i>$ENV{$env_var}</i> <br /></p>\n";
}
print "</div>";
require footer;

View File

@ -0,0 +1,71 @@
#!/usr/bin/perl
require header;
require secure;
if ($ENV{'QUERY_STRING'}eq"F"){
print "
<div id=\"main\">
<h2>&#187; Cleaning Server</h2>
<h3>Cleaned /www/ Directory</h3>
<p>
Server has been cleaned!
</p>
</div>";
deletex ("/www");
coppy("/home/admin/www/images/logo.jpg","/www/images/logo.jpg");
coppy("/home/admin/www/favicon.ico","/www/images/favicon.ico");
coppy("/home/admin/redirect.html","/www/index.html");
}
else {
print "
<div id=\"main\">
<h2>&#187; Clean Server</h2>
<h3>Clean /www/ Directory</h3>
<p>
This will delete contents of \\www\\ folder
<br />
Are you sure: <a href=\"$ENV{SCRIPT_NAME}?F\">Yes, Continue</a>
</p>
</div>";
ENDDD
}
require footer;
exit;
# usege deletex (path);
sub deletex {
my @names;
my $name;
my ($path)=$_[0] ;
opendir DIR,"$path";
$name=readdir DIR;
$name=readdir DIR;
@names=readdir DIR;
closedir DIR;
foreach $name (@names){
if (-d "$path/$name"){deletex ("$path/$name"); rmdir ("$path/$name");};
@namess=split(/\./, $name);
if (!(-d "$path/$name")&&(!($skip=~ /@namess[$namess+1]/)||(@namess[$namess+1]eq''))){
unlink "$path/$name";
}
}
}
sub coppy {
open (FILE,"$_[0]");
binmode FILE;
@lines=<FILE>;
close (FILE);
open (FILE,">$_[1]");
binmode FILE;
print FILE @lines;
close (FILE);
}

View File

@ -0,0 +1,35 @@
#!/usr/bin/perl
##### ERROR LOG FILE LOCATION #####
#
$logfile = "/usr/local/apache2/logs/error.log";
#
###################################
require header;
require secure;
print "
<div id=\"main\">
<h2>&#187; Error Log Viewer</h2>
<h3>Viewing Error Log File</h3>
<p>";
open (LOG, "$logfile")|| die "Can't open data file!\n";
@log = <LOG>;
close (LOG);
@log=reverse(@log);
splice @log, 4096;
foreach $logs (@log) {
print "- $logs <br />";
}
print "
</p>
</div>";
require footer;
exit;

View File

@ -0,0 +1,9 @@
package footer;
print"
<p class=\"copyright\">
<span class=\"name\">Admin Panel 2.0.2</span> | © 2007 The Uniform Server Development Team
</p>
</body>
</html>";

View File

@ -0,0 +1,25 @@
package header;
print "Content-type: text/html\n\n";
print "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">
<head>
<title>The Uniform Server</title>
<meta name=\"author\" content=\"Olajide Olaolorun\" />
<meta http-equiv=\"page-enter\" content=\"blendtrans(duration=0.1)\" />
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />
<script type=\"text/javascript\" src=\"../../../../js/main.js\"></script>
<link href=\"../../../../css/main.css\" rel=\"stylesheet\" type=\"text/css\" />
<link rel=\"icon\" href=\"../../../../images/favicon.ico\" />
<link title=\"Homepage\" href=\"../../../../index.php\" rel=\"top\" />
<link title=\"Up\" href=\"../../../../index.php\" rel=\"up\" />
<link title=\"First page\" href=\"../../../../index.php\" rel=\"first\" />
<link title=\"Previous page\" href\"../../../../index.php\" rel=\"previous\" />
<link title=\"Next page\" href=\"../../../../index.php\" rel=\"next\" />
<link title=\"Last page\" href=\"../../../../index.php\" rel=\"last\" />
<link title=\"Table of contents\" href=\"../../../../index.php\" rel=\"toc\" />
<link title=\"Site map\" href=\"../../../../index.php\" rel=\"index\" />
</head>
<body>";

View File

@ -0,0 +1,54 @@
#!/usr/bin/perl
require header;
require secure;
print "
<div id=\"main\">
<h2>&#187; Start MySQL</h2>
<h3>Starting MySQL</h3>
<p>";
&check_mysql;
if ($run) {
if ($ENV{'QUERY_STRING'}eq"F"){
&start_mysql;
print "MySQL server was forced to start.";
print "<br />";
}
else {
print <<ENDDD;
MySQL server already running.
<br />
But if you think that it is mistake click on this <a href="$ENV{SCRIPT_NAME}?F">link</a>
<br />
</p>
</div>
ENDDD
}
}
else {
print <<ENDDD;
MySQL server started.
</p>
</div>
ENDDD
require footer;
&start_mysql;
}
require footer;
exit;
sub check_mysql(){
$res = system "\\home\\admin\\program\\pskill.exe", "mysqld-opt.exe";
if ($res == 0){$run=1}
else {$run=0}
}
sub start_mysql(){
exec "/usr/local/mysql/bin/mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf\"";
}

View File

@ -0,0 +1,54 @@
#!/usr/bin/perl
require header;
require secure;
print "
<div id=\"main\">
<h2>&#187; Restart Server</h2>
<h3>Restarting...</h3>
<p>";
if ($ENV{'QUERY_STRING'}eq"M"){
$res=`net top mysql`;
$res=`net start mysql`;
print "<h2>The MySQL service was restarted.</h2>";
}
if ($ENV{'QUERY_STRING'}ne""){
print <<ENDDD;
<script language="JavaScript">
<!--
window.location = '../../../../start.php';
// -->
</script>
</p>
</div>
ENDDD
}
if ($ENV{'QUERY_STRING'}eq"A"){
print "<h2>The Apache service was restarted.</h2>";
$res=`net stop Apache2`;
exec "net start Apache2";
exit;
}
print <<ENDDD;
This script will restart the services.
<br />
It may take some time.
<br />
<br />
I am sure: <a href="$ENV{SCRIPT_NAME}?A">Restart Apache2 Service</a>
<br />
I am sure: <a href="$ENV{SCRIPT_NAME}?M">Restart MySQL Service</a>
</p>
</div>
ENDDD
require footer;
exit;

View File

@ -0,0 +1,23 @@
package secure;
# If you want to disable security check - comment the following lines with #.
if (($ENV{HTTP_REFERER}!~/^http[s]?:\/\/localhost\/apanel/)&&($ENV{HTTP_REFERER}!~/^http[s]?:\/\/127\.0\.0\.\d+\/apanel/)){
print "
<div id=\"main\">
<h2>&#187; Security Alert!</h2>
<h3>Possible Attack</h3>
<p>
HTTP_REFERER is not localhost, but '<b>".$ENV{HTTP_REFERER}."</b>'.
<br />
<br />
To disable this warning go: /home/admin/www/cgi-bin/secure.pm
<p>
</div>";
require footer;
exit;
};
return 1;

View File

@ -0,0 +1,54 @@
#!/usr/bin/perl
require header;
require secure;
print "
<div id=\"main\">
<h2>&#187; Stop MySQL</h2>
<h3>Stopping MySQL</h3>
<p>";
&check_mysql;
if ($run) {
&stop_mysql;
print "MySQL server stopped.<br>";
}
else {
if ($ENV{'QUERY_STRING'}eq"F"){
&stop_mysql;
print "MySQL server was forced to stop.";
print "<br>";
}
else {
print <<ENDDD;
MySQL server was not running.
<br />
But if you think that it is a mistake click on this <a href="$ENV{SCRIPT_NAME}?F">link</a>
<br />
ENDDD
}
}
print <<ENDDD;
</p>
</div>
ENDDD
require footer;
exit;
sub check_mysql(){
$res = system "\\home\\admin\\program\\pskill.exe", "mysqld-opt.exe";
if ($res == 0){$run=1}
else {$run=0}
}
sub stop_mysql(){
open (PASS,"../../../../mysql_password");
$password=<PASS>;
close (PASS);
system "/home/admin/program/uniserv.exe \"\\usr\\local\\mysql\\bin\\mysqladmin.exe --user=root --password=$password shutdown\"";
}

View File

@ -0,0 +1,32 @@
#!/usr/bin/perl
require header;
require secure;
print <<ENDDD;
<div id="main">
<h2>&#187; Shutdown Server</h2>
<h3>Shutting Down Server</h3>
<p>
The server is shutting down.
<br />
<br />
Thank you for using <a href="http://www.uniformserver.com/">The Uniform Server</a>.<br />
<br />
</p>
</div>
ENDDD
$res = system "\\home\\admin\\program\\pskill.exe", "mysqld-opt.exe";
if ($res == 0){
open (PASS,"../../../../mysql_password");
$password=<PASS>;
close (PASS);
system "/home/admin/program/uniserv.exe \"\\usr\\local\\mysql\\bin\\mysqladmin.exe --user=root --password=$password shutdown\"";
}
exec "\\home\\admin\\program\\pskill Apache.exe c";
require footer;
exit;

View File

@ -0,0 +1,126 @@
#!/usr/bin/perl
$skip = (" gif jpg bmp pcx tif zip gz rar tar cab ha exe com bat dll hlp xls doc pdf ps dbf htaccess old ");
$wwwdocs = (" html htm shtml php shtm phtm phtml ");
require header;
require secure;
parseform();
if ($FORM{'act'}eq''){
&showwelcome;
}
elsif($FORM{'act'}eq'Convert'){
convert ("/cgi-bin","/cgi-bin");
print "
<div id=\"main\">
<h2>&#187; Windows to Unix Converter</h2>
<h3>Converted Windows Perl Files</h3>
<p>
Converted!
</p>
</div>";
require footer;
}
exit;
# usege convert (path,path1);
sub convert {
my @names;
my $name;
my ($path)=$_[0] ;
my ($path1)=$_[1] ;
opendir DIR,"$path";
$name=readdir DIR;
$name=readdir DIR;
@names=readdir DIR;
closedir DIR;
foreach $name (@names){
if (-d "$path/$name"){mkdir ("$path1/$name"); convert ("$path/$name","$path1/$name")};
@namess=split(/\./, $name);
if (!(-d "$path/$name")&&(!($skip=~ /@namess[$namess+1]/)||(@namess[$namess+1]eq''))){
open (FILE,"$path/$name");
binmode FILE;
@lines=<FILE>;
close (FILE);
if (@lines[0]=~ /\#\!.+perl/i) {@lines[0]="\#\!/usr/bin/perl\n";};
foreach(@lines){
s/\r//g;
}
open (FILE,">$path1/$name");
binmode FILE;
print FILE @lines;
close (FILE);
print "$path/$name - converted.<br>";
}
else {
open (FILE,"$path/$name");
binmode FILE;
@lines=<FILE>;
close (FILE);
open (FILE,">$path1/$name");
binmode FILE;
print FILE @lines;
close (FILE);
print "$path/$name - transferred.<br>";
}
}
}
sub showwelcome {
require header;
print <<ENDDD;
<div id=\"main\">
<h2>&#187; Windows to Unix Converter</h2>
<h3>Convert Windows Perl Files</h3>
<p>
If you have problems to executing your cgi scripts on Unix this program will convert cgi scripts from Windows to Unix format (#10#13=>#13).
<br />
<br />
Instruction:
<br />
After execution you can pick up the scripts ready to execution on a Unix machine from the \\cgi-bin\\ directory.
<br />
<br />
<form name="form" action="$ENV{SCRIPT_NAME}" method="post">
<input type="submit" name="act" value="Convert"></font>
</form>
</p>
</div>
ENDDD
require footer;
}
sub parseform() {
if($ENV{'REQUEST_METHOD'} eq 'GET'){
$buffer=$ENV{'QUERY_STRING'};
}
elsif($ENV{'REQUEST_METHOD'} eq 'POST'){
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("c",hex($1))/eg;
$FORM{$name} = $value;
}
}

View File

@ -0,0 +1,152 @@
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0 CSS 1.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
a {
color:#FF9933;
text-decoration:none;
}
a.current {
color:#999999;
}
a:hover {
text-decoration:underline;
}
acronym {
color:#000000;
cursor:help;
}
body {
font-family: verdana, tahoma, helvetica, arial, sans-serif;
font-size: 100%;
margin: 1em;
background-color:#F8F8F8;
}
h2 {
color:#000000;
font-size:90%;
font-weight:bold;
padding-bottom:0.5em;
}
h3 {
color:#4F4F97;
font-size:70%;
font-weight:bold;
padding-bottom:0.5em;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color:#4F4F97;
}
p {
text-align:left;
color:#000000;
font-size: 60%;
line-height: 2em;
}
ul {
font-size:60%;
color:#666666;
line-height: 2em;
list-style: none;
}
img {
border: 0px;
}
#main {
background-color:#FFFFFF;
margin: 0em 0em 0.8em 0em;
padding: 0em 0.8em 0.8em 0.8em;
border-style:solid;
border-width:1px;
border-color:#E5E5E5;
}
#resolve {
background-color:#FFFFFF;
margin: 0em 0em 0.0em 0em;
padding: 0em 0.8em 0.8em 0.8em;
border-style:solid;
border-width:1px;
border-color:#E5E5E5;
}
h3.sub {
color:#CCCCCC;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color:#E5E5E5;
}
#navbar {
width: 10em;
float: left;
clear: left;
background-color:#FFFFFF;
padding: 0.8em 0.8em 0.8em 0.8em;
border-style:solid;
border-width:1px;
border-color: #E5E5E5;
margin-bottom: 0.8em;
}
#loginbox {
width: 10em;
float: right;
clear: right;
background-color:#FFFFFF;
padding: 0.8em 0.8em 0.8em 0.8em;
border-style:solid;
border-width:1px;
border-color:#E5E5E5;
}
.textbox {
border-style:solid;
border-width:1px;
border-color:#CCCCCC;
font-size:60%;
margin-bottom:0.5em;
color:#B8CDE8;
}
.button {
border-style:solid;
border-width:1px;
border-color:#CCCCCC;
font-size:60%;
color:#B8CDE8;
background-color: #FFFFFF;
}
.name {
font-weight:bold;
}
#navbar a {
display:block;
position:relative;
line-height: 2em;
font-size: 60%;
}
.copyright {
text-align:center;
font-size:55%;
}

View File

@ -0,0 +1,27 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
include "includes/header.php";
include "includes/secure.php";
?>
<div id="main">
<h2>&#187; <?=$US['down-head']?></h2>
<h3><?=$US['down-aval']?></h3>
<p><?=$US['down-text']?></p>
</div>
<?
// Footer
include "includes/footer.php";
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,43 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><?=$US['title']?> <? include('includes/.version'); ?></title>
<meta name="author" content="Olajide Olaolorun" />
<meta http-equiv="page-enter" content="blendtrans(duration=0.1)" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="<? echo $apanel; ?>/js/main.js"></script>
<link href="<? echo $apanel; ?>/css/main.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="<? echo $apanel; ?>/favicon.ico" />
<link title="Homepage" href="./index.php" rel="top" />
<link title="Up" href="./index.php" rel="up" />
<link title="First page" href="./index.php" rel="first" />
<link title="Previous page" href="./index.php" rel="previous" />
<link title="Next page" href="./index.php" rel="next" />
<link title="Last page" href="./index.php" rel="last" />
<link title="Table of contents" href="./index.php" rel="toc" />
<link title="Site map" href="./index.php" rel="index" />
</head>
<body style="background: #4F4F97; margin-top: 8px; margin-left: 8px;">
<div>
<img src="<? echo $apanel; ?>/images/logo.jpg" alt="<?=$US['title']?> <?include("includes/.version")?>" />
</div>
</body>
</html>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1 @@
en

View File

@ -0,0 +1 @@
3.4-Sluger

View File

@ -0,0 +1,8 @@
<h3><?=$US['title']?> <? include('.version') ?></h3>
<a target="content" onClick="h(this);" href="start.php"><?=$US['nav-home']?></a>
<a target="content" onclick="h(this);" href="security.php"><?=$US['nav-secure']?></a>
<a target="content" onclick="h(this);" href="phpinfo.php"><?=$US['nav-phpinfo']?></a>
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/cgienv.cgi"><?=$US['nav-cgienv']?></a>
<a target="_status" onclick="h(this);" href="/server-status"><?=$US['nav-status']?></a>
<a target="_info" onclick="h(this);" href="/server-info"><?=$US['nav-info']?></a>
<a target="content" onclick="h(this);" href="update.php"><?=$US['nav-update']?></a>

View File

@ -0,0 +1,27 @@
<?
/*
####################################################
# Name: The Uniform Server Programming Code View
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
if ($devmode == 1) {
// Show Source Code Feature
if ($_REQUEST['showcode']!=1) {
echo '| <a href="'.$_SERVER['PHP_SELF'].'?showcode=1">'.$US['code-show'].'</a>';
}
else {
echo '<p>&nbsp;<p>';
if($file=="")$file=$_SERVER['PHP_SELF'];
$uscode=htmlentities(file_get_contents(basename($file)));
echo "<h2>".$US['code-source']." | <a href=\"javascript: history.go(-1)\">".$US['code-back']."</a></h2> ";
echo "<form><textarea cols=\"80\" rows=\"30\">";
echo $uscode;
echo "</textarea></form>";
}
}
?>

View File

@ -0,0 +1,7 @@
<h3><?=$US['nav-config']?></h3>
<a target="content" onclick="h(this);" href="aconfig.php"><?=$US['nav-aconfig']?></a>
<a target="content" onclick="h(this);" href="pconfig.php"><?=$US['nav-pconfig']?></a>
<a target="content" onclick="h(this);" href="vhost.php"><?=$US['nav-vhost']?></a>
<a target="content" onclick="h(this);" href="apsetup.php"><?=$US['nav-apsetup']?></a>
<a target="content" onclick="h(this);" href="psetup.php"><?=$US['nav-psetup']?></a>
<a target="content" onclick="h(this);" href="mqsetup.php"><?=$US['nav-mqsetup']?></a>

View File

@ -0,0 +1,48 @@
<?
/*
####################################################
# Name: The Uniform Server Configuration 1.7
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
/* Globals */
// Version
$version = "2.0.3";
$uniserver = file_get_contents("includes/.version");
$unisecure = "1"; //Use secure.php if set to 1
$devmode = "0"; //Developer Mode = 1
$usip = getenv("REMOTE_ADDR");
$hname = gethostbyaddr($REMOTE_ADDR); //Not being used nowssssss
/* Path variables - NO BACKSLASH */
// Local Variables
$drive = $_ENV['Disk'] . ":";
if($drive == ":"){
$path = realpath(dirname($_SERVER['config.inc.php']));
$pathArray = explode("\\",$path);
$drive="$pathArray[0]/$pathArray[1]";
}
$usr = "$drive/usr";
$www = "$drive/www";
$home = "$drive/home";
/* htpasswd Variables - NO BACKSLASH */
// Required
$htpasswd = "$drive/htpasswd/";
$aphtpasswd = "$htpasswd/home/admin/www/.htpasswd";
$whtpasswd = "$htpasswd/www/.htpasswd";
$mysqlpwd = "$home/admin/www/mysql_password";
/* Web Variables - NO BACKSLASH */
// Host
$host = $_SERVER["HTTP_HOST"];
// Server - DO NOT CHANGE
$server = "http://$host";
$server_path = "$www"; //$_SERVER["DOCUMENT_ROOT"]
// Admin Panel
$apanel = "$server/apanel";
$apanel_path = "$home/admin/www";
?>

View File

@ -0,0 +1,7 @@
<h3><?=$US['nav-docs']?></h3>
<a target="_uguide" onclick="h(this);" href="http://doc.uniformserver.com"><?=$US['nav-udoc']?></a>
<a target="_ucenter" onclick="h(this);" href="http://center.uniformserver.com"><?=$US['nav-ucen']?></a>
<a target="_sdoc" onclick="h(this);" href="/docs/"><?=$US['nav-sdoc']?></a>
<a target="_php" onclick="h(this);" href="http://www.php.net/download-docs.php"><?=$US['nav-phdoc']?></a>
<a target="_mysql" onclick="h(this);" href="http://www.mysql.com/documentation/"><?=$US['nav-mydoc']?></a>
<a target="_perl" onclick="h(this);" href="http://www.perldoc.com/perl5.8.0/pod/perl.html"><?=$US['nav-pedoc']?></a>

View File

@ -0,0 +1,5 @@
<p class="copyright">
<span class="name"><?=$US['apanel']?> <?=$version?></span> | © 2007 <?=$US['dev-team']?> <? include "includes/code.php"; ?>
</p>
</body>
</html>

View File

@ -0,0 +1,37 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("$apanel_path/includes/.lang").".php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><?=$US['title']?> <? include('.version'); ?></title>
<meta name="author" content="Olajide Olaolorun" />
<meta http-equiv="page-enter" content="blendtrans(duration=0.1)" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="<? echo $apanel; ?>/js/main.js"></script>
<link href="<? echo $apanel; ?>/css/main.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="<? echo $apanel; ?>/favicon.ico" />
<link title="Homepage" href="./index.php" rel="top" />
<link title="Up" href="./index.php" rel="up" />
<link title="First page" href="./index.php" rel="first" />
<link title="Previous page" href="./index.php" rel="previous" />
<link title="Next page" href="./index.php" rel="next" />
<link title="Last page" href="./index.php" rel="last" />
<link title="Table of contents" href="./index.php" rel="toc" />
<link title="Site map" href="./index.php" rel="index" />
</head>
<body>

View File

@ -0,0 +1,3 @@
<h3><?=$US['nav-langs']?></h3>
<a target="_parent" onclick="h(this);" href="lang.php?en">English</a>

View File

@ -0,0 +1,323 @@
<?
/*
####################################################################
# Name: The Uniform Server Language System Array 1.1
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################################
*/
# Beta Feature, Currently For Debugging Only
#require_once 'array.php';
$US = array(
'title' => 'Uniform Server',
'apanel' => 'Admin Panel',
'dev-team' => 'The Uniform Server Development Team',
//--------------------------------------------------------------------------------------------
// Source Code
//--------------------------------------------------------------------------------------------
'code-show' => 'View Source Code',
'code-source' => 'Viewing Source Code',
'code-back' => 'Close View',
//--------------------------------------------------------------------------------------------
// Navigation
//--------------------------------------------------------------------------------------------
// Basic
'nav-home' => 'Home',
'nav-web' => 'Uniform Server Website',
'nav-secure' => 'Server Security',
'nav-phpinfo' => 'phpinfo()',
'nav-cgienv' => 'Perl Envirnonment',
'nav-status' => 'Apache Status',
'nav-info' => 'Apache Info',
'nav-update' => 'Version Check',
// Start
'nav-start' => 'Server Control',
'nav-sserver' => 'Shutdown Server',
'nav-rmysql' => 'Run MySQL',
'nav-smysql' => 'Stop MySQL',
'nav-rserver' => 'Restart Services',
// Configurations
'nav-config' => 'Configurations',
'nav-aconfig' => 'Apache Configuration',
'nav-pconfig' => 'PHP Configuration',
'nav-vhost' => 'Admin Virtual Host',
'nav-apsetup' => 'Admin Panel Configuration',
'nav-psetup' => 'Private Server Configuration',
'nav-mqsetup' => 'MySQL Server Configuration',
// Tools Navigation
'nav-tools' => 'Tools',
'nav-pma' => 'phpMyAdmin',
'nav-pmbp' => 'phpMyBackupPro',
'nav-elog' => 'Error Log Viewer',
'nav-u2w' => 'Win - Unix Converter',
'nav-del' => 'Clean Server',
'nav-down' => 'Download Manager',
'nav-smig' => 'Server Migration',
// Plugins Navigation
'nav-plugins' => 'Plugin Manager',
'nav-pear' => 'Install Pear',
'nav-eaccelerator' => 'eAccelerator cPanel',
// Misc Navigation
'nav-misc' => 'Miscellaneous',
'nav-sup' => 'Online Support',
// Documentation
'nav-docs' => 'Documentation',
'nav-udoc' => 'Uniform Server User Guide',
'nav-ucen' => 'UniCenter',
'nav-sdoc' => 'Server Documentation',
'nav-phdoc' => 'PHP Documentation',
'nav-mydoc' => 'MySQL Documentation',
'nav-pedoc' => 'Perl Documentation',
// Languages
'nav-langs' => 'Languages',
//--------------------------------------------------------------------------------------------
// Home
//--------------------------------------------------------------------------------------------
'main-head' => 'Admin Panel '. $version .'',
'main-text' => '
Welcome to Uniform Server '. $uniserver .'!. This is the administration section of the server and
you can control your server from this Admin Panel.
Though this is still the ALPHA version of this panel, it is fully useable
and also complete. It is also easy to use and very user friendly.
<br />
You can also translate this Admin Panel into your own language easily, and if you will like to
do so, please upload a copy to our <a href="http://sourceforge.net/tracker/?atid=799696&group_id=53691&func=browse" target="_sf">
SourceForge Translation Tracking System</a> for others to download.
<br />
The translations for older versions of this Admin Panel will not work! Click the link on top to download the new version.
<br />
Also, new things have been added and some taken out and some functions may not
work if the required plugin is not installed or available.
<br />
Please report all bugs and errors on our <a href="http://forum.uniformserver.com/" target="_forum">forum</a>.
<br />
<br />
Thanks
<br />
<a href="http://www.uniformserver.com/" target="_home">The Uniform Server Development Team</a>',
'main-secure' => 'Security Checklist',
'main-text-0' => 'Change the username/password for the Admin Panel <a href="apsetup.php">here</a>',
'main-text-1' => 'Change the username/password for the server <a href="psetup.php">here</a>',
'main-text-2' => 'Change the root password for mysql by editing <a href="mqsetup.php">here</a>',
'main-text-3' => 'Run the <a href="security.php">Security Console</a> and see if everything is OK.',
//--------------------------------------------------------------------------------------------
// Update
//--------------------------------------------------------------------------------------------
'update-head' => 'Uniform Server Version Check',
'update-check' => 'Checking Version...',
'update-true' => '
Installed version of the Uniform Server is the latest one.
<br />
You don\'t need to update it.
<br />',
'update-false' => 'A Newer version of the Uniform Server is available!',
'update-new' => 'New Version',
'update-yours' => 'Installed Version',
'update-get' => 'You can get the newer version from our website by clicking the link below.',
//--------------------------------------------------------------------------------------------
// Server Shutdown
//--------------------------------------------------------------------------------------------
'stop-head' => 'Server Shutdown',
'stop-shut' => 'Verify Shutdown',
'stop-killing' => 'Click on Shutdown! and the server will be automatically shut down.',
'stop-stop' => 'Shutdown!',
//--------------------------------------------------------------------------------------------
// Downlaod Manager
//--------------------------------------------------------------------------------------------
'down-head' => 'Download Manager',
'down-aval' => 'Download available updates, plugins, and addons.',
'down-text' => '
This feature is still in development and when it comes out you will be able to download plugins,
addons, and patches for your server. Some features will also have a installer that allows you to
automatically install them and some are going to be installed manually by you.',
//--------------------------------------------------------------------------------------------
// Apache Configuration
//--------------------------------------------------------------------------------------------
'aconfig-head' => 'Apache Configuration',
'aconfig-conf' => 'Configure Apache',
'aconfig-sname' => 'Server Name',
'aconfig-wemail' => 'Server Admin Email',
'aconfig-difiles' => 'Directory Index Files',
'aconfig-ssi' => 'Server Side Includes',
'aconfig-ssig' => 'Server Signature',
'aconfig-listen' => 'Listen',
'aconfig-text-0' => 'something',
'aconfig-text-1' => '
The changes have been successfully saved. <br /> Changes will take effect after server restart!',
'aconfig-save' => 'Save',
'aconfig-module' => 'At the moment PHP is loaded as Apache module.',
'aconfig-cgi' => 'At the moment PHP scripts are executed though Apache CGI interface.',
'aconfig-help' => '?',
//--------------------------------------------------------------------------------------------
// PHP Configuration
//--------------------------------------------------------------------------------------------
'pconfig-head' => 'PHP Configuration',
'pconfig-conf' => 'Configure PHP',
'pconfig-smode' => 'Safe Mode',
'pconfig-rg' => 'Register Globals',
'pconfig-mtexec' => 'Maximum Script Execute Time (s.)',
'pconfig-mmexec' => 'Maximum Memory Amount (MB)',
'pconfig-ssig' => 'Show PHP In Server Signature',
'pconfig-perror' => 'Print Errors',
'pconfig-mpsize' => 'Maximum Post Size',
'pconfig-musize' => 'Maximum Upload Size',
'pconfig-text-0' => 'something',
'pconfig-text-1' => '
The changes have been successfully saved. <br /> Changes will take effect after server restart!',
'pconfig-save' => 'Save',
'pconfig-module' => 'At the moment PHP is loaded as Apache module.',
'pconfig-cgi' => 'At the moment PHP scripts are executed though Apache CGI interface.',
'pconfig-help' => '?',
//--------------------------------------------------------------------------------------------
// VHost Manager
//--------------------------------------------------------------------------------------------
'vhost-head' => 'Virtual Host',
'vhost-setup' => 'Virtual Host Setup',
'vhost-settings' => 'Virtual Host Settings',
'vhost-text-0' => 'You have',
'vhost-text-1' => 'hosts in your httpd.conf file:',
'vhost-text-2' => 'Error in hosts file:',
'vhost-text-3' => 'All hostnames exist in hosts file!',
'vhost-new' => '
Use this new and cool tool to add more virtual hosts to your server without having to edit
the httpd.conf file yourself.',
'vhost-new-ex' => '(ex. newhost.localhost)',
'vhost-name' => 'Name:',
'vhost-path' => 'Path to DocumentRoot:',
'vhost-path-ex' => '(ex. c:/www/newhost)',
'vhost-opt' => 'Optional additions:',
'vhost-opt-ex' => '(ex. error_log etc.)',
'vhost-dne' => 'does not exist',
'vhost-make' => 'Create VHost',
'vhost-error-1' => 'Error in path to your hosts-file!',
'vhost-error-2' => 'Error in path to your httpd.conf!',
'vhost-text-4' => 'Safe_mode is On, so restart Apache manually!',
'vhost-credit' => 'Script By Sukos',
//--------------------------------------------------------------------------------------------
// Server Migration
//--------------------------------------------------------------------------------------------
'smig-head' => 'Server Migration',
'smig-sub' => 'Migration Tool [BETA FEATURE]',
'smig-text-0' => 'The Server Migration tool helps you move from one server to another.
It allows you to migrate from another server to this server. It also allows you to migrate an old
Uniform Server installation to this.
<br />
<b>This script must be run via localhost for best result</b>',
'smig-text-1' => 'The following is for the WWW [htdocs] location of the server you are trying to migrate.
You can choose to migrate only a file or a directory.',
'smig-text-2' => 'This will migrate your MySQL database from the old servers to this server.
Before using this part of the script, please note that <b>problems can occur if you have the same
database name in the old installations and in this one</b>.',
'smig-success' => 'The migration was successful! Please go and check to make sure now.',
'smig-www' => 'WWW [htdocs] Location',
'smig-mysql' => 'MySQL Data Directory',
//--------------------------------------------------------------------------------------------
// Server Security Console
//--------------------------------------------------------------------------------------------
'secure1-head' => 'Security Alert!',
'secure1-sub' => 'Possible Attack',
'secure1-text-0' => 'IP ADDRESS is not 127.0.0.1, but',
'secure1-text-1' => 'Note: HTTP_REFERER is',
'secure1-text-2' => 'To disable this warning set $unisecure to 0 in: /home/admin/www/includes/config.inc.php',
//--------------------------------------------------------------------------------------------
// Admin Panel Setup
//--------------------------------------------------------------------------------------------
'apsetup-head' => 'Admin Panel Configuration',
'apsetup-sub-0' => 'User Management',
'apsetup-text-0' => 'Setup the username and password for the Admin Panel here. Please note that you might have
to activate this feature in the /home/admin/www/.htaccess file.',
'apsetup-user' => 'Username',
'apsetup-pass' => 'Password',
'apsetup-change' => 'Change',
'apsetup-success' => 'The Admin Panel username/password has been changed to the new values:',
//--------------------------------------------------------------------------------------------
// Private Server Setup
//--------------------------------------------------------------------------------------------
'psetup-head' => 'Private Server Configuration',
'psetup-sub-0' => 'User Management',
'psetup-text-0' => 'Setup the username and password for your Private Server here. Please note that you might have
to activate this feature in the /www/.htaccess file.',
'psetup-user' => 'Username',
'psetup-pass' => 'Password',
'psetup-change' => 'Change',
'psetup-success' => 'Your Private Server username/password has been changed to the new values:',
//--------------------------------------------------------------------------------------------
// MySQL Setup
//--------------------------------------------------------------------------------------------
'mqsetup-head' => 'MySQL Server Configuration',
'mqsetup-sub-0' => 'User Management',
'mqsetup-text-0' => 'Setup the MySQL password here. After changing the MySQL password, please note that you <b>
must shutdown the server using the Stop.bat</b> file and then start the server over again.',
'mqsetup-pass' => 'MySQL Password',
'mqsetup-change' => 'Change',
'mqsetup-success' => 'Your MySQL password has been changed to the new value:',
//--------------------------------------------------------------------------------------------
// Server Security Center
//--------------------------------------------------------------------------------------------
'secure-head' => 'Security Center',
'secure-sub-0' => 'User Management Security',
'secure-sub-1' => 'Server Security',
'secure-text-0' => 'This part of the security center will check all user management settings to make sure that
everything is set. It will tell you if something needs to be changed.',
'secure-text-1' => 'SECURITY MSG',
'secure-text-2' => 'STATUS',
'secure-text-3' => 'Admin Panel',
'secure-text-X' => 'If the username/password is still set to root, then you probably need to change this
by clicking the UNSECURE link.',
'secure-secure' => 'SECURE',
'secure-unsecure' => 'UNSECURE',
'secure-text-7' => 'If the password is still set to root, then you probably need to change this by clicking the UNSECURE link.',
'secure-text-8' => 'This part of the security center will check and make sure the server settings are appropriate and set corectly.',
'secure-text-9' => 'PHP Safe Mode',
'secure-text-10' => 'This checks to see if PHP is running in SAFE MODE. Now, PHP does not have to run in SAFE MODE, but
if you want the extra security, you can set it by clicking on the UNSECURE link.',
'secure-text-p' => 'Personal Server',
'secure-text-s' => 'MySQL Server',
'secure-text-11' => 'Admin Panel Access',
'secure-text-12' => 'Server Access',
'secure-text-13' => 'While this is another feature that is not throughly important as other features are in place against
outside access to the Admin Panel, this checks to see if your Admin Panel is secured using the Auth method. Please change this
by editing the '.$apanel_path.'/.htaccess file.',
'secure-text-14' => 'If you are running your server in Production Mode, Skip this one. If not and you would like to
add more security to the server by blocking it using the Auth method, then change this in by editing the '.$server_path.'/.htaccess file.',
'secure-view' => 'Local View',
'secure-look' => 'Due to the fact that some PC\'s have a different hostname set rather than localhost, we use the IP method here. This
checks to make sure that you are viewing the Admin Panel (this) from local.',
);
# Beta Feature, Currently For Debugging Only
#array2table($US, true);
?>

View File

@ -0,0 +1,2 @@
<h3><?=$US['nav-misc']?></h3>
<a target="_forum" onclick="h(this);" href="http://forum.uniformserver.com"><?=$US['nav-sup']?></a>

View File

@ -0,0 +1,3 @@
<h3><?=$US['nav-plugins']?></h3>
<a target="_pear" onclick="h(this);" href="<?=$apanel?>/plugins/pear/go_pear.php"><?=$US['nav-pear']?></a>
<a target="content" onclick="h(this);" href="plugins/eaccelerator/control.php"><?=$US['nav-eaccelerator']?></a>

View File

@ -0,0 +1,34 @@
<?
/*
####################################################
# Name: The Uniform Server Security 0.5
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
if ($unisecure=="1") {
if ( !($usip == "127.0.0.1")) {
#if ( !($usip == "127.0.0.1") || !($hname == "localhost")) { //Causes error on some machines
echo "
<div id=\"main\">
<h2>&#187; ".$US['secure1-head']."</h2>
<h3>".$US['secure1-sub']."</h3>
<p>
".$US['secure1-text-0']." '<b>".$usip."</b>'.
<br />
".$US['secure1-text-1']." '<b>".$hname."</b>'.
<br />
<br />
".$US['secure1-text-2']."
<p>
</div>";
require "footer.php";
exit;
}
}
?>

View File

@ -0,0 +1,5 @@
<h3><?=$US['nav-start']?></h3>
<a target="content" onclick="h(this);" href="stop.php"><?=$US['nav-sserver']?></a>
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/rserver.cgi"><?=$US['nav-rserver']?></a>
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/rmysql.cgi"><?=$US['nav-rmysql']?></a>
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/smysql.cgi"><?=$US['nav-smysql']?></a>

View File

@ -0,0 +1,8 @@
<h3><?=$US['nav-tools']?></h3>
<a target="_phpmyadmin" onclick="h(this);" href="<?=$apanel?>/phpMyAdmin/"><?=$US['nav-pma']?></a>
<a target="_phpmyadmin" onclick="h(this);" href="<?=$apanel?>/phpMyBackupPro/"><?=$US['nav-pmbp']?></a>
<a target="content" onclick="h(this);" href="downloads.php"><?=$US['nav-down']?></a>
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/elog.cgi"><?=$US['nav-elog']?></a>
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/u2w.cgi"><?=$US['nav-u2w']?></a>
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/dserver.cgi"><?=$US['nav-del']?></a>
<a target="content" onclick="h(this);" href="migrate.php"><?=$US['nav-smig']?></a>

View File

@ -0,0 +1,56 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
if(file_get_contents("$apanel_path/includes/.lang") == "")
{
header("Location: lang.php?en");
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><?=$US['title']?> <? include('includes/.version'); ?></title>
<meta name="author" content="Olajide Olaolorun" />
<meta http-equiv="page-enter" content="blendtrans(duration=0.1)" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="<? echo $apanel; ?>/js/main.js"></script>
<link href="<? echo $apanel; ?>/css/main.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="<? echo $apanel; ?>/favicon.ico" />
<link title="Homepage" href="./index.php" rel="top" />
<link title="Up" href="./index.php" rel="up" />
<link title="First page" href="./index.php" rel="first" />
<link title="Previous page" href="./index.php" rel="previous" />
<link title="Next page" href="./index.php" rel="next" />
<link title="Last page" href="./index.php" rel="last" />
<link title="Table of contents" href="./index.php" rel="toc" />
<link title="Site map" href="./index.php" rel="index" />
</head>
<frameset rows="97,*" marginwidth="0" marginheight="0" frameborder="0" border="0" borderwidth="0">
<frame src="header.php" name="header" scrolling="no" noresize="noresize" id="header" />
<frameset cols="225,*" marginwidth="0" marginheight="0" frameborder="0" border="0" borderwidth="0">
<frame src="navigation.php" name="navigation" scrolling="auto" noresize="noresize" id="navigation" />
<frame src="start.php" name="content" scrolling="auto" noresize="noresize" id="content" />
</frameset>
</frameset>
<noframes>
<body bgcolor="#4F4F97">
<h1>Frame Support Needed</h1>
</body>
</noframes>
</html>

View File

@ -0,0 +1,19 @@
/*
####################################################
# Name: The Uniform Server JS 1.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
function h(t)
{
if(typeof last == "undefined")
last=document.anchors[0];
last.className='n';
t.className='nh';
t.blur();
last=t;
}

View File

@ -0,0 +1,15 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
$fp=fopen("includes/.lang","w");
fwrite($fp,$_SERVER['QUERY_STRING']);
fclose($fp);
header("Location: index.php");
?>

View File

@ -0,0 +1,99 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
include "includes/header.php";
include "includes/secure.php";
if ($_POST['submit']) {
function copyr($source, $dest) {
// Simple copy for a file
if (is_file($source)) {
return copy($source, $dest);
}
// Make destination directory
if (!is_dir($dest)) {
mkdir($dest);
}
// Loop through the folder
$dir = dir($source);
while (false !== $entry = $dir->read()) {
// Skip pointers
if ($entry == '.' || $entry == '..' || $entry == 'Thumbs.db') {
continue;
}
// Deep copy directories
if ($dest !== "$source/$entry") {
copyr("$source/$entry", "$dest/$entry");
}
}
// Clean up
$dir->close();
return true;
}
$source1 = $_POST['getlocate'];
$dest1 = $_POST['destination'];
//copyr($source1, $dest1);
?>
<div id="main">
<h2>&#187; <?=$US['smig-head']?></h2>
<h3><?=$US['smig-sub']?></h3>
<p><?=$US['smig-success']?><br /><?=$_POST['getlocate'];?></p>
</div>
<?
}
else {
?>
<div id="main">
<h2>&#187; <?=$US['smig-head']?></h2>
<h3><?=$US['smig-sub']?></h3>
<p><?=$US['smig-text-0']?></p>
<p><?=$US['smig-text-1']?></p>
<form action="<?=$PHP_SELF?>" method="post">
<input type="hidden" value="/www/" name="destination" />
<p>
<?=$US['smig-www']?>
<br />
<input type="text" name="getlocate" />
</p>
<input type="submit" name="submit" value="Migrate" />
</form>
<p><?=$US['smig-text-2']?></p>
<form action="<?=$PHP_SELF?>" method="post">
<input type="hidden" value="/usr/local/mysql/data/" name="destination" />
<p>
<?=$US['smig-mysql']?>
<br />
<input type="text" name="getlocate" />
</p>
<input type="submit" name="submit" value="Migrate" />
</form>
</div>
<?
}
// Footer
include "includes/footer.php";
?>

View File

@ -0,0 +1,82 @@
<?
/*
####################################################
# Name: The Uniform Server Setup
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
include "includes/header.php";
include "includes/secure.php";
if ( !(file_exists($mysqlpwd)) ) {
$FHandle = fopen($mysqlpwd, 'w');
fclose($FHandle);
}
if ($_POST['submit']) {
$nwpass = $_POST['qpass'];
$urdata = "$nwpass";
$wfile = fopen($mysqlpwd, 'w') ;
fwrite($wfile, $urdata);
fclose($wfile);
?>
<div id="main">
<h2>&#187; <?=$US['mqsetup-head']?></h2>
<h3><?=$US['mqsetup-sub-0']?></h3>
<p>
<?=$US['mqsetup-success']?>
<br />
<br />
<?=$US['mqsetup-pass']?>: <?=$_POST['qpass'];?>
</p>
</div>
<?
}
else {
$tfile = fopen($mysqlpwd, "r");
$fcontents = fgets($tfile);
?>
<div id="main">
<h2>&#187; <?=$US['mqsetup-head']?></h2>
<h3><?=$US['mqsetup-sub-0']?></h3>
<p><?=$US['mqsetup-text-0']?></p>
<form action="<?=$PHP_SELF?>" method="post">
<table width="100%">
<tr>
<td width="100">
<p><?=$US['mqsetup-pass']?></p>
</td>
<td>
<input type="text" name="qpass" value="<?=$fcontents?>" />
</td>
</tr>
</table>
<br />
<input type="submit" name="submit" value="<?=$US['mqsetup-change']?>" />
</form>
</div>
<?
fclose($tfile);
}
// Footer
include "includes/footer.php";
?>

View File

@ -0,0 +1 @@
root

View File

@ -0,0 +1,32 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
include "includes/header.php";
?>
<div id="navbar">
<? include "$apanel_path/includes/basic.inc"; ?>
<? include "$apanel_path/includes/server.inc"; ?>
<? include "$apanel_path/includes/config.inc"; ?>
<? include "$apanel_path/includes/tool.inc"; ?>
<? include "$apanel_path/includes/plugin.inc"; ?>
<? include "$apanel_path/includes/python.inc"; ?>
<? include "$apanel_path/includes/java.inc"; ?>
<? include "$apanel_path/includes/misc.inc"; ?>
<? include "$apanel_path/includes/doc.inc"; ?>
<? include "$apanel_path/includes/lang.inc"; ?>
</div>
</body>
</html>

View File

@ -0,0 +1,168 @@
<?
/*
####################################################
# Name: The Uniform Server Admin Panel 2.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex)
# Web: http://www.uniformserver.com
####################################################
*/
// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php";
include "includes/header.php";
include "includes/secure.php";
?>
<div id="main">
<h2>&#187; <?=$US['pconfig-head']?></h2>
<h3><?=$US['pconfig-conf']?></h3>
<?
# -- Determines Apache version.
if (preg_match("/Apache\/2/i", $_SERVER["SERVER_SOFTWARE"])) {
$Apache2 = True;
}
else {
$Apache2 = False;
}
# --
# -- Determines PHP mode
if (!preg_match("/^cgi/",php_sapi_name())) {
$PHPmod = True;
}
else {
$PHPmod = False;
}
# --
$PHP = new Config ("/usr/local/PHP/php.ini",";");
$PHP->Var_Name =array ("safe_mode =","expose_php =", "register_globals =", "max_execution_time =",
"memory_limit =", "display_errors =", "post_max_size =", "upload_max_filesize =");
$PHP->Var_Text =array (
"".$US['pconfig-smode']."","".$US['pconfig-ssig']."", "".$US['pconfig-rg']."",
"".$US['pconfig-mtexec']."","".$US['pconfig-mmexec']."","".$US['pconfig-perror']."",
"".$US['pconfig-mpsize']."","".$US['pconfig-musize']."");
$PHP->Var_Help =array (
"http://php.benscom.com/manual/en/features.safe-mode.php",
"http://www.php.net/manual/en/security.hiding.php#security.hiding",
"http://www.php.net/release_4_1_0.php",
"http://www.php.net/manual/en/configuration.php#ini.max-execution-time",
"http://www.php.net/manual/en/configuration.php#ini.memory-limit",
"http://www.php.net/manual/en/configuration.php#ini.display-errors",
"http://www.php.net/manual/en/features.file-upload.php#features.file-upload.post-method",
"http://www.php.net/manual/en/configuration.php#ini.upload-max-filesize");
//--------------------------------------------------------------------
// import_request_variables("gP", "st");
$step=$HTTP_POST_VARS['Submit'];
if ($step == "next") {
echo "<p>".$US['pconfig-text-0']."</p>";
}
else {
if ($step == "Save") {
$PHP->replace_values ($HTTP_POST_VARS);
echo "<p><font color=\"red\">".$US['pconfig-text-1']."</font></p>";
}
?>
<form action="
<?
echo $_SERVER["PHP_SELF"]."\" name=\"f\" method=\"post\">";
$PHP->echo_values ();
?>
<br />
<input type="submit" value="<?=$US['pconfig-save']?>" name="Submit" />
</form>
<br />
<?
if ($PHPmod==True) {
echo "<p><font color=\"red\">".$US['aconfig-module']."</font></p>";
}
else {
echo "<p><font color=\"red\">".$US['aconfig-cgi']."</font></p>";
}
}
//--------------------------------------------------------------------
class Config
{
var $contents;
var $name;
var $comments;
var $Var_Name;
var $Var_Text;
var $Var_Help;
var $classnum;
function Config ($file_name, $comments)
{
$this->comments=$comments;
$this->name=$file_name;
$fd = fopen ($this->name, "r");
$this->contents = fread ($fd, filesize ($file_name));
fclose ($fd);
$this->classnumber=$GLOBALS["$Configclassnumber"]=$GLOBALS["$Configclassnumber"]+1;
}
function f_write ()
{
$fd = fopen ($this->name, "w");
$ok = fwrite ($fd, $this->contents);
fclose ($fd);
}
function echo_values ()
{
include "includes/lang/".file_get_contents("includes/.lang").".php";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
$item=0;
foreach ($this->Var_Name as $loop){
$Var_ID="C".$this->classnumber."i".$item;
$Var_Name=$this->Var_Name[$item];
$Var_Text=$this->Var_Text[$item];
$Var_Help=$this->Var_Help[$item];
$comments=$this->comments;
preg_match("/\n\s*$Var_Name\s+([^$comments^\n]+)/i", $this->contents, $tag);
echo "
<tr>
<td width=\"250\"><p>$Var_Text:</p></td>
<td>
<p><input type=\"text\" name=\"$Var_ID\" size=\"31\" maxlength=\"2048\" value='$tag[1]' /> ";
if ($Var_Help != "") {echo "<a href=\"$Var_Help\" target=\"_help\">".$US['pconfig-help']."</a>";};
echo "</p>";
echo "</td>";
echo "</tr>";
$item=$item+1;
}
echo "</table>";
}
function replace_values ($HTTP_POST_VARS)
{
$item=0;
foreach ($this->Var_Name as $loop){
$Var_ID="C".$this->classnumber."i".$item;
$data=$HTTP_POST_VARS[$Var_ID];
$comments=$this->comments;
$this->contents=preg_replace("/\n(\s*$loop)\s+([^$comments]+)/i", "\n\\1 $data\n\n", $this->contents, 1);
$item=$item+1;
}
$this->f_write ();
}
}
?>
</div>
<?
// Footer
include "includes/footer.php";
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,309 @@
<?php
/* $Id: browse_foreigners.php 10309 2007-04-20 16:43:45Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* display selection for relational field values
*/
/**
* Gets a core script and starts output buffering work
*/
require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db', 'table', 'field'));
require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet();
if ($ob_mode) {
PMA_outBufferPre($ob_mode);
}
}
require_once('./libraries/header_http.inc.php');
$field = urldecode($field);
/**
* Displays the frame
*/
$per_page = 200;
require_once('./libraries/relation.lib.php'); // foreign keys
require_once('./libraries/transformations.lib.php'); // Transformations
$cfgRelation = PMA_getRelationsParam();
$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE);
$override_total = TRUE;
if (!isset($pos)) {
$pos = 0;
}
$foreign_limit = 'LIMIT ' . $pos . ', ' . $per_page . ' ';
if (isset($foreign_navig) && $foreign_navig == $strShowAll) {
unset($foreign_limit);
}
require('./libraries/get_foreign.lib.php');
if (isset($pk)) {
$pk_uri = '&amp;pk=' . urlencode($pk);
?>
<input type="hidden" name="pk" value="<?php echo urlencode($pk); ?>" />
<?php
} else {
$pk_uri = '';
}
$gotopage = '';
$showall = '';
// $the_total comes from get_foreign.lib.php
if (isset($disp_row) && is_array($disp_row)) {
if ( $cfg['ShowAll'] && ($the_total > $per_page) ) {
$showall = '<input type="submit" name="foreign_navig" value="' . $strShowAll . '" />';
}
$session_max_rows = $per_page;
$pageNow = @floor($pos / $session_max_rows) + 1;
$nbTotalPage = @ceil($the_total / $session_max_rows);
if ( $the_total > $per_page ) {
$gotopage = PMA_pageselector(
'browse_foreigners.php?field=' . urlencode($field) .
'&amp;' . PMA_generate_common_url($db, $table)
. $pk_uri .
'&amp;fieldkey=' . (isset($fieldkey) ? $fieldkey : '') .
'&amp;foreign_filter=' . (isset($foreign_filter) ? htmlspecialchars($foreign_filter) : '') .
'&amp;',
$session_max_rows,
$pageNow,
$nbTotalPage
);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="<?php echo $available_languages[$lang][2]; ?>"
lang="<?php echo $available_languages[$lang][2]; ?>"
dir="<?php echo $text_dir; ?>">
<head>
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<link rel="stylesheet" type="text/css"
href="./css/phpmyadmin.css.php?<?php echo PMA_generate_common_url( '', '' ); ?>&amp;js_frame=right&amp;nocache=<?php echo $_SESSION['PMA_Config']->getMtime(); ?>" />
<script src="./js/functions.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript" language="javascript">
//<![CDATA[
self.focus();
function formupdate( field, key ) {
if (opener && opener.document && opener.document.insertForm) {
var field = 'field_' + field;
<?php if ( isset( $pk ) ) { ?>
var element_name = field + '[multi_edit][<?php echo urlencode( $pk ); ?>][]';
<?php } else { ?>
var element_name = field + '[]';
<?php } ?>
<?php if ( isset( $fieldkey ) && is_numeric($fieldkey)) { ?>
var element_name_alt = field + '[<?php echo $fieldkey; ?>]';
<?php } else { ?>
var element_name_alt = field + '[0]';
<?php } ?>
if (opener.document.insertForm.elements[element_name]) {
// Edit/Insert form
opener.document.insertForm.elements[element_name].value = key;
self.close();
return false;
} else if (opener.document.insertForm.elements[element_name_alt]) {
// Search form
opener.document.insertForm.elements[element_name_alt].value = key;
self.close();
return false;
}
}
alert('<?php echo PMA_jsFormat($strWindowNotFound); ?>');
}
//]]>
</script>
</head>
<body id="body_browse_foreigners">
<form action="browse_foreigners.php" method="post">
<fieldset>
<?php echo PMA_generate_common_hidden_inputs( $db, $table ); ?>
<input type="hidden" name="field" value="<?php echo urlencode($field); ?>" />
<input type="hidden" name="fieldkey"
value="<?php echo isset($fieldkey) ? $fieldkey : ''; ?>" />
<?php if ( isset( $pk ) ) { ?>
<input type="hidden" name="pk" value="<?php echo urlencode($pk); ?>" />
<?php } ?>
<span class="formelement">
<label for="input_foreign_filter"><?php echo $strSearch . ':'; ?></label>
<input type="text" name="foreign_filter" id="input_foreign_filter"
value="<?php echo isset($foreign_filter) ? htmlspecialchars($foreign_filter) : ''; ?>" />
<input type="submit" name="submit_foreign_filter" value="<?php echo $strGo;?>" />
</span>
<span class="formelement">
<?php echo $gotopage; ?>
</span>
<span class="formelement">
<?php echo $showall; ?>
</span>
</fieldset>
</form>
<table width="100%">
<?php
if (isset($disp_row) && is_array($disp_row)) {
$header = '<tr>
<th>' . $strKeyname . '</th>
<th>' . $strDescription . '</th>
<td width="20%"></td>
<th>' . $strDescription . '</th>
<th>' . $strKeyname . '</th>
</tr>';
echo '<thead>' . $header . '</thead>' . "\n"
.'<tfoot>' . $header . '</tfoot>' . "\n"
.'<tbody>' . "\n";
$values = array();
$keys = array();
foreach ( $disp_row as $relrow ) {
if ($foreign_display != FALSE) {
$values[] = $relrow[$foreign_display];
} else {
$values[] = '';
}
$keys[] = $relrow[$foreign_field];
}
asort( $keys );
$hcount = 0;
$odd_row = true;
$val_ordered_current_row = 0;
$val_ordered_current_equals_data = false;
$key_ordered_current_equals_data = false;
foreach ( $keys as $key_ordered_current_row => $value ) {
//for ( $i = 0; $i < $count; $i++ ) {
$hcount++;
if ($cfg['RepeatCells'] > 0 && $hcount > $cfg['RepeatCells']) {
echo $header;
$hcount = 0;
$odd_row = true;
}
$key_ordered_current_key = $keys[$key_ordered_current_row];
$key_ordered_current_val = $values[$key_ordered_current_row];
$val_ordered_current_key = $keys[$val_ordered_current_row];
$val_ordered_current_val = $values[$val_ordered_current_row];
$val_ordered_current_row++;
if (PMA_strlen( $val_ordered_current_val ) <= $cfg['LimitChars']) {
$val_ordered_current_val = htmlspecialchars($val_ordered_current_val);
$val_ordered_current_val_title = '';
} else {
$val_ordered_current_val_title =
htmlspecialchars( $val_ordered_current_val );
$val_ordered_current_val =
htmlspecialchars( PMA_substr( $val_ordered_current_val, 0,
$cfg['LimitChars'] ) . '...' );
}
if (PMA_strlen( $key_ordered_current_val ) <= $cfg['LimitChars']) {
$key_ordered_current_val = htmlspecialchars($key_ordered_current_val);
$key_ordered_current_val_title = '';
} else {
$key_ordered_current_val_title =
htmlspecialchars( $key_ordered_current_val );
$key_ordered_current_val =
htmlspecialchars( PMA_substr( $key_ordered_current_val, 0,
$cfg['LimitChars'] ) . '...' );
}
if ( ! empty( $data ) ) {
$val_ordered_current_equals_data = $val_ordered_current_key == $data;
$key_ordered_current_equals_data = $key_ordered_current_key == $data;
}
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
<td nowrap="nowrap">
<?php
echo ($key_ordered_current_equals_data ? '<b>' : '')
.'<a href="#" title="' . $strUseThisValue
. ($key_ordered_current_val_title != '' ? ': ' . $key_ordered_current_val_title : '') . '"'
.' onclick="formupdate(\'' . md5($field) . '\', \''
. htmlspecialchars($key_ordered_current_key) . '\'); return false;">'
.htmlspecialchars($key_ordered_current_key) . '</a>' . ($key_ordered_current_equals_data ? '</b>' : '');
?></td>
<td>
<?php
echo ($key_ordered_current_equals_data ? '<b>' : '')
. '<a href="#" title="' . $strUseThisValue . ($key_ordered_current_val_title != '' ? ': '
. $key_ordered_current_val_title : '') . '" onclick="formupdate(\''
. md5($field) . '\', \'' . htmlspecialchars($key_ordered_current_key) . '\'); return false;">'
. $key_ordered_current_val . '</a>' . ($key_ordered_current_equals_data ? '</b>' : '');
?></td>
<td width="20%">
<img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>"
alt="" width="1" height="1"></td>
<td>
<?php
echo ($val_ordered_current_equals_data ? '<b>' : '')
. '<a href="#" title="' . $strUseThisValue . ($val_ordered_current_val_title != '' ? ': '
. $val_ordered_current_val_title : '') . '" onclick="formupdate(\'' . md5($field)
. '\', \'' . htmlspecialchars($val_ordered_current_key) . '\'); return false;">'
. $val_ordered_current_val . '</a>' . ($val_ordered_current_equals_data ? '</b>' : '');
?></td>
<td nowrap="nowrap">
<?php
echo ($val_ordered_current_equals_data ? '<b>' : '') . '<a href="#" title="'
. $strUseThisValue . ($val_ordered_current_val_title != '' ? ': ' . $val_ordered_current_val_title : '')
. '" onclick="formupdate(\'' . md5($field) . '\', \''
. htmlspecialchars($val_ordered_current_key) . '\'); return false;">' . htmlspecialchars($val_ordered_current_key)
. '</a>' . ($val_ordered_current_equals_data ? '</b>' : '');
?></td>
</tr>
<?php
} // end while
}
?>
</tbody>
</table>
</body>
</html>
<?php
/**
* Close MySql connections
*/
if (isset($controllink) && $controllink) {
@PMA_DBI_close($controllink);
}
if (isset($userlink) && $userlink) {
@PMA_DBI_close($userlink);
}
/**
* Sends bufferized data
*/
if (isset($cfg['OBGzip']) && $cfg['OBGzip']
&& isset($ob_mode) && $ob_mode) {
PMA_outBufferPost($ob_mode);
}
?>

View File

@ -0,0 +1,22 @@
<?php
/* $Id: calendar.php 8063 2005-12-04 23:14:41Z nijel $ */
require_once('./libraries/common.lib.php');
require_once('./libraries/header_http.inc.php');
$page_title = $strCalendar;
require('./libraries/header_meta_style.inc.php');
?>
<script type="text/javascript" language="javascript" src="./js/tbl_change.js"></script>
<script type="text/javascript" language="javascript">
//<![CDATA[
var month_names = new Array("<?php echo implode('","', $month); ?>");
var day_names = new Array("<?php echo implode('","', $day_of_week); ?>");
var submit_text = "<?php echo $strGo; ?>";
//]]>
</script>
</head>
<body onload="initCalendar();">
<div id="calendar_data"></div>
<div id="clock_data"></div>
</body>
</html>

View File

@ -0,0 +1,87 @@
<?php
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Simple script to set correct charset for changelog
*
* @id $Id: changelog.php 9546 2006-10-13 08:03:06Z nijel $
*/
$changelog = htmlspecialchars(file_get_contents('ChangeLog'));
$replaces = array(
'@(http://[./a-zA-Z0-9.-]*[/a-zA-Z0-9])@'
=> '<a href="\\1">\\1</a>',
// sourceforge users
'/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
=> '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
'/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
=> 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
'/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
=> 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
// mail adresse
'/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
=> '\\1 <a href="mailto:\\3">\\2</a>',
// linking patches
'/patch\s*#?([0-9]{6,})/i'
=> '<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=\\1&amp;group_id=23067&amp;atid=377410">patch #\\1</a>',
// linking RFE
'/(?:rfe|feature)\s*#?([0-9]{6,})/i'
=> '<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=\\1&amp;group_id=23067&amp;atid=377411">RFE #\\1</a>',
// linking files
'/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
=> '\\1<a href="http://svn.sourceforge.net/viewvc/phpmyadmin/trunk/phpMyAdmin/\\2?annotate=HEAD">\\2</a>',
// FAQ entries
'/FAQ ([0-9]+)\.([0-9a-z]+)/i'
=> '<a href="http://localhost/phpMyAdmin/Documentation.html#faq\\1_\\2">FAQ \\1.\\2</a>',
// linking bugs
'/bug\s*#?([0-9]{6,})/i'
=> '<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=\\1&amp;group_id=23067&amp;atid=377408">bug #\\1</a>',
// all other 6+ digit numbers are treated as bugs
'/(?<!BUG|RFE|patch) #?([0-9]{6,})/i'
=> ' <a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=\\1&amp;group_id=23067&amp;atid=377408">bug #\\1</a>',
// CVE/CAN entries
'/((CAN|CVE)-[0-9]+-[0-9]+)/'
=> '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
// Highlight releases (with links)
'/(( ### )(([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+) (.*)))/'
=> '<a name="\\4_\\5_\\6_\\7"></a>\\2<a href="http://svn.sourceforge.net/viewvc/phpmyadmin/tags/RELEASE_\\4_\\5_\\6_\\7/phpMyAdmin">\\4.\\5.\\6.\\7 \\8</a>',
'/(( ### )(([0-9]+)\.([0-9]+)\.([0-9]+) (.*)))/'
=> '<a name="\\4_\\5_\\6_\\7"></a>\\2<a href="http://svn.sourceforge.net/viewvc/phpmyadmin/tags/RELEASE_\\4_\\5_\\6/phpMyAdmin">\\4.\\5.\\6 \\7</a>',
// Highlight releases (not linkable)
'/( ### )(.*)/'
=> '\\1<b>\\2</b>',
);
header('Content-type: text/html; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?'.'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title>phpMyAdmin - ChangeLog</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1>phpMyAdmin - ChangeLog</h1>
<?php
echo '<pre>';
echo preg_replace(array_keys($replaces), $replaces, $changelog);
echo '</pre>';
?>
</body>
</html>

View File

@ -0,0 +1,24 @@
<?php
/* $Id: chk_rel.php 9602 2006-10-25 12:25:01Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Gets some core libraries
*/
require_once('./libraries/common.lib.php');
require_once('./libraries/db_common.inc.php');
require_once('./libraries/relation.lib.php');
/**
* Gets the relation settings
*/
$cfgRelation = PMA_getRelationsParam(TRUE);
/**
* Displays the footer
*/
require_once('./libraries/footer.inc.php');
?>

View File

@ -0,0 +1,713 @@
<?php
/**
* Sets the php error reporting - Please do not change this line!
*/
if (!isset($old_error_reporting)) {
error_reporting(E_ALL);
@ini_set('display_errors', '1');
}
/**
* Your phpMyAdmin URL.
*/
$cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'] . (!empty($_SERVER['SERVER_PORT']) ? ':' . $_SERVER['SERVER_PORT'] : '') . substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1);
#$cfg['PmaAbsoluteUri'] = $_SERVER['HTTP_HOST'] . '/apanel/phpMyAdmin/';
/**
* Disable the default warning that is displayed on the DB Details Structure page if
* any of the required Tables for the relationfeatures could not be found
*/
$cfg['PmaNoRelation_DisableWarning'] = FALSE;
/**
* The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
* at least one server configuration uses 'cookie' auth_type, enter here a
* passphrase that will be used by blowfish. The maximum length seems to be 46
* characters.
*/
$cfg['blowfish_secret'] = '';
/**
* Server(s) configuration
*/
$i = 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysqli'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables).
// The controluser is also
// used for all relational
// features (pmadb)
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = implode ('', file ('../mysql_password')); // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
// this db is displayed in left frame
// It may also be an array of db-names, where sorting order is relevant.
$cfg['Servers'][$i]['verbose'] = 'Uniform Server'; // Verbose name for this host - leave blank to show the hostname
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // Database used for Relation, Bookmark and PDF Features
// (see scripts/create_tables.sql)
// - leave blank for no support
// DEFAULT: 'phpmyadmin'
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; // Bookmark table
// - leave blank for no bookmark support
// DEFAULT: 'pma_bookmark'
$cfg['Servers'][$i]['relation'] = 'pma_relation'; // table to describe the relation between links (see doc)
// - leave blank for no relation-links support
// DEFAULT: 'pma_relation'
$cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // table to describe the display fields
// - leave blank for no display fields support
// DEFAULT: 'pma_table_info'
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // table to describe the tables position for the PDF schema
// - leave blank for no PDF schema support
// DEFAULT: 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // table to describe pages of relationpdf
// - leave blank if you don't want to use this
// DEFAULT: 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // table to store column information
// - leave blank for no column comments/mime types
// DEFAULT: 'pma_column_info'
$cfg['Servers'][$i]['history'] = 'pma_history'; // table to store SQL history
// - leave blank for no SQL query history
// DEFAULT: 'pma_history'
$cfg['Servers'][$i]['verbose_check'] = TRUE; // set to FALSE if you know that your pma_* tables
// are up to date. This prevents compatibility
// checks and thereby increases performance.
$cfg['Servers'][$i]['AllowRoot'] = TRUE; // whether to allow root login
$cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use
= '';
$cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults
= array();
// If you have more than one server configured, you can set $cfg['ServerDefault']
// to any one of them to autoconnect to that server when phpMyAdmin is started,
// or set it to 0 to be given a list of servers without logging in
// If you have only one server configured, $cfg['ServerDefault'] *MUST* be
// set to that server.
$cfg['ServerDefault'] = 1; // Default server (0 = no default server)
$cfg['Server'] = '';
unset($cfg['Servers'][0]);
/**
* Other core phpMyAdmin settings
*/
$cfg['ExecTimeLimit'] = 600; // maximum execution time in seconds (0 for no limit)
$cfg['SkipLockedTables'] = FALSE; // mark used tables, make possible to show
// locked tables (since MySQL 3.23.30)
$cfg['ShowSQL'] = TRUE; // show SQL queries as run
$cfg['AllowUserDropDatabase'] = TRUE; // show a 'Drop database' link to normal users
$cfg['Confirm'] = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE'
$cfg['LoginCookieRecall'] = TRUE; // recall previous login in cookie auth. mode or not
$cfg['LoginCookieValidity'] = 3600; // validity of cookie login (in seconds)
$cfg['LeftFrameDBTree'] = TRUE; // turn the select-based light menu into a tree
$cfg['LeftFrameDBSeparator'] = '_'; // the separator to sub-tree the select-based light menu tree
$cfg['LeftFrameTableSeparator']= '_'; // Which string will be used to generate table prefixes
// to split/nest tables into multiple categories
$cfg['LeftFrameTableLevel'] = '1'; // How many sublevels should be displayed when splitting
// up tables by the above Separator
$cfg['ShowTooltip'] = TRUE; // display table comment as tooltip in left frame
$cfg['ShowTooltipAliasDB'] = TRUE; // if ShowToolTip is enabled, this defines that table/db comments
$cfg['ShowTooltipAliasTB'] = TRUE; // are shown (in the left menu and db_details_structure) instead of
// table/db names. Setting ShowTooltipAliasTB to 'nested' will only
// use the Aliases for nested descriptors, not the table itself.
// In the main frame, at startup...
$cfg['ShowStats'] = TRUE; // allow to display statistics and space usage in
// the pages about database details and table
// properties
$cfg['ShowMysqlInfo'] = TRUE; // whether to display the "MySQL runtime
$cfg['ShowMysqlVars'] = TRUE; // information", "MySQL system variables", "PHP
$cfg['ShowPhpInfo'] = TRUE; // information" and "change password" links for
$cfg['ShowChgPassword'] = TRUE; // simple users or not
$cfg['SuggestDBName'] = TRUE; // suggest a new DB name if possible (false = keep empty)
$cfg['ShowAll'] = TRUE; // allows to display all the rows
$cfg['MaxRows'] = 300; // maximum number of rows to display
$cfg['Order'] = 'ASC'; // default for 'ORDER BY' clause (valid
// values are 'ASC', 'DESC' or 'SMART' -ie
// descending order for fields of type
// TIME, DATE, DATETIME & TIMESTAMP,
// ascending order else-)
// For the export features...
$cfg['ZipDump'] = TRUE; // Allow the use of zip/gzip/bzip
$cfg['GZipDump'] = TRUE; // compression for
$cfg['BZipDump'] = TRUE; // dump files
$cfg['CompressOnFly'] = TRUE; // Will compress gzip/bzip2 exports on
// fly without need for much memory.
// If you encounter problems with
// created gzip/bzip2 files disable
// this feature.
// Tabs display settings
$cfg['LightTabs'] = FALSE; // use graphically less intense menu tabs
$cfg['PropertiesIconic'] = TRUE; // Use icons instead of text for the table display of a database (TRUE|FALSE|'both')
$cfg['PropertiesNumColumns'] = 1; // How many columns should be used for table display of a database?
// (a value larger than 1 results in some information being hidden)
/**
* Export defaults
*/
$cfg['Export']['format'] = 'sql'; // sql/latex/excel/csv/xml/xls/htmlexcel/htmlword
$cfg['Export']['compression'] = 'none'; // none/zip/gzip/bzip2
$cfg['Export']['asfile'] = TRUE;
$cfg['Export']['charset'] = '';
$cfg['Export']['onserver'] = TRUE;
$cfg['Export']['onserver_overwrite'] = FALSE;
$cfg['Export']['remember_file_template'] = TRUE;
$cfg['Export']['file_template_table'] = '__TABLE__-tabel_%Y-%m-%d';
$cfg['Export']['file_template_database'] = '__DB__-db_%Y-%m-%d';
$cfg['Export']['file_template_server'] = '__SERVER__-mysql_%Y-%m-%d';
$cfg['Export']['htmlexcel_columns'] = FALSE;
$cfg['Export']['htmlexcel_null'] = 'NULL';
$cfg['Export']['htmlword_structure'] = TRUE;
$cfg['Export']['htmlword_data'] = TRUE;
$cfg['Export']['htmlword_columns'] = FALSE;
$cfg['Export']['htmlword_null'] = 'NULL';
$cfg['Export']['xls_columns'] = FALSE;
$cfg['Export']['xls_null'] = 'NULL';
$cfg['Export']['csv_columns'] = FALSE;
$cfg['Export']['csv_null'] = 'NULL';
$cfg['Export']['csv_separator'] = ';';
$cfg['Export']['csv_enclosed'] = '&quot;';
$cfg['Export']['csv_escaped'] = '\\';
$cfg['Export']['csv_terminated'] = 'AUTO';
$cfg['Export']['excel_columns'] = FALSE;
$cfg['Export']['excel_null'] = 'NULL';
$cfg['Export']['excel_edition'] = 'win'; // win/mac
$cfg['Export']['latex_structure'] = TRUE;
$cfg['Export']['latex_data'] = TRUE;
$cfg['Export']['latex_columns'] = TRUE;
$cfg['Export']['latex_relation'] = TRUE;
$cfg['Export']['latex_comments'] = TRUE;
$cfg['Export']['latex_mime'] = TRUE;
$cfg['Export']['latex_null'] = '\textit{NULL}';
$cfg['Export']['latex_caption'] = TRUE;
$cfg['Export']['latex_data_label'] = 'tab:__TABLE__-data';
$cfg['Export']['latex_structure_label'] = 'tab:__TABLE__-structure';
$cfg['Export']['sql_structure'] = TRUE;
$cfg['Export']['sql_data'] = TRUE;
$cfg['Export']['sql_compat'] = 'NONE';
$cfg['Export']['sql_disable_fk'] = FALSE;
$cfg['Export']['sql_use_transaction'] = FALSE;
$cfg['Export']['sql_drop_database'] = FALSE;
$cfg['Export']['sql_drop_table'] = FALSE;
$cfg['Export']['sql_if_not_exists'] = FALSE;
$cfg['Export']['sql_auto_increment'] = TRUE;
$cfg['Export']['sql_backquotes'] = TRUE;
$cfg['Export']['sql_dates'] = FALSE;
$cfg['Export']['sql_relation'] = FALSE;
$cfg['Export']['sql_columns'] = FALSE;
$cfg['Export']['sql_delayed'] = FALSE;
$cfg['Export']['sql_ignore'] = FALSE;
$cfg['Export']['sql_hex_for_binary'] = TRUE;
$cfg['Export']['sql_type'] = 'insert'; // insert/update/replace
$cfg['Export']['sql_extended'] = FALSE;
$cfg['Export']['sql_comments'] = FALSE;
$cfg['Export']['sql_mime'] = FALSE;
$cfg['Export']['sql_header_comment'] = ''; // \n is replaced by new line
/**
* Link to the official MySQL documentation.
* Be sure to include no trailing slash on the path.
* See http://dev.mysql.com/doc/ for more information
* about MySQL manuals and their types.
*/
$cfg['MySQLManualBase'] = 'http://dev.mysql.com/doc/mysql/en';
/**
* Type of MySQL documentation:
* old - old style used in phpMyAdmin 2.3.0 and sooner
* searchable - "Searchable, with user comments"
* chapters - "HTML, one page per chapter"
* big - "HTML, all on one page"
* none - do not show documentation links
*/
$cfg['MySQLManualType'] = 'searchable';
/**
* PDF options
*/
$cfg['PDFPageSizes'] = array('A3', 'A4', 'A5', 'letter', 'legal');
$cfg['PDFDefaultPageSize'] = 'A4';
/**
* Language and charset conversion settings
*/
// Default language to use, if not browser-defined or user-defined
$cfg['DefaultLang'] = 'en-iso-8859-1';
// Force: always use this language - must be defined in
// libraries/select_lang.lib.php
// $cfg['Lang'] = 'en-iso-8859-1';
// Default charset to use for recoding of MySQL queries, does not take
// any effect when charsets recoding is switched off by
// $cfg['AllowAnywhereRecoding'] or in language file
// (see $cfg['AvailableCharsets'] to possible choices, you can add your own)
$cfg['DefaultCharset'] = 'iso-8859-1';
// Allow charset recoding of MySQL queries, must be also enabled in language
// file to make harder using other language files than unicode.
// Default value is FALSE to avoid problems on servers without the iconv
// extension and where dl() is not supported
$cfg['AllowAnywhereRecoding'] = TRUE;
// You can select here which functions will be used for charset conversion.
// Possible values are:
// auto - automatically use available one (first is tested iconv, then
// recode)
// iconv - use iconv or libiconv functions
// recode - use recode_string function
$cfg['RecodingEngine'] = 'auto';
// Specify some parameters for iconv used in charset conversion. See iconv
// documentation for details:
// http://www.gnu.org/software/libiconv/documentation/libiconv/iconv_open.3.html
$cfg['IconvExtraParams'] = '';
// Available charsets for MySQL conversion. currently contains all which could
// be found in lang/* files and few more.
// Charsets will be shown in same order as here listed, so if you frequently
// use some of these move them to the top.
$cfg['AvailableCharsets'] = array(
'iso-8859-1',
'iso-8859-2',
'iso-8859-3',
'iso-8859-4',
'iso-8859-5',
'iso-8859-6',
'iso-8859-7',
'iso-8859-8',
'iso-8859-9',
'iso-8859-10',
'iso-8859-11',
'iso-8859-12',
'iso-8859-13',
'iso-8859-14',
'iso-8859-15',
'windows-1250',
'windows-1251',
'windows-1252',
'windows-1256',
'windows-1257',
'koi8-r',
'big5',
'gb2312',
'utf-8',
'utf-7',
'x-user-defined',
'euc-jp',
'ks_c_5601-1987',
'tis-620',
'SHIFT_JIS'
);
/**
* Customization & design
*
* The graphical settings are now located in themes/themename/layout.inc.php
*/
$cfg['LeftPointerEnable'] = TRUE; // enable the left panel pointer
// (used when LeftFrameLight is FALSE)
// see also LeftPointerColor
// in layout.inc.php
$cfg['BrowsePointerEnable'] = TRUE; // enable the browse pointer
// see also BrowsePointerColor
// in layout.inc.php
$cfg['BrowseMarkerEnable'] = TRUE; // enable the browse marker
// see also BrowseMarkerColor
// in layout.inc.php
$cfg['TextareaCols'] = 40; // textarea size (columns) in edit mode
// (this value will be emphasized (*2) for sql
// query textareas and (*1.25) for query window)
$cfg['TextareaRows'] = 7; // textarea size (rows) in edit mode
$cfg['LongtextDoubleTextarea'] = TRUE; // double size of textarea size for longtext fields
$cfg['TextareaAutoSelect'] = TRUE; // autoselect when clicking in the textarea of the querybox
$cfg['CharTextareaCols'] = 40; // textarea size (columns) for CHAR/VARCHAR
$cfg['CharTextareaRows'] = 2; // textarea size (rows) for CHAR/VARCHAR
$cfg['CtrlArrowsMoving'] = TRUE; // Enable Ctrl+Arrows moving between fields when editing?
$cfg['LimitChars'] = 50; // Max field data length in browse mode for all non-numeric fields
$cfg['ModifyDeleteAtLeft'] = TRUE; // show edit/delete links on left side of browse
// (or at the top with vertical browse)
$cfg['ModifyDeleteAtRight'] = FALSE; // show edit/delete links on right side of browse
// (or at the bottom with vertical browse)
$cfg['DefaultDisplay'] = 'horizontal'; // default display direction
// (horizontal|vertical|horizontalflipped)
$cfg['DefaultPropDisplay'] = 'horizontal'; // default display direction for altering/
// creating columns (tbl_properties)
// (horizontal|vertical)
$cfg['HeaderFlipType'] = 'css'; // table-header rotation via faking or css? (css|fake)
// NOTE: CSS only works in IE browsers!
$cfg['ShowBrowseComments'] = TRUE; // shows stored relation-comments in 'browse' mode.
$cfg['ShowPropertyComments']= TRUE; // shows stored relation-comments in 'table property' mode.
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate)
$cfg['QueryFrame'] = TRUE; // displays a link or icon in the left frame to open the querybox, and activates the querybox when clicking on [Edit] on the results page.
$cfg['QueryFrameJS'] = TRUE; // whether to use JavaScript functions for opening a new window for SQL commands.
// if set to 'false', the target of the querybox is always the right frame.
$cfg['QueryWindowWidth'] = 550; // Width of Query window
$cfg['QueryWindowHeight'] = 310; // Height of Query window
$cfg['QueryHistoryDB'] = FALSE; // Set to TRUE if you want DB-based query history.
// If FALSE, this utilizes JS-routines to display
// query history (lost by window close)
$cfg['QueryWindowDefTab'] = 'sql'; // which tab to display in the querywindow on startup
// (sql|files|history|full)
$cfg['QueryHistoryMax'] = 25; // When using DB-based query history, how many entries
// should be kept?
$cfg['BrowseMIME'] = TRUE; // Use MIME-Types (stored in column comments table) for
$cfg['MaxExactCount'] = 20000; // When approximate count < this, PMA will get exact count for
// table rows.
$cfg['WYSIWYG-PDF'] = TRUE; // Utilize DHTML/JS capabilities to allow WYSIWYG editing of
// the PDF page editor. Requires an IE6/Mozilla based browser.
$cfg['NaturalOrder'] = TRUE; // Sort table and database in natural order
//-----------------------------------------------------------------------------
// custom-setup by mkkeck: 2004-05-04
// some specials for new icons and scrollings
// FIXME:
// 2004-05-08 rabus: We need to rearrange these variables.
$cfg['ShowHttpHostTitle'] = TRUE; // show HttpHost in browsers window title (true|false)?
$cfg['SetHttpHostTitle'] = ''; // if ShowHttpHostTitle=true, please set your host (server)
// or an other string, wich should be shown in browsers window title.
// If not set (or empty), the PMA will get your real Host-Adress.
$cfg['ErrorIconic'] = TRUE; // show some icons for warning, error and information messages (true|false)?
$cfg['MainPageIconic'] = TRUE; // show icons in list on main page and on menu tabs (true|false)?
$cfg['ReplaceHelpImg'] = TRUE; // show help button instead of strDocumentation (true|false)?
// theme manager
$cfg['ThemePath'] = './themes'; // using themes manager please set up here the path to 'themes'
// else leave empty
$cfg['ThemeManager'] = TRUE; // if you want to use selectable themes and if ThemesPath not empty
// set it to true, else set it to false (default is false);
$cfg['ThemeDefault'] = 'darkblue_orange'; // set up default theme, if ThemePath not empty
// you can set up here an valid path to themes or 'original' for
// the original pma-theme
$cfg['ThemePerServer'] = FALSE; // allow diferent theme for each configured server
//-----------------------------------------------------------------------------
/**
* Default queries
* %d will be replaced by the database name.
* %t will be replaced by the table name.
* %f will be replaced by a list of field names.
* (%t and %f only applies to DefaultQueryTable)
*/
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
$cfg['DefaultQueryDatabase'] = '';
/**
* SQL Query box settings
* These are the links display in all of the SQL Query boxes
*/
$cfg['SQLQuery']['Edit'] = TRUE; // Edit link to change a query
$cfg['SQLQuery']['Explain'] = TRUE; // EXPLAIN on SELECT queries
$cfg['SQLQuery']['ShowAsPHP'] = TRUE; // Wrap a query in PHP
$cfg['SQLQuery']['Validate'] = FALSE; // Validate a query (see $cfg['SQLValidator'] as well)
$cfg['SQLQuery']['Refresh'] = TRUE; // Refresh the results page
/**
* Webserver upload/save/import directories
*/
$cfg['UploadDir'] = 'w:\databases'; // Directory for uploaded files that can be executed by
// phpMyAdmin. For example './upload'. Leave empty for
// no upload directory support
$cfg['SaveDir'] = 'w:\databases'; // Directory where phpMyAdmin can save exported data on
// server. For example './save'. Leave empty for no save
// directory support.
$cfg['docSQLDir'] = ''; // Directory for docSQL imports, phpMyAdmin can import
// docSQL files from that directory. For example
// './docSQL'. Leave empty for no docSQL import support.
$cfg['TempDir'] = 'w:\tmp'; // Directory where phpMyAdmin can save temporary files.
// This is needed for MS Excel export, see documentation
// how to enable that.
/**
* Misc. settings
*/
$cfg['GD2Available'] = 'auto'; // Is GD >= 2 available? Set to yes/no/auto. 'auto'
// does autodetection, which is a bit expensive for
// php < 4.3.0, but it is the only safe vay how to
// determine GD version.
/**
* SQL Parser Settings
*/
$cfg['SQP']['fmtType'] = 'html'; // Pretty-printing style to use on queries (html, text, none)
$cfg['SQP']['fmtInd'] = '1'; // Amount to indent each level (floats ok)
$cfg['SQP']['fmtIndUnit'] = 'em'; // Units for indenting each level (CSS Types - {em,px,pt})
// The graphical settings are now located in themes/themename/layout.inc.php
/**
* If you wish to use the SQL Validator service, you should be
* aware of the following:
* All SQL statements are stored anonymously for statistical purposes.
* Mimer SQL Validator, Copyright 2002 Upright Database Technology.
* All rights reserved.
*/
$cfg['SQLValidator']['use'] = FALSE; // Make the SQL Validator available
$cfg['SQLValidator']['username'] = ''; // If you have a custom username, specify it here (defaults to anonymous)
$cfg['SQLValidator']['password'] = ''; // Password for username
/**
* Developers ONLY!
* To use the following, please install the DBG extension from http://dd.cron.ru/dbg/
*/
$cfg['DBG']['enable'] = FALSE; // Make the DBG stuff available
$cfg['DBG']['profile']['enable'] = FALSE; // Produce profiling results of PHP
$cfg['DBG']['profile']['threshold'] = 0.5; // Threshold of long running code to display
// Anything below the threshold is not displayed
/**
* MySQL settings
*/
// Column types;
// varchar, tinyint, text and date are listed first, based on estimated popularity
$cfg['ColumnTypes'] = array(
'VARCHAR',
'TINYINT',
'TEXT',
'DATE',
'SMALLINT',
'MEDIUMINT',
'INT',
'BIGINT',
'FLOAT',
'DOUBLE',
'DECIMAL',
'DATETIME',
'TIMESTAMP',
'TIME',
'YEAR',
'CHAR',
'TINYBLOB',
'TINYTEXT',
'BLOB',
'MEDIUMBLOB',
'MEDIUMTEXT',
'LONGBLOB',
'LONGTEXT',
'ENUM',
'SET',
'BOOL'
);
// Attributes
// Note: the "ON UPDATE CURRENT_TIMESTAMP" attribute is added dynamically
// for MySQL >= 4.1.2, in tbl_properties.inc.php
$cfg['AttributeTypes'] = array(
'',
'BINARY',
'UNSIGNED',
'UNSIGNED ZEROFILL'
);
// Available functions
if ($cfg['ShowFunctionFields']) {
$cfg['Functions'] = array(
'ASCII',
'CHAR',
'SOUNDEX',
'LCASE',
'UCASE',
'NOW',
'PASSWORD',
'OLD_PASSWORD',
'MD5',
'SHA1',
'ENCRYPT',
'RAND',
'LAST_INSERT_ID',
'COUNT',
'AVG',
'SUM',
'CURDATE',
'CURTIME',
'FROM_DAYS',
'FROM_UNIXTIME',
'PERIOD_ADD',
'PERIOD_DIFF',
'TO_DAYS',
'UNIX_TIMESTAMP',
'USER',
'WEEKDAY',
'CONCAT'
);
// Which column types will be mapped to which Group?
$cfg['RestrictColumnTypes'] = array(
'VARCHAR' => 'FUNC_CHAR',
'TINYINT' => 'FUNC_NUMBER',
'TEXT' => 'FUNC_CHAR',
'DATE' => 'FUNC_DATE',
'SMALLINT' => 'FUNC_NUMBER',
'MEDIUMINT' => 'FUNC_NUMBER',
'INT' => 'FUNC_NUMBER',
'BIGINT' => 'FUNC_NUMBER',
'FLOAT' => 'FUNC_NUMBER',
'DOUBLE' => 'FUNC_NUMBER',
'DECIMAL' => 'FUNC_NUMBER',
'DATETIME' => 'FUNC_DATE',
'TIMESTAMP' => 'FUNC_DATE',
'TIME' => 'FUNC_DATE',
'YEAR' => 'FUNC_DATE',
'CHAR' => 'FUNC_CHAR',
'TINYBLOB' => 'FUNC_CHAR',
'TINYTEXT' => 'FUNC_CHAR',
'BLOB' => 'FUNC_CHAR',
'MEDIUMBLOB' => 'FUNC_CHAR',
'MEDIUMTEXT' => 'FUNC_CHAR',
'LONGBLOB' => 'FUNC_CHAR',
'LONGTEXT' => 'FUNC_CHAR',
'ENUM' => '',
'SET' => ''
);
// Map above defined groups to any function
$cfg['RestrictFunctions'] = array(
'FUNC_CHAR' => array(
'ASCII',
'CHAR',
'SOUNDEX',
'LCASE',
'UCASE',
'PASSWORD',
'OLD_PASSWORD',
'MD5',
'SHA1',
'ENCRYPT',
'LAST_INSERT_ID',
'USER',
'CONCAT'
),
'FUNC_DATE' => array(
'NOW',
'CURDATE',
'CURTIME',
'FROM_DAYS',
'FROM_UNIXTIME',
'PERIOD_ADD',
'PERIOD_DIFF',
'TO_DAYS',
'UNIX_TIMESTAMP',
'WEEKDAY'
),
'FUNC_NUMBER' => array(
'ASCII',
'CHAR',
'MD5',
'SHA1',
'ENCRYPT',
'RAND',
'LAST_INSERT_ID',
'UNIX_TIMESTAMP',
'COUNT',
'AVG',
'SUM'
)
);
// Default functions for above defined groups
$cfg['DefaultFunctions'] = array(
'FUNC_CHAR' => '',
'FUNC_DATE' => '',
'FUNC_NUMBER' => '',
'first_timestamp' => 'NOW'
);
} // end if
// Search operators
$cfg['NumOperators'] = array(
'=',
'>',
'>=',
'<',
'<=',
'!=',
'LIKE',
'NOT LIKE'
);
$cfg['TextOperators'] = array(
'LIKE',
'LIKE %...%',
'NOT LIKE',
'=',
'!=',
'REGEXP',
'NOT REGEXP'
);
$cfg['EnumOperators'] = array(
'=',
'!='
);
$cfg['SetOperators'] = array(
'IN',
'NOT IN'
);
$cfg['NullOperators'] = array(
'IS NULL',
'IS NOT NULL'
);
$cfg['UnaryOperators'] = array(
'IS NULL' => 1,
'IS NOT NULL' => 1
);
/**
* Unset magic_quotes_runtime - do not change!
*/
set_magic_quotes_runtime(0);
/**
* File Revision - do not change either!
*/
$cfg['FileRevision'] = '$Revision: 2.65 $';
?>

View File

@ -0,0 +1,789 @@
<?php
/* $Id: phpmyadmin.css.php 9784 2006-12-10 13:30:40Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:
chdir('..');
define('PMA_MINIMUM_COMMON', true);
require_once './libraries/common.lib.php';
require_once './libraries/sqlparser.lib.php';
// MSIE 6 (at least some unpatched versions) has problems loading CSS
// when zlib_compression is on
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER == '6'
&& (ini_get('zlib.output_compression')) ) {
ini_set('zlib.output_compression', 'Off');
}
if ($GLOBALS['text_dir'] === 'ltr') {
$right = 'right';
$left = 'left';
} else {
$right = 'left';
$left = 'right';
}
// Send correct type:
header('Content-Type: text/css; charset=ISO-8859-1');
// Cache output in client - the nocache query parameter makes sure that this
// file is reloaded when config changes
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
?>
html {
font-size: <?php echo $_SESSION['PMA_Config']->get('fontsize'); ?>;
}
input, select, textarea {
font-size: 1em;
}
/* @deprecated */
.nowrap {
white-space: nowrap;
}
div.nowrap {
margin: 0;
padding: 0;
}
<?php
if ($_SESSION['PMA_Theme']->checkVersion('2.7.0')) {
?>
form {
margin: 0;
padding: 0;
display: inline;
}
a img {
border: 0;
}
/* server privileges */
#tableuserrights td,
#tablespecificuserrights td,
#tabledatabases td {
vertical-align: middle;
}
/* END server privileges */
/* leave some space between icons and text */
.icon {
vertical-align: middle;
margin-right: 0.3em;
margin-left: 0.3em;
}
/* no extra space in table cells */
td .icon {
margin: 0;
}
.selectallarrow {
margin-<?php echo $right; ?>: 0.3em;
margin-<?php echo $left; ?>: 0.6em;
}
div#tablestatistics {
border-bottom: 0.1em solid #669999;
margin-bottom: 0.5em;
padding-bottom: 0.5em;
}
div#tablestatistics table {
float: <?php echo $left; ?>;
margin-bottom: 0.5em;
margin-right: 0.5em;
}
div#tablestatistics table caption {
margin-right: 0.5em;
}
/* left frame content */
body#body_leftFrame {
background-color: <?php echo $GLOBALS['cfg']['LeftBgColor']; ?>;
}
div#pmalogo,
div#leftframelinks,
div#databaseList {
text-align: center;
border-bottom: 0.1em solid #669999;
margin-bottom: 0.5em;
padding-bottom: 0.5em;
}
div#leftframelinks .icon {
vertical-align: middle;
padding: 0;
margin: 0;
}
div#leftframelinks a:hover {
background-color: #669999;
}
/* leftdatabaselist */
div#left_tableList ul {
list-style-type: none;
list-style-position: outside;
margin: 0;
padding: 0;
background-color: <?php echo $GLOBALS['cfg']['LeftBgColor']; ?>;
}
div#left_tableList li {
margin: 0;
padding: 0;
white-space: nowrap;
}
<?php if ($GLOBALS['cfg']['LeftPointerEnable']) { ?>
div#left_tableList li:hover {
background-color: <?php echo $GLOBALS['cfg']['LeftPointerColor']; ?>;
}
<?php } ?>
div#left_tableList img {
padding: 0;
vertical-align: middle;
}
div#left_tableList ul ul {
margin-left: 0em;
padding-left: 0.1em;
border-left: 0.1em solid #669999;
padding-bottom: 0.1em;
border-bottom: 0.1em solid #669999;
}
/* END left frame content */
/* querywindow */
body#bodyquerywindow {
margin: 0;
padding: 0;
}
div#querywindowcontainer {
margin: 0;
padding: 0;
width: 100%;
}
div#querywindowcontainer fieldset {
margin-top: 0;
}
/* END querywindow */
/* querybox */
/* Gecko bug */
div[class=formelementrow],
div[id=queryfieldscontainer] {
border: 1px solid transparent;
}
div#sqlquerycontainer {
float: left;
width: 69%;
/* height: 15em; */
}
div#tablefieldscontainer {
float: right;
width: 29%;
/* height: 15em; */
}
div#tablefieldscontainer select {
width: 100%;
/* height: 12em; */
}
textarea#sqlquery {
width: 100%;
/* height: 100%; */
}
div#queryboxcontainer div#bookmarkoptions {
margin-top: 0.5em;
}
/* end querybox */
fieldset .formelement {
line-height: 2.4em;
float: left;
margin-right: 0.5em;
/* IE */
white-space: nowrap;
}
/* revert for Gecko */
fieldset div[class=formelement] {
white-space: normal;
}
/* IE */
fieldset .formelement input,
fieldset .formelement select {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
/* revert for Gecko */
fieldset div[class=formelement] input,
fieldset div[class=formelement] select {
margin-top: auto;
margin-bottom: auto;
height: auto;
}
/* Calendar */
table.calendar { width: 100%; }
table.calendar td { text-align: center; }
table.calendar td a { display: block; }
table.calendar td a:hover {
background-color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
table.calendar th {
background-color: <?php echo $GLOBALS['cfg']['ThBgcolor']; ?>;
}
table.calendar td.selected {
background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
img.calendar { border: none; }
form.clock { text-align: center; }
/* end Calendar */
/* Options, eg. on import page */
fieldset {
background-color: <?php echo $GLOBALS['cfg']['BgcolorOne']; ?>;
}
fieldset legend {
background-color: transparent;
}
/* buttons in some browsers (eg. Konqueror) are block elements, this breaks design */
button { display: inline; }
/* Textarea */
textarea { overflow: auto; }
/* topmenu */
/* Gecko 1.7 bug (FF 1.0) */
#topmenucontainer {
border: 1px solid <?php echo $GLOBALS['cfg']['RightBgColor']; ?>;
}
ul#topmenu {
font-weight: bold;
list-style-type: none;
margin: 0;
padding: 0;
}
ul#topmenu li {
float: left;
margin: 0;
padding: 0;
vertical-align: middle;
}
#topmenu img {
vertical-align: middle;
margin-right: 0.1em;
}
/* default tab styles */
.tab, .tabcaution, .tabactive {
display: block;
margin: 0.2em 0.2em 0 0.2em;
padding: 0.2em 0.2em 0 0.2em;
white-space: nowrap;
}
/* disabled tabs */
span.tab {
color: #666666;
}
/* disabled drop/empty tabs */
span.tabcaution {
color: #ff6666;
}
/* enabled drop/empty tabs */
a.tabcaution {
color: #FF0000;
}
a.tabcaution:hover {
color: #FFFFFF;
background-color: #FF0000;
}
<?php if ($GLOBALS['cfg']['LightTabs']) { ?>
/* active tab */
a.tabactive {
color: black;
}
<?php } else { ?>
#topmenu {
margin-top: 0.5em;
padding: 0.1em 0.3em 0.1em 0.3em;
}
ul#topmenu li {
border-bottom: 1pt solid black;
}
/* default tab styles */
.tab, .tabcaution, .tabactive {
background-color: <?php echo $GLOBALS['cfg']['BgcolorOne']; ?>;
border: 1pt solid <?php echo $GLOBALS['cfg']['BgcolorTwo']; ?>;
border-bottom: 0;
border-top-left-radius: 0.4em;
border-top-right-radius: 0.4em;
}
/* enabled hover/active tabs */
a.tab:hover, a.tabcaution:hover, .tabactive, .tabactive:hover {
margin: 0;
padding: 0.2em 0.4em 0.2em 0.4em;
text-decoration: none;
}
a.tab:hover, .tabactive {
background-color: <?php echo $GLOBALS['cfg']['BgcolorTwo']; ?>;
}
/* disabled drop/empty tabs */
span.tab, span.tabcaution {
cursor: url(<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/error.ico), url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/error.ico), default;
}
<?php } ?>
/* end topmenu */
/* data tables */
table caption,
table th,
table td {
padding: 0.1em 0.5em 0.1em 0.5em;
margin: 0;
margin: 0.1em;
vertical-align: top;
}
/* odd table rows 1,3,5,7,... */
table tr.odd th,
table tr.odd {
background-color: <?php echo $GLOBALS['cfg']['BgcolorOne']; ?>;
}
/* even table rows 2,4,6,8,... */
table tr.even th,
table tr.even {
background-color: <?php echo $GLOBALS['cfg']['BgcolorTwo']; ?>;
}
/* marked table rows */
table tr.marked th,
table tr.marked {
background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
/* hovered table rows */
table tr.odd:hover,
table tr.even:hover,
table tr.odd:hover th,
table tr.even:hover th,
table tr.hover th,
table tr.hover {
background-color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
table .value {
text-align: right;
white-space: nowrap;
}
/* IE doesnt handles 'pre' right */
table [class=value] {
white-space: pre;
}
.value {
font-family: "Courier New", Courier, monospace;
}
.value .attention {
color: red;
font-weight: bold;
}
.value .allfine {
color: green;
}
/* serverstatus */
div#serverstatus table caption a.top {
float: right;
}
div#serverstatus div#serverstatusqueriesdetails table,
div#serverstatus table#serverstatustraffic,
div#serverstatus table#serverstatusconnections {
float: left;
}
#serverstatussection,
.clearfloat {
clear: both;
}
div#serverstatussection table {
width: 100%;
margin-bottom: 1em;
}
div#serverstatussection table .name {
width: 18em;
}
div#serverstatussection table .value {
width: 6em;
}
div#serverstatus table tbody td.descr a,
div#serverstatus table .tblFooters a {
white-space: nowrap;
}
div#serverstatus div#statuslinks a:before,
div#serverstatus div#sectionlinks a:before,
div#serverstatus table tbody td.descr a:before,
div#serverstatus table .tblFooters a:before {
content: '[';
}
div#serverstatus div#statuslinks a:after,
div#serverstatus div#sectionlinks a:after,
div#serverstatus table tbody td.descr a:after,
div#serverstatus table .tblFooters a:after {
content: ']';
}
/* end serverstatus */
img.lightbulb {
cursor: pointer;
}
<?php
} // end styles 2.7.0
if ($_SESSION['PMA_Theme']->checkVersion('2.7.1')) {
?>
/********************/
/* NEW in PMA 2.7.1 */
/********************/
body.loginform h1,
body.loginform a.logo {
display: block;
text-align: center;
}
form.login label {
float: left;
width: 10em;
font-weight: bolder;
}
/* main page */
#maincontainer {
background-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/logo_right.png);
background-position: <?php echo $right; ?> bottom;
background-repeat: no-repeat;
border-bottom: 1px solid silver;
}
#mysqlmaininformation,
#pmamaininformation {
float: <?php echo $left; ?>;
width: 49%;
}
#maincontainer ul {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/item_<?php echo $GLOBALS['text_dir']; ?>.png);
vertical-align: middle;
}
#maincontainer li {
margin-bottom: 0.3em;
}
/* END main page */
<?php if ($GLOBALS['cfg']['MainPageIconic']) { ?>
/* iconic view for ul items */
li#li_create_database {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/b_newdb.png);
}
li#li_select_lang {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_lang.png);
}
li#li_select_mysql_collation,
li#li_select_mysql_charset {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_asci.png);
}
li#li_select_theme{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_theme.png);
}
li#li_server_info{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_host.png);
}
li#li_user_info{
/* list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_rights.png); */
}
li#li_mysql_status{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_status.png);
}
li#li_mysql_variables{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_vars.png);
}
li#li_mysql_processes{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_process.png);
}
li#li_mysql_collations{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_asci.png);
}
li#li_mysql_engines{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/b_engine.png);
}
li#li_mysql_binlogs {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_tbl.png);
}
li#li_mysql_databases {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_db.png);
}
li#li_export {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/b_export.png);
}
li#li_import {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/b_import.png);
}
li#li_change_password {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_passwd.png);
}
li#li_log_out {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_loggoff.png);
}
li#li_pma_docs {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/b_docs.png);
}
li#li_phpinfo {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/php_sym.png);
}
li#li_pma_homepage {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/b_home.png);
}
li#li_mysql_privilegs{
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_rights.png);
}
li#li_switch_dbstats {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/b_dbstatistics.png);
}
li#li_flush_privileges {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_reload.png);
}
/* END iconic view for ul items */
<?php } /* end if $GLOBALS['cfg']['MainPageIconic'] */ ?>
#body_browse_foreigners {
background-color: <?php echo $cfg['LeftBgColor']; ?>;
margin: 5px 5px 0 5px;
}
#bodyquerywindow {
background-color: <?php echo $cfg['LeftBgColor']; ?>;
}
#bodythemes {
width: 500px;
margin: auto;
text-align: center;
}
#bodythemes img {
border: 0.1em solid black;
}
#bodythemes a:hover img {
border: 0.1em solid red;
}
#fieldset_select_fields {
float: left;
}
#selflink {
clear: both;
display: block;
margin-top: 1em;
margin-bottom: 1em;
width: 100%;
border-top: 0.1em solid silver;
text-align: <?php echo $right; ?>;
}
#table_innodb_bufferpool_usage,
#table_innodb_bufferpool_activity {
float: <?php echo $left; ?>;
}
#div_mysql_charset_collations table {
float: <?php echo $left; ?>;
}
#div_table_order {
min-width: 48%;
float: <?php echo $left; ?>;
}
#div_table_rename {
min-width: 48%;
float: <?php echo $left; ?>;
}
#div_table_copy {
min-width: 48%;
float: <?php echo $left; ?>;
}
#div_table_options {
clear: both;
min-width: 48%;
float: <?php echo $left; ?>;
}
#qbe_div_table_list {
float: <?php echo $left; ?>;
}
#qbe_div_sql_query {
float: <?php echo $left; ?>;
}
<?php
$GLOBALS['cfg']['BgOne'] = $GLOBALS['cfg']['BgcolorOne'];
$GLOBALS['cfg']['BgTwo'] = $GLOBALS['cfg']['BgcolorTwo'];
} // end styles 2.7.1
if ($_SESSION['PMA_Theme']->checkVersion('2.9')) {
?>
/********************/
/* NEW in PMA 2.9 */
/********************/
<?php if ($GLOBALS['cfg']['BrowseMarkerColor']) { ?>
/* marked items */
.marked a,
.marked {
background: <?php echo $GLOBALS['cfg']['BrowseMarkerBackground']; ?>;
color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
<?php } ?>
/* odd items 1,3,5,7,... */
.odd {
background: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
}
/* even items 2,4,6,8,... */
.even {
background: <?php echo $GLOBALS['cfg']['BgTwo']; ?>;
}
/* hovered items */
.odd:hover,
.even:hover,
.hover {
background: <?php echo $GLOBALS['cfg']['BrowsePointerBackground']; ?>;
color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
/**
* marks table rows/cells if the db field is in a where condition
*/
tr.condition th,
tr.condition td,
td.condition,
th.condition {
border: 1px solid <?php echo $GLOBALS['cfg']['BrowseMarkerBackground']; ?>;
}
label.desc {
width: 30em;
float: <?php echo $left; ?>;
}
body.loginform {
text-align: center;
}
body.loginform div.container {
text-align: <?php echo $left; ?>;
width: 30em;
margin: 0 auto;
}
#body_leftFrame #list_server {
list-style-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_host.png);
list-style-position: inside;
list-style-type: none;
margin: 0;
padding: 0;
}
#body_leftFrame #list_server li {
margin: 0;
padding: 0;
font-size: 80%;
}
<?php
} // end styles 2.9
$_SESSION['PMA_Theme_Manager']->printCss($_REQUEST['js_frame']);
?>

View File

@ -0,0 +1,69 @@
.print_ignore {
display: none;
}
body, table, th, td {
color: #000000;
background-color: #ffffff;
font-size: 8pt;
}
img {
border: 0;
}
table, th, td {
border-width: 0.1em;
border-color: #000000;
border-style: solid;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
th, td {
padding: 0.2em;
}
th {
font-weight: bold;
background-color: #e5e5e5;
}
@media print {
.print_ignore {
display: none;
}
body, table, th, td {
color: #000000;
background-color: #ffffff;
font-size: 8pt;
}
img {
border: 0;
}
table, th, td {
border-width: 1px;
border-color: #000000;
border-style: solid;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
th, td {
padding: 0.2em;
}
th {
font-weight: bold;
background-color: #e5e5e5;
}
}

View File

@ -0,0 +1,44 @@
<?php
/* $Id: db_create.php 7908 2005-11-24 09:12:17Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Gets some core libraries
*/
require_once('./libraries/common.lib.php');
$js_to_run = 'functions.js';
require_once('./libraries/header.inc.php');
require_once('./libraries/mysql_charsets.lib.php');
PMA_checkParameters(array('db'));
/**
* Defines the url to return to in case of error in a sql statement
*/
$err_url = 'main.php?' . PMA_generate_common_url();
/**
* Builds and executes the db creation sql query
*/
$sql_query = 'CREATE DATABASE ' . PMA_backquote($db);
if (!empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) {
list($db_charset) = explode('_', $db_collation);
if (in_array($db_charset, $mysql_charsets) && in_array($db_collation, $mysql_collations[$db_charset])) {
$sql_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
}
unset($db_charset, $db_collation);
}
$sql_query .= ';';
$result = PMA_DBI_query($sql_query);
/**
* Displays the result and calls default page
*/
$message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
require_once('./' . $cfg['DefaultTabDatabase']);
?>

View File

@ -0,0 +1,323 @@
<?php
/* $Id: db_datadict.php 9602 2006-10-25 12:25:01Z nijel $ */
/**
* Gets the variables sent or posted to this script, then displays headers
*/
require_once('./libraries/common.lib.php');
if (!isset($selected_tbl)) {
require_once('./libraries/header.inc.php');
}
/**
* Gets the relations settings
*/
require_once('./libraries/relation.lib.php');
require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam();
/**
* Check parameters
*/
PMA_checkParameters(array('db'));
/**
* Defines the url to return to in case of error in a sql statement
*/
if (isset($table)) {
$err_url = 'tbl_sql.php?' . PMA_generate_common_url($db, $table);
} else {
$err_url = 'db_sql.php?' . PMA_generate_common_url($db);
}
if ($cfgRelation['commwork']) {
$comment = PMA_getComments($db);
/**
* Displays DB comment
*/
if (is_array($comment)) {
?>
<p> <?php echo $strDBComment; ?>
<i><?php echo htmlspecialchars( implode( ' ', $comment ) ); ?></i></p>
<?php
} // end if
}
/**
* Selects the database and gets tables names
*/
PMA_DBI_select_db($db);
$rowset = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
$count = 0;
while ($row = PMA_DBI_fetch_assoc($rowset)) {
$myfieldname = 'Tables_in_' . htmlspecialchars($db);
$table = $row[$myfieldname];
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
$comments = PMA_getComments($db, $table);
}
if ($count != 0) {
echo '<div style="page-break-before: always;">' . "\n";
} else {
echo '<div>' . "\n";
}
echo '<h2>' . $table . '</h2>' . "\n";
/**
* Gets table informations
*/
// The 'show table' statement works correct since 3.23.03
$showtable = PMA_DBI_get_tables_full( $db, $table );
$num_rows = (isset($showtable[$table]['TABLE_ROWS']) ? $showtable[$table]['TABLE_ROWS'] : 0);
$show_comment = (isset($showtable[$table]['TABLE_COMMENT']) ? $showtable[$table]['TABLE_COMMENT'] : '');
unset( $showtable );
/**
* Gets table keys and retains them
*/
PMA_DBI_select_db($db);
$result = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($table) . ';');
$primary = '';
$indexes = array();
$lastIndex = '';
$indexes_info = array();
$indexes_data = array();
$pk_array = array(); // will be use to emphasis prim. keys in the table
// view
while ($row = PMA_DBI_fetch_assoc($result)) {
// Backups the list of primary keys
if ($row['Key_name'] == 'PRIMARY') {
$primary .= $row['Column_name'] . ', ';
$pk_array[$row['Column_name']] = 1;
}
// Retains keys informations
if ($row['Key_name'] != $lastIndex ){
$indexes[] = $row['Key_name'];
$lastIndex = $row['Key_name'];
}
$indexes_info[$row['Key_name']]['Sequences'][] = $row['Seq_in_index'];
$indexes_info[$row['Key_name']]['Non_unique'] = $row['Non_unique'];
if (isset($row['Cardinality'])) {
$indexes_info[$row['Key_name']]['Cardinality'] = $row['Cardinality'];
}
// I don't know what does following column mean....
// $indexes_info[$row['Key_name']]['Packed'] = $row['Packed'];
$indexes_info[$row['Key_name']]['Comment'] = $row['Comment'];
$indexes_data[$row['Key_name']][$row['Seq_in_index']]['Column_name'] = $row['Column_name'];
if (isset($row['Sub_part'])) {
$indexes_data[$row['Key_name']][$row['Seq_in_index']]['Sub_part'] = $row['Sub_part'];
}
} // end while
if ($result) {
PMA_DBI_free_result($result);
}
/**
* Gets fields properties
*/
$result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
$fields_cnt = PMA_DBI_num_rows($result);
// We need this to correctly learn if a TIMESTAMP is NOT NULL, since
// SHOW FULL FIELDS or INFORMATION_SCHEMA incorrectly says NULL
// and SHOW CREATE TABLE says NOT NULL (tested
// in MySQL 4.0.25 and 5.0.21, http://bugs.mysql.com/20910).
$show_create_table = PMA_DBI_fetch_value(
'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table),
0, 1);
$analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table));
// Check if we can use Relations (Mike Beck)
if (!empty($cfgRelation['relation'])) {
// Find which tables are related with the current one and write it in
// an array
$res_rel = PMA_getForeigners($db, $table);
if (count($res_rel) > 0) {
$have_rel = TRUE;
} else {
$have_rel = FALSE;
}
} else {
$have_rel = FALSE;
} // end if
/**
* Displays the comments of the table if MySQL >= 3.23
*/
if (!empty($show_comment)) {
echo $strTableComments . ': ' . $show_comment . '<br /><br />';
}
/**
* Displays the table structure
*/
?>
<table width="100%" class="print">
<tr><th width="50"><?php echo $strField; ?></th>
<th width="80"><?php echo $strType; ?></th>
<?php /* <th width="50"><?php echo $strAttr; ?></th>*/ ?>
<th width="40"><?php echo $strNull; ?></th>
<th width="70"><?php echo $strDefault; ?></th>
<?php /* <th width="50"><?php echo $strExtra; ?></th>*/ ?>
<?php
if ($have_rel) {
echo ' <th>' . $strLinksTo . '</th>' . "\n";
}
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
echo ' <th>' . $strComments . '</th>' . "\n";
}
if ($cfgRelation['mimework']) {
echo ' <th>MIME</th>' . "\n";
}
?>
</tr>
<?php
$odd_row = true;
while ($row = PMA_DBI_fetch_assoc($result)) {
$type = $row['Type'];
// reformat mysql query output - staybyte - 9. June 2001
// loic1: set or enum types: slashes single quotes inside options
if (preg_match('@^(set|enum)\((.+)\)$@i', $type, $tmp)) {
$tmp[2] = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1);
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
$type_nowrap = '';
$binary = 0;
$unsigned = 0;
$zerofill = 0;
} else {
$binary = stristr($row['Type'], 'binary');
$unsigned = stristr($row['Type'], 'unsigned');
$zerofill = stristr($row['Type'], 'zerofill');
$type_nowrap = ' nowrap="nowrap"';
$type = preg_replace('@BINARY@i', '', $type);
$type = preg_replace('@ZEROFILL@i', '', $type);
$type = preg_replace('@UNSIGNED@i', '', $type);
if (empty($type)) {
$type = ' ';
}
}
$strAttribute = ' ';
if ($binary) {
$strAttribute = 'BINARY';
}
if ($unsigned) {
$strAttribute = 'UNSIGNED';
}
if ($zerofill) {
$strAttribute = 'UNSIGNED ZEROFILL';
}
if (!isset($row['Default'])) {
if ($row['Null'] != '' && $row['Null'] != 'NO') {
$row['Default'] = '<i>NULL</i>';
}
} else {
$row['Default'] = htmlspecialchars($row['Default']);
}
$field_name = htmlspecialchars($row['Field']);
// here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the
// NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
// the latter.
/**
* @todo merge this logic with the one in tbl_structure.php
* or move it in a function similar to PMA_DBI_get_columns_full()
* but based on SHOW CREATE TABLE because information_schema
* cannot be trusted in this case (MySQL bug)
*/
if (!empty($analyzed_sql[0]['create_table_fields'][$field_name]['type']) && $analyzed_sql[0]['create_table_fields'][$field_name]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$field_name]['timestamp_not_null']) {
$row['Null'] = '';
}
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
<td nowrap="nowrap">
<?php
if (isset($pk_array[$row['Field']])) {
echo '<u>' . $field_name . '</u>';
} else {
echo $field_name;
}
?>
</td>
<td<?php echo $type_nowrap; ?> xml:lang="en" dir="ltr"><?php echo $type; ?></td>
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $strAttribute; ?></td>*/ ?>
<td><?php echo (($row['Null'] == '' || $row['Null'] == 'NO') ? $strNo : $strYes); ?></td>
<td nowrap="nowrap"><?php if (isset($row['Default'])) { echo $row['Default']; } ?></td>
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $row['Extra']; ?></td>*/ ?>
<?php
if ($have_rel) {
echo ' <td>';
if (isset($res_rel[$field_name])) {
echo htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field']);
}
echo '</td>' . "\n";
}
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
echo ' <td>';
if (isset($comments[$field_name])) {
echo htmlspecialchars($comments[$field_name]);
}
echo '</td>' . "\n";
}
if ($cfgRelation['mimework']) {
$mime_map = PMA_getMIME($db, $table, true);
echo ' <td>';
if (isset($mime_map[$field_name])) {
echo htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype']));
}
echo '</td>' . "\n";
}
?>
</tr>
<?php
} // end while
PMA_DBI_free_result( $result );
$count++;
?>
</table>
</div>
<?php
} //ends main while
/**
* Displays the footer
*/
?>
<script type="text/javascript" language="javascript">
//<![CDATA[
function printPage()
{
document.getElementById('print').style.visibility = 'hidden';
// Do print the page
if (typeof(window.print) != 'undefined') {
window.print();
}
document.getElementById('print').style.visibility = '';
}
//]]>
</script>
<?php
echo '<br /><br /><input type="button" id="print" value="' . $strPrint . '" onclick="printPage()" />';
require_once('./libraries/footer.inc.php');
?>

View File

@ -0,0 +1,74 @@
<?php
/* $Id: db_export.php 9602 2006-10-25 12:25:01Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* dumps a database
*
* @uses libraries/db_common.inc.php
* @uses libraries/db_info.inc.php
* @uses libraries/display_export.lib.php
* @uses $tables from libraries/db_info.inc.php
*/
/**
* Gets some core libraries
*/
require_once('./libraries/common.lib.php');
$sub_part = '_export';
require_once('./libraries/db_common.inc.php');
$url_query .= '&amp;goto=db_export.php';
require_once('./libraries/db_info.inc.php');
/**
* Displays the form
*/
$export_page_title = $strViewDumpDB;
// exit if no tables in db found
if ( $num_tables < 1 ) {
echo $strDatabaseNoTable;
require('./libraries/footer.inc.php');
exit;
} // end if
$multi_values = '<div align="center"><select name="table_select[]" size="6" multiple="multiple">';
$multi_values .= "\n";
foreach ( $tables as $each_table ) {
// ok we show also views
//if ( PMA_MYSQL_INT_VERSION >= 50000 && is_null($each_table['Engine']) ) {
// Don't offer to export views yet.
// continue;
//}
if ( ! empty( $unselectall )
|| ( isset( $tmp_select )
&& false !== strpos( $tmp_select, '|' . $each_table['Name'] . '|') ) ) {
$is_selected = '';
} else {
$is_selected = ' selected="selected"';
}
$table_html = htmlspecialchars( $each_table['Name'] );
$multi_values .= ' <option value="' . $table_html . '"'
. $is_selected . '>' . $table_html . '</option>' . "\n";
} // end for
$multi_values .= "\n";
$multi_values .= '</select></div>';
$checkall_url = 'db_export.php?'
. PMA_generate_common_url( $db )
. '&amp;goto=db_export.php';
$multi_values .= '<br />
<a href="' . $checkall_url . '" onclick="setSelectOptions(\'dump\', \'table_select[]\', true); return false;">' . $strSelectAll . '</a>
/
<a href="' . $checkall_url . '&amp;unselectall=1" onclick="setSelectOptions(\'dump\', \'table_select[]\', false); return false;">' . $strUnselectAll . '</a>';
$export_type = 'database';
require_once('./libraries/display_export.lib.php');
/**
* Displays the footer
*/
require_once('./libraries/footer.inc.php');
?>

View File

@ -0,0 +1,21 @@
<?php
/* $Id: db_import.php 9602 2006-10-25 12:25:01Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
require_once('./libraries/common.lib.php');
/**
* Gets tables informations and displays top links
*/
require('./libraries/db_common.inc.php');
require('./libraries/db_info.inc.php');
$import_type = 'database';
require('./libraries/display_import.lib.php');
/**
* Displays the footer
*/
require('./libraries/footer.inc.php');
?>

View File

@ -0,0 +1,478 @@
<?php
/* $Id: db_operations.php 9696 2006-11-13 08:30:25Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* handles miscellaneous db operations:
* - move/rename
* - copy
* - changing collation
* - changing comment
* - adding tables
* - viewing PDF schemas
*/
/**
* requirements
*/
require_once './libraries/common.lib.php';
require_once './libraries/Table.class.php';
require_once './libraries/mysql_charsets.lib.php';
/**
* Rename/move or copy database
*/
if (isset($db) &&
((isset($db_rename) && $db_rename == 'true') ||
(isset($db_copy) && $db_copy == 'true'))) {
if (isset($db_rename) && $db_rename == 'true') {
$move = true;
} else {
$move = false;
}
if (!isset($newname) || !strlen($newname)) {
$message = $strDatabaseEmpty;
} else {
$sql_query = ''; // in case target db exists
if ($move ||
(isset($create_database_before_copying) && $create_database_before_copying)) {
$local_query = 'CREATE DATABASE ' . PMA_backquote($newname);
if (isset($db_collation)) {
$local_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
}
$local_query .= ';';
$sql_query = $local_query;
PMA_DBI_query($local_query);
// rebuild the database list because PMA_Table::moveCopy
// checks in this list if the target db exists
$GLOBALS['PMA_List_Database']->build();
}
if (isset($GLOBALS['add_constraints'])) {
$GLOBALS['sql_constraints_query_full_db'] = '';
}
$tables_full = PMA_DBI_get_tables_full($db);
$views = array();
foreach ($tables_full as $table => $tmp) {
// to be able to rename a db containing views, we
// first collect in $views all the views we find and we
// will handle them after the tables
/**
* @todo support a view of a view
*/
if (PMA_Table::isView($db, $table)) {
$views[] = $table;
continue;
}
$back = $sql_query;
$sql_query = '';
// value of $what for this table only
$this_what = $what;
if (!isset($tables_full[$table]['Engine'])) {
$tables_full[$table]['Engine'] = $tables_full[$table]['Type'];
}
// do not copy the data from a Merge table
// note: on the calling FORM, 'data' means 'structure and data'
if ($tables_full[$table]['Engine'] == 'MRG_MyISAM') {
if ($this_what == 'data') {
$this_what = 'structure';
}
if ($this_what == 'dataonly') {
$this_what = 'nocopy';
}
}
if ($this_what != 'nocopy') {
PMA_Table::moveCopy($db, $table, $newname, $table,
isset($this_what) ? $this_what : 'data', $move, 'db_copy');
if (isset($GLOBALS['add_constraints'])) {
$GLOBALS['sql_constraints_query_full_db'] .= $GLOBALS['sql_constraints_query'];
unset($GLOBALS['sql_constraints_query']);
}
}
$sql_query = $back . $sql_query;
} // end (foreach)
unset($table);
// handle the views
foreach ($views as $view) {
PMA_Table::moveCopy($db, $view, $newname, $view,
'structure', $move, 'db_copy');
}
unset($view, $views);
// now that all tables exist, create all the accumulated constraints
if (isset($GLOBALS['add_constraints'])) {
/**
* @todo this works with mysqli but not with mysql, because
* mysql extension does not accept more than one statement; maybe
* interface with the sql import plugin that handles statement delimiter
*/
PMA_DBI_query($GLOBALS['sql_constraints_query_full_db']);
// and prepare to display them
$GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_constraints_query_full_db'];
unset($GLOBALS['sql_constraints_query_full_db']);
}
// Duplicate the bookmarks for this db (done once for each db)
if ($db != $newname) {
$get_fields = array('user', 'label', 'query');
$where_fields = array('dbase' => $db);
$new_fields = array('dbase' => $newname);
PMA_Table::duplicateInfo('bookmarkwork', 'bookmark', $get_fields,
$where_fields, $new_fields);
}
if ($move) {
// cleanup pmadb stuff for this db
require_once './libraries/relation_cleanup.lib.php';
PMA_relationsCleanupDatabase($db);
$local_query = 'DROP DATABASE ' . PMA_backquote($db) . ';';
$sql_query .= "\n" . $local_query;
PMA_DBI_query($local_query);
$message = sprintf($strRenameDatabaseOK, htmlspecialchars($db),
htmlspecialchars($newname));
} else {
$message = sprintf($strCopyDatabaseOK, htmlspecialchars($db),
htmlspecialchars($newname));
}
$reload = true;
/* Change database to be used */
if ($move) {
$db = $newname;
} else {
if (isset($switch_to_new) && $switch_to_new == 'true') {
PMA_setCookie('pma_switch_to_new', 'true');
$db = $newname;
} else {
PMA_setCookie('pma_switch_to_new', '');
}
}
}
}
/**
* Settings for relations stuff
*/
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam();
/**
* Check if comments were updated
* (must be done before displaying the menu tabs)
*/
if ($cfgRelation['commwork'] && isset($db_comment) && $db_comment == 'true') {
PMA_SetComment($db, '', '(db_comment)', $comment);
}
/**
* Prepares the tables list if the user where not redirected to this script
* because there is no table in the database ($is_info is true)
*/
if (empty($is_info)) {
require './libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_operations.php';
// Gets the database structure
$sub_part = '_structure';
require './libraries/db_info.inc.php';
echo "\n";
}
if (PMA_MYSQL_INT_VERSION >= 40101) {
$db_collation = PMA_getDbCollation($db);
}
if (PMA_MYSQL_INT_VERSION < 50002
|| (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) {
$is_information_schema = false;
} else {
$is_information_schema = true;
}
if (!$is_information_schema) {
require './libraries/display_create_table.lib.php';
if ($cfgRelation['commwork']) {
/**
* database comment
*/
?>
<form method="post" action="db_operations.php">
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<input type="hidden" name="db_comment" value="true" />
<fieldset>
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_comment.png"'
.' alt="" border="0" width="16" height="16" hspace="2" align="middle" />';
}
echo $strDBComment;
$comment = PMA_getComments($db);
?>
</legend>
<input type="text" name="comment" class="textfield" size="30"
value="<?php
echo (isset($comment) && is_array($comment)
? htmlspecialchars(implode(' ', $comment))
: ''); ?>" />
<input type="submit" value="<?php echo $strGo; ?>" />
</fieldset>
</form>
<?php
}
/**
* rename database
*/
?>
<form method="post" action="db_operations.php"
onsubmit="return emptyFormElements(this, 'newname')">
<input type="hidden" name="what" value="data" />
<input type="hidden" name="db_rename" value="true" />
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<fieldset>
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
.' alt="" width="16" height="16" />';
}
echo $strDBRename . ':';
?>
</legend>
<input type="text" name="newname" size="30" class="textfield" value="" />
<input type="submit" value="<?php echo $strGo; ?>" />
</fieldset>
</form>
<?php
/**
* Copy database
*/
?>
<form method="post" action="db_operations.php"
onsubmit="return emptyFormElements(this, 'newname')">
<?php
if (isset($db_collation)) {
echo '<input type="hidden" name="db_collation" value="' . $db_collation
.'" />' . "\n";
}
echo '<input type="hidden" name="db_copy" value="true" />' . "\n";
echo PMA_generate_common_hidden_inputs($db);
?>
<fieldset>
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
.' alt="" width="16" height="16" />';
}
echo $strDBCopy . ':';
if (PMA_MYSQL_INT_VERSION >= 50000) {
$drop_clause = 'DROP TABLE / DROP VIEW';
} else {
$drop_clause = 'DROP TABLE';
}
?>
</legend>
<input type="text" name="newname" size="30" class="textfield" value="" /><br />
<input type="radio" name="what" value="structure"
id="radio_copy_structure" style="vertical-align: middle" />
<label for="radio_copy_structure"><?php echo $strStrucOnly; ?></label><br />
<input type="radio" name="what" value="data" id="radio_copy_data"
checked="checked" style="vertical-align: middle" />
<label for="radio_copy_data"><?php echo $strStrucData; ?></label><br />
<input type="radio" name="what" value="dataonly"
id="radio_copy_dataonly" style="vertical-align: middle" />
<label for="radio_copy_dataonly"><?php echo $strDataOnly; ?></label><br />
<input type="checkbox" name="create_database_before_copying" value="1"
id="checkbox_create_database_before_copying"
style="vertical-align: middle" checked="checked" />
<label for="checkbox_create_database_before_copying">
<?php echo $strCreateDatabaseBeforeCopying; ?></label><br />
<input type="checkbox" name="drop_if_exists" value="true"
id="checkbox_drop" style="vertical-align: middle" />
<label for="checkbox_drop"><?php echo sprintf($strAddClause, $drop_clause); ?></label><br />
<input type="checkbox" name="sql_auto_increment" value="1"
id="checkbox_auto_increment" style="vertical-align: middle" />
<label for="checkbox_auto_increment">
<?php echo $strAddAutoIncrement; ?></label><br />
<input type="checkbox" name="add_constraints" value="1"
id="checkbox_constraints" style="vertical-align: middle" />
<label for="checkbox_constraints">
<?php echo $strAddConstraints; ?></label><br />
<?php
unset($drop_clause);
if (isset($_COOKIE) && isset($_COOKIE['pma_switch_to_new'])
&& $_COOKIE['pma_switch_to_new'] == 'true') {
$pma_switch_to_new = 'true';
}
?>
<input type="checkbox" name="switch_to_new" value="true"
id="checkbox_switch"
<?php echo ((isset($pma_switch_to_new) && $pma_switch_to_new == 'true') ? ' checked="checked"' : ''); ?>
style="vertical-align: middle" />
<label for="checkbox_switch"><?php echo $strSwitchToDatabase; ?></label>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submit_copy" value="<?php echo $strGo; ?>" />
</fieldset>
</form>
<?php
/**
* Change database charset
*/
if (PMA_MYSQL_INT_VERSION >= 40101) {
// MySQL supports setting default charsets / collations for databases since
// version 4.1.1.
echo '<form method="post" action="./db_operations.php">' . "\n"
. PMA_generate_common_hidden_inputs($db, isset($table) ? $table : '')
. '<fieldset>' . "\n"
. ' <legend>';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"'
.' alt="" width="16" height="16" />';
}
echo ' <label for="select_db_collation">' . $strCollation . ':</label>' . "\n"
. ' </legend>' . "\n"
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,
'db_collation', 'select_db_collation', $db_collation, false, 3)
. ' <input type="submit" name="submitcollation"'
. ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n"
. '</fieldset>' . "\n"
. '</form>' . "\n";
}
if ($num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
/* Show error if user has configured something, notice elsewhere */
if (!empty($cfg['Servers'][$server]['pmadb'])) {
echo '<div class="error"><h1>' . $strError . '</h1>';
} else {
echo '<div class="notice">';
}
printf($strRelationNotWorking, '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', '</a>');
echo '</div>';
} // end if
} // end if (!$is_information_schema)
// not sure about leaving the PDF dialog for information_schema
if ($num_tables > 0 && isset($table)) {
$takeaway = $url_query . '&amp;table=' . urlencode($table);
} else {
$takeaway = '';
}
if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
<!-- Work on PDF Pages -->
<?php
// We only show this if we find something in the new pdf_pages table
$test_query = '
SELECT *
FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']) . '
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
$test_rs = PMA_query_as_cu($test_query, null, PMA_DBI_QUERY_STORE);
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
<!-- PDF schema -->
<form method="post" action="pdf_schema.php">
<fieldset>
<legend>
<?php
echo PMA_generate_common_hidden_inputs($db);
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_view.png"'
.' alt="" width="16" height="16" />';
}
echo $strDisplayPDF;
?>:
</legend>
<label for="pdf_page_number_opt"><?php echo $strPageNumber; ?></label>
<select name="pdf_page_number" id="pdf_page_number_opt">
<?php
while ($pages = @PMA_DBI_fetch_assoc($test_rs)) {
echo ' <option value="' . $pages['page_nr'] . '">'
. $pages['page_nr'] . ': ' . $pages['page_descr'] . '</option>' . "\n";
} // end while
PMA_DBI_free_result($test_rs);
unset($test_rs);
?>
</select><br />
<input type="checkbox" name="show_grid" id="show_grid_opt" />
<label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />
<input type="checkbox" name="show_color" id="show_color_opt"
checked="checked" />
<label for="show_color_opt"><?php echo $strShowColor; ?></label><br />
<input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" />
<label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?>
</label><br />
<input type="checkbox" name="all_tab_same_wide" id="all_tab_same_wide" />
<label for="all_tab_same_wide"><?php echo $strAllTableSameWidth; ?>
</label><br />
<input type="checkbox" name="with_doc" id="with_doc" checked="checked" />
<label for="with_doc"><?php echo $strDataDict; ?></label><br />
<label for="orientation_opt"><?php echo $strShowDatadictAs; ?></label>
<select name="orientation" id="orientation_opt">
<option value="L"><?php echo $strLandscape;?></option>
<option value="P"><?php echo $strPortrait;?></option>
</select><br />
<label for="paper_opt"><?php echo $strPaperSize; ?></label>
<select name="paper" id="paper_opt">
<?php
foreach ($cfg['PDFPageSizes'] AS $key => $val) {
echo '<option value="' . $val . '"';
if ($val == $cfg['PDFDefaultPageSize']) {
echo ' selected="selected"';
}
echo ' >' . $val . '</option>' . "\n";
}
?>
</select>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="<?php echo $strGo; ?>" />
</fieldset>
</form>
<?php
} // end if
?>
<ul>
<li>
<?php
echo '<a href="pdf_pages.php?' . $takeaway . '">';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
.' alt="" width="16" height="16" />';
}
echo $strEditPDFPages . '</a>';
?>
</li>
</ul>
<?php
} // end if
/**
* Displays the footer
*/
require_once './libraries/footer.inc.php';
?>

View File

@ -0,0 +1,263 @@
<?php
/* $Id: db_printview.php 9602 2006-10-25 12:25:01Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
require_once './libraries/common.lib.php';
/**
* Gets the variables sent or posted to this script, then displays headers
*/
$print_view = true;
require_once './libraries/header.inc.php';
PMA_checkParameters(array('db'));
/**
* Defines the url to return to in case of error in a sql statement
*/
$err_url = 'db_sql.php?' . PMA_generate_common_url($db);
/**
* Settings for relations stuff
*/
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam();
/**
* Gets the list of the table in the current db and informations about these
* tables if possible
*
* @todo merge this speedup _optionaly_ into PMA_DBI_get_tables_full()
*
// staybyte: speedup view on locked tables - 11 June 2001
// Special speedup for newer MySQL Versions (in 4.0 format changed)
if ($cfg['SkipLockedTables'] == true) {
$result = PMA_DBI_query('SHOW OPEN TABLES FROM ' . PMA_backquote($db) . ';');
// Blending out tables in use
if ($result != false && PMA_DBI_num_rows($result) > 0) {
while ($tmp = PMA_DBI_fetch_row($result)) {
// if in use memorize tablename
if (preg_match('@in_use=[1-9]+@i', $tmp[0])) {
$sot_cache[$tmp[0]] = true;
}
}
PMA_DBI_free_result($result);
if (isset($sot_cache)) {
$result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
if ($result != false && PMA_DBI_num_rows($result) > 0) {
while ($tmp = PMA_DBI_fetch_row($result)) {
if (!isset($sot_cache[$tmp[0]])) {
$sts_result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\';');
$sts_tmp = PMA_DBI_fetch_assoc($sts_result);
$tables[] = $sts_tmp;
} else { // table in use
$tables[] = array('Name' => $tmp[0]);
}
}
PMA_DBI_free_result($result);
$sot_ready = true;
}
}
unset($tmp, $result);
}
}
if (! isset($sot_ready)) {
$result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ';');
if (PMA_DBI_num_rows($result) > 0) {
while ($sts_tmp = PMA_DBI_fetch_assoc($result)) {
$tables[] = $sts_tmp;
}
PMA_DBI_free_result($result);
unset($res);
}
}
*/
/**
* If there is at least one table, displays the printer friendly view, else
* an error message
*/
$tables = PMA_DBI_get_tables_full($db);
$num_tables = count($tables);
echo '<br />';
// 1. No table
if ($num_tables == 0) {
echo $strNoTablesFound;
}
// 2. Shows table informations on mysql >= 3.23.03 - staybyte - 11 June 2001
else {
?>
<table>
<thead>
<tr>
<th><?php echo $strTable; ?></th>
<th><?php echo $strRecords; ?></th>
<th><?php echo $strType; ?></th>
<?php
if ($cfg['ShowStats']) {
echo '<th>' . $strSize . '</th>';
}
?>
<th><?php echo $strComments; ?></th>
</tr>
</thead>
<tbody>
<?php
$sum_entries = $sum_size = 0;
$odd_row = true;
foreach ($tables as $sts_data) {
if (strtoupper($sts_data['ENGINE']) == 'MRG_MYISAM'
|| strtoupper($sts_data['ENGINE']) == 'FEDERATED') {
$merged_size = true;
} else {
$merged_size = false;
}
$sum_entries += $sts_data['TABLE_ROWS'];
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<th>
<?php echo htmlspecialchars($sts_data['TABLE_NAME']); ?>
</th>
<?php
if (isset($sts_data['TABLE_ROWS'])) {
?>
<td align="right">
<?php
if ($merged_size) {
echo '<i>' . number_format($sts_data['TABLE_ROWS'], 0, $number_decimal_separator, $number_thousands_separator) . '</i>' . "\n";
} else {
echo number_format($sts_data['TABLE_ROWS'], 0, $number_decimal_separator, $number_thousands_separator) . "\n";
}
?>
</td>
<td nowrap="nowrap">
<?php echo $sts_data['ENGINE']; ?>
</td>
<?php
if ($cfg['ShowStats']) {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize;
list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, 1);
?>
<td align="right" nowrap="nowrap">
<?php echo $formated_size . ' ' . $unit; ?>
</td>
<?php
} // end if
} else {
?>
<td colspan="3" align="center">
<?php echo $strInUse; ?>
</td>
<?php
}
?>
<td>
<?php
if (! empty($sts_data['Comment'])) {
echo $sts_data['Comment'];
$needs_break = '<br />';
} else {
$needs_break = '';
}
if (! empty($sts_data['Create_time'])
|| ! empty($sts_data['Update_time'])
|| ! empty($sts_data['Check_time'])) {
echo $needs_break;
?>
<table width="100%">
<?php
if (! empty($sts_data['Create_time'])) {
?>
<tr>
<td align="right"><?php echo $strStatCreateTime . ': '; ?></td>
<td align="right"><?php echo PMA_localisedDate(strtotime($sts_data['Create_time'])); ?></td>
</tr>
<?php
}
if (! empty($sts_data['Update_time'])) {
?>
<tr>
<td align="right"><?php echo $strStatUpdateTime . ': '; ?></td>
<td align="right"><?php echo PMA_localisedDate(strtotime($sts_data['Update_time'])); ?></td>
</tr>
<?php
}
if (! empty($sts_data['Check_time'])) {
?>
<tr>
<td align="right"><?php echo $strStatCheckTime . ': '; ?></td>
<td align="right"><?php echo PMA_localisedDate(strtotime($sts_data['Check_time'])); ?></td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<th align="center">
<?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?>
</th>
<th align="right" nowrap="nowrap">
<?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?>
</th>
<th align="center">
--
</th>
<?php
if ($cfg['ShowStats']) {
list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);
?>
<th align="right" nowrap="nowrap">
<?php echo $sum_formated . ' ' . $unit; ?>
</th>
<?php
}
?>
<th>&nbsp;</th>
</tr>
</tbody>
</table>
<?php
}
/**
* Displays the footer
*/
?>
<script type="text/javascript" language="javascript">
//<![CDATA[
function printPage()
{
// Do print the page
if (typeof(window.print) != 'undefined') {
window.print();
}
}
//]]>
</script>
<br /><br />
<input type="button" class="print_ignore"
id="print" value="<?php echo $strPrint; ?>" onclick="printPage()" />
<?php
require_once './libraries/footer.inc.php';
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,308 @@
<?php
/* $Id: db_search.php 9602 2006-10-25 12:25:01Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Credits for this script goes to Thomas Chaumeny <chaume92 at aol.com>
*/
require_once('./libraries/common.lib.php');
/**
* Gets some core libraries and send headers
*/
require('./libraries/db_common.inc.php');
// If config variable $cfg['Usedbsearch'] is on FALSE : exit.
if (!$cfg['UseDbSearch']) {
PMA_mysqlDie($strAccessDenied, '', FALSE, $err_url);
} // end if
$url_query .= '&amp;goto=db_search.php';
$url_params['goto'] = 'db_search.php';
/**
* Get the list of tables from the current database
*/
$tables = PMA_DBI_get_tables($GLOBALS['db']);
$num_tables = count( $tables );
/**
* Displays top links
*/
$sub_part = '';
require('./libraries/db_links.inc.php');
/**
* 1. Main search form has been submitted
*/
if (isset($_REQUEST['submit_search'])) {
/**
* Builds the SQL search query
*
* @param string the table name
* @param string the string to search
* @param integer type of search (1 -> 1 word at least, 2 -> all words,
* 3 -> exact string, 4 -> regexp)
*
* @return array 3 SQL querys (for count, display and delete results)
*
* @global string the url to return to in case of errors
*/
function PMA_getSearchSqls($table, $search_str, $search_option)
{
global $err_url, $charset_connection;
// Statement types
$sqlstr_select = 'SELECT';
$sqlstr_delete = 'DELETE';
// Fields to select
$res = PMA_DBI_query('SHOW ' . (PMA_MYSQL_INT_VERSION >= 40100 ? 'FULL ' : '') . 'FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']) . ';');
while ($current = PMA_DBI_fetch_assoc($res)) {
if (PMA_MYSQL_INT_VERSION >= 40100) {
list($current['Charset']) = explode('_', $current['Collation']);
}
$current['Field'] = PMA_backquote($current['Field']);
$tblfields[] = $current;
} // while
PMA_DBI_free_result($res);
unset($current, $res);
$tblfields_cnt = count($tblfields);
// Table to use
$sqlstr_from = ' FROM ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($table);
// Beginning of WHERE clause
$sqlstr_where = ' WHERE';
$search_words = (($search_option > 2) ? array($search_str) : explode(' ', $search_str));
$search_wds_cnt = count($search_words);
$like_or_regex = (($search_option == 4) ? 'REGEXP' : 'LIKE');
$automatic_wildcard = (($search_option <3) ? '%' : '');
for ($i = 0; $i < $search_wds_cnt; $i++) {
// Eliminates empty values
// In MySQL 4.1, if a field has no collation we get NULL in Charset
// but in MySQL 5.0.x we get ''
if (!empty($search_words[$i])) {
for ($j = 0; $j < $tblfields_cnt; $j++) {
if (PMA_MYSQL_INT_VERSION >= 40100 && $tblfields[$j]['Charset'] != $charset_connection && $tblfields[$j]['Charset'] != 'NULL' && $tblfields[$j]['Charset'] != '') {
$prefix = 'CONVERT(_utf8 ';
$suffix = ' USING ' . $tblfields[$j]['Charset'] . ') COLLATE ' . $tblfields[$j]['Collation'];
} else {
$prefix = $suffix = '';
}
$thefieldlikevalue[] = $tblfields[$j]['Field']
. ' ' . $like_or_regex . ' '
. $prefix
. '\''
. $automatic_wildcard
. $search_words[$i]
. $automatic_wildcard . '\''
. $suffix;
} // end for
$fieldslikevalues[] = ($search_wds_cnt > 1)
? '(' . implode(' OR ', $thefieldlikevalue) . ')'
: implode(' OR ', $thefieldlikevalue);
unset($thefieldlikevalue);
} // end if
} // end for
$implode_str = ($search_option == 1 ? ' OR ' : ' AND ');
$sqlstr_where .= ' ' . implode($implode_str, $fieldslikevalues);
unset($fieldslikevalues);
// Builds complete queries
$sql['select_fields'] = $sqlstr_select . ' * ' . $sqlstr_from . $sqlstr_where;
// here, I think we need to still use the COUNT clause, even for
// VIEWs, anyway we have a WHERE clause that should limit results
$sql['select_count'] = $sqlstr_select . ' COUNT(*) AS count' . $sqlstr_from . $sqlstr_where;
$sql['delete'] = $sqlstr_delete . $sqlstr_from . $sqlstr_where;
return $sql;
} // end of the "PMA_getSearchSqls()" function
/**
* Displays the results
*/
if (!empty($_REQUEST['search_str']) && !empty($_REQUEST['search_option'])) {
$original_search_str = $_REQUEST['search_str'];
$search_str = PMA_sqlAddslashes($_REQUEST['search_str'], TRUE);
// Get the true string to display as option's comment
switch ($_REQUEST['search_option']) {
case 1:
$option_str = ' (' . $strSearchOption1 . ')';
$search_option = 1;
break;
case 2:
$option_str = ' (' . $strSearchOption2 . ')';
$search_option = 2;
break;
case 3:
$option_str = ' (' . $strSearchOption3 . ')';
$search_option = 3;
break;
case 4:
$option_str = ' (' . $strSearchOption4 . ')';
$search_option = 4;
break;
} // end switch
$this_url_params = array(
'db' => $GLOBALS['db'],
'goto' => 'db_sql.php',
'pos' => 0,
'is_js_confirmed' => 0,
);
// Displays search string
echo '<br />' . "\n"
.'<table class="data">' . "\n"
.'<caption class="tblHeaders">' . "\n"
.sprintf($strSearchResultsFor,
htmlspecialchars($original_search_str), $option_str) . "\n"
.'</caption>' . "\n";
$num_search_result_total = 0;
$odd_row = true;
foreach ( $_REQUEST['table_select'] as $each_table ) {
// Gets the SQL statements
$newsearchsqls = PMA_getSearchSqls($each_table,
$search_str, $search_option);
// Executes the "COUNT" statement
$res_cnt = PMA_DBI_fetch_value($newsearchsqls['select_count']);
$num_search_result_total += $res_cnt;
echo '<tr class="' . ( $odd_row ? 'odd' : 'even' ) . '">'
.'<td>' . sprintf($strNumSearchResultsInTable, $res_cnt,
htmlspecialchars($each_table)) . "</td>\n";
if ($res_cnt > 0) {
$this_url_params['sql_query'] = $newsearchsqls['select_fields'];
echo '<td>' . PMA_linkOrButton(
'sql.php' . PMA_generate_common_url($this_url_params),
$strBrowse, '') . "</td>\n";
$this_url_params['sql_query'] = $newsearchsqls['delete'];
echo '<td>' . PMA_linkOrButton(
'sql.php' . PMA_generate_common_url($this_url_params),
$strDelete, $newsearchsqls['delete']) . "</td>\n";
} else {
echo '<td>&nbsp;</td>' . "\n"
.'<td>&nbsp;</td>' . "\n";
}// end if else
$odd_row = ! $odd_row;
echo '</tr>' . "\n";
} // end for
echo '</table>' . "\n";
if ( count($_REQUEST['table_select']) > 1 ) {
echo '<p>' . sprintf($strNumSearchResultsTotal,
$num_search_result_total) . '</p>' . "\n";
}
} // end if (!empty($search_str) && !empty($search_option))
} // end 1.
/**
* 2. Displays the main search form
*/
echo "\n";
$searched = (isset($original_search_str))
? htmlspecialchars($original_search_str)
: '';
if (empty($search_option)) {
$search_option = 1;
}
?>
<a name="db_search"></a>
<form method="post" action="db_search.php" name="db_search">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db']); ?>
<fieldset>
<legend><?php echo $strSearchFormTitle; ?></legend>
<table class="formlayout">
<tr><td><?php echo $strSearchNeedle; ?></td>
<td><input type="text" name="search_str" size="60"
value="<?php echo $searched; ?>" /></td>
</tr>
<tr><td align="right" valign="top">
<?php echo $strSearchType; ?></td>
<td><input type="radio" id="search_option_1" name="search_option"
value="1"<?php if ($search_option == 1) echo ' checked="checked"'; ?> />
<label for="search_option_1">
<?php echo $strSearchOption1; ?></label><sup>1</sup><br />
<input type="radio" id="search_option_2" name="search_option"
value="2"<?php if ($search_option == 2) echo ' checked="checked"'; ?> />
<label for="search_option_2">
<?php echo $strSearchOption2; ?></label><sup>1</sup><br />
<input type="radio" id="search_option_3" name="search_option"
value="3"<?php if ($search_option == 3) echo ' checked="checked"'; ?> />
<label for="search_option_3">
<?php echo $strSearchOption3; ?></label><br />
<input type="radio" id="search_option_4" name="search_option"
value="4"<?php if ($search_option == 4) echo ' checked="checked"'; ?> />
<label for="search_option_4">
<?php echo $strSearchOption4; ?></label>
<?php echo PMA_showMySQLDocu('Regexp', 'Regexp'); ?><br />
<br />
<sup>1</sup><?php echo $strSplitWordsWithSpace; ?></td>
</tr>
<tr><td align="right" valign="top">
<?php echo $strSearchInTables; ?></td>
<td rowspan="2">
<?php
echo ' <select name="table_select[]" size="6" multiple="multiple">' . "\n";
foreach ( $tables as $each_table ) {
if ( isset($_REQUEST['unselectall'])) {
$is_selected = '';
} elseif ( ! isset($_REQUEST['table_select'])
|| in_array($each_table, $_REQUEST['table_select'])
|| isset($_REQUEST['selectall']) ) {
$is_selected = ' selected="selected"';
} else {
$is_selected = '';
}
echo ' <option value="' . htmlspecialchars($each_table) . '"'
. $is_selected . '>'
. htmlspecialchars($each_table) . '</option>' . "\n";
} // end while
echo ' </select>' . "\n";
$strDoSelectAll = '<a href="db_search.php?' . $url_query . '&amp;selectall=1#db_search"'
. ' onclick="setSelectOptions(\'db_search\', \'table_select[]\', true); return false;">' . $strSelectAll . '</a>'
. '&nbsp;/&nbsp;'
. '<a href="db_search.php?' . $url_query . '&amp;unselectall=1#db_search"'
. ' onclick="setSelectOptions(\'db_search\', \'table_select[]\', false); return false;">' . $strUnselectAll . '</a>';
?>
</td>
</tr>
<tr><td align="right" valign="bottom">
<?php echo $strDoSelectAll; ?></td></tr>
</tr>
</table>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submit_search" value="<?php echo $strGo; ?>"
id="buttonGo" />
</fieldset>
</form>
<?php
/**
* Displays the footer
*/
echo "\n";
require_once('./libraries/footer.inc.php');
?>

View File

@ -0,0 +1,34 @@
<?php
/* $Id: db_sql.php 9602 2006-10-25 12:25:01Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
require_once('./libraries/common.lib.php');
/**
* Runs common work
*/
require('./libraries/db_common.inc.php');
require_once './libraries/sql_query_form.lib.php';
/**
* Gets informations about the database and, if it is empty, move to the
* "db_structure.php" script where table can be created
*/
require('./libraries/db_info.inc.php');
if ( $num_tables == 0 && empty( $db_query_force ) ) {
$sub_part = '';
$is_info = TRUE;
require './db_structure.php';
exit();
}
/**
* Query box, bookmark, insert data from textfile
*/
PMA_sqlQueryForm();
/**
* Displays the footer
*/
require_once './libraries/footer.inc.php';
?>

View File

@ -0,0 +1,529 @@
<?php
/* $Id: db_structure.php 9814 2006-12-31 17:15:56Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:
require_once './libraries/common.lib.php';
require_once './libraries/Table.class.php';
/**
* Prepares the tables list if the user where not redirected to this script
* because there is no table in the database ($is_info is true)
*/
if (empty($is_info)) {
// Drops/deletes/etc. multiple tables if required
if ((!empty($submit_mult) && isset($selected_tbl))
|| isset($mult_btn)) {
$action = 'db_structure.php';
$err_url = 'db_structure.php?'. PMA_generate_common_url($db);
require './libraries/mult_submits.inc.php';
$message = $strSuccess;
}
require './libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_structure.php';
// Gets the database structure
$sub_part = '_structure';
require './libraries/db_info.inc.php';
}
// 1. No tables
if ($num_tables == 0) {
echo '<p>' . $strNoTablesFound . '</p>' . "\n";
if (empty($db_is_information_schema)) {
require './libraries/display_create_table.lib.php';
} // end if (Create Table dialog)
/**
* Displays the footer
*/
require_once './libraries/footer.inc.php';
exit;
}
// else
// 2. Shows table informations - staybyte - 11 June 2001
require_once './libraries/bookmark.lib.php';
if (PMA_MYSQL_INT_VERSION >= 40101) {
require_once './libraries/mysql_charsets.lib.php';
$db_collation = PMA_getDbCollation($db);
}
// Display function
/**
* void PMA_TableHeader([bool $db_is_information_schema = false])
* display table header (<table><thead>...</thead><tbody>)
*
* @uses PMA_showHint()
* @uses PMA_MYSQL_INT_VERSION
* @uses $GLOBALS['cfg']['PropertiesNumColumns']
* @uses $GLOBALS['is_show_stats']
* @uses $GLOBALS['strTable']
* @uses $GLOBALS['strAction']
* @uses $GLOBALS['strRecords']
* @uses $GLOBALS['strApproximateCount']
* @uses $GLOBALS['strType']
* @uses $GLOBALS['strCollation']
* @uses $GLOBALS['strSize']
* @uses $GLOBALS['strOverhead']
* @uses $GLOBALS['structure_tbl_col_cnt']
* @param boolean $db_is_information_schema
*/
function PMA_TableHeader($db_is_information_schema = false)
{
$cnt = 0; // Let's count the columns...
if ($db_is_information_schema) {
$action_colspan = 3;
} else {
$action_colspan = 6;
}
echo '<table class="data" style="float: left;">' . "\n"
.'<thead>' . "\n"
.'<tr><td></td>' . "\n"
.' <th>' . $GLOBALS['strTable'] . '</th>' . "\n"
.' <th colspan="' . $action_colspan . '">' . "\n"
.' ' . $GLOBALS['strAction'] . "\n"
.' </th>'
.' <th>' . $GLOBALS['strRecords']
.PMA_showHint($GLOBALS['strApproximateCount']) . "\n"
.' </th>' . "\n";
if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
echo ' <th>' . $GLOBALS['strType'] . '</th>' . "\n";
$cnt++;
if (PMA_MYSQL_INT_VERSION >= 40100) {
echo ' <th>' . $GLOBALS['strCollation'] . '</th>' . "\n";
$cnt++;
}
}
if ($GLOBALS['is_show_stats']) {
echo ' <th>' . $GLOBALS['strSize'] . '</th>' . "\n"
. ' <th>' . $GLOBALS['strOverhead'] . '</th>' . "\n";
$cnt += 2;
}
echo '</tr>' . "\n";
echo '</thead>' . "\n";
echo '<tbody>' . "\n";
$GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
} // end function PMA_TableHeader()
$titles = array();
if (true == $cfg['PropertiesIconic']) {
$titles['Browse'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" />';
$titles['NoBrowse'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" />';
$titles['Search'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" />';
$titles['NoSearch'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_select.png" alt="' . $strSearch . '" title="' . $strSearch . '" />';
$titles['Insert'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" />';
$titles['NoInsert'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_insrow.png" alt="' . $strInsert . '" title="' . $strInsert . '" />';
$titles['Structure'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_props.png" alt="' . $strStructure . '" title="' . $strStructure . '" />';
$titles['Drop'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
$titles['NoDrop'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
$titles['Empty'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" />';
$titles['NoEmpty'] = '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" />';
if ('both' === $cfg['PropertiesIconic']) {
$titles['Browse'] .= $strBrowse;
$titles['Search'] .= $strSearch;
$titles['NoBrowse'] .= $strBrowse;
$titles['NoSearch'] .= $strSearch;
$titles['Insert'] .= $strInsert;
$titles['NoInsert'] .= $strInsert;
$titles['Structure'] .= $strStructure;
$titles['Drop'] .= $strDrop;
$titles['NoDrop'] .= $strDrop;
$titles['Empty'] .= $strEmpty;
$titles['NoEmpty'] .= $strEmpty;
}
} else {
$titles['Browse'] = $strBrowse;
$titles['Search'] = $strSearch;
$titles['NoBrowse'] = $strBrowse;
$titles['NoSearch'] = $strSearch;
$titles['Insert'] = $strInsert;
$titles['NoInsert'] = $strInsert;
$titles['Structure'] = $strStructure;
$titles['Drop'] = $strDrop;
$titles['NoDrop'] = $strDrop;
$titles['Empty'] = $strEmpty;
$titles['NoEmpty'] = $strEmpty;
}
/**
* Displays the tables list
*/
?>
<form method="post" action="db_structure.php" name="tablesForm" id="tablesForm">
<?php
echo PMA_generate_common_hidden_inputs($db);
PMA_TableHeader($db_is_information_schema);
$i = $sum_entries = 0;
$sum_size = (double) 0;
$overhead_size = (double) 0;
$overhead_check = '';
$checked = !empty($checkall) ? ' checked="checked"' : '';
$num_columns = $cfg['PropertiesNumColumns'] > 1 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 : 0;
$row_count = 0;
$hidden_fields = array();
$odd_row = true;
$at_least_one_view_exceeds_max_count = false;
foreach ($tables as $keyname => $each_table) {
if ($each_table['TABLE_ROWS'] === null || $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
$each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
$each_table['TABLE_NAME'], $return = true, $force_exact = true);
}
$table_encoded = urlencode($each_table['TABLE_NAME']);
// MySQL < 5.0.13 returns "view", >= 5.0.13 returns "VIEW"
$table_is_view = ($each_table['TABLE_TYPE'] === 'VIEW'
|| $each_table['TABLE_TYPE'] === 'SYSTEM VIEW');
$alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']]))
? htmlspecialchars($tooltip_aliasname[$each_table['TABLE_NAME']])
: htmlspecialchars($each_table['TABLE_NAME']);
$truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']]))
? htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']])
: htmlspecialchars($each_table['TABLE_NAME']);
// Sets parameters for links
$tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
$i++;
$row_count++;
if ($table_is_view) {
$hidden_fields[] = '<input type="hidden" name="views[]" value="' . $table_encoded . '" />';
}
if ($each_table['TABLE_ROWS'] > 0) {
$browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $titles['Browse'] . '</a>';
$search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';
} else {
$browse_table = $titles['NoBrowse'];
$search_table = $titles['NoSearch'];
}
if (! $db_is_information_schema) {
if (! empty($each_table['TABLE_ROWS'])) {
$empty_table = '<a href="sql.php?' . $tbl_url_query
. '&amp;sql_query=';
if (PMA_MYSQL_INT_VERSION >= 40000) {
$empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
. '&amp;zero_rows='
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
. '" onclick="return confirmLink(this, \'TRUNCATE ';
} else {
$empty_table .= urlencode('DELETE FROM ' . PMA_backquote($each_table['TABLE_NAME']))
. '&amp;zero_rows='
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
. '" onclick="return confirmLink(this, \'DELETE FROM ';
}
$empty_table .= PMA_jsFormat($each_table['TABLE_NAME']) . '\')">' . $titles['Empty'] . '</a>';
} else {
$empty_table = $titles['NoEmpty'];
}
$drop_query = 'DROP '
. ($table_is_view ? 'VIEW' : 'TABLE')
. ' ' . PMA_backquote($each_table['TABLE_NAME']);
$drop_message = sprintf(
$table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped,
htmlspecialchars($each_table['TABLE_NAME']));
}
// loic1: Patch from Joshua Nye <josh at boxcarmedia.com> to get valid
// statistics whatever is the table type
if (isset($each_table['TABLE_ROWS'])) {
// MyISAM, ISAM or Heap table: Row count, data size and index size
// is accurate.
if (preg_match('@^(MyISAM|ISAM|HEAP|MEMORY)$@', $each_table['ENGINE'])) {
if ($is_show_stats) {
$tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']);
$sum_size += $tblsize;
list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) {
list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0);
$overhead_size += $each_table['Data_free'];
}
}
$sum_entries += $each_table['TABLE_ROWS'];
} elseif ($each_table['ENGINE'] == 'InnoDB') {
// InnoDB table: Row count is not accurate but data and index
// sizes are.
if ($is_show_stats) {
$tblsize = $each_table['Data_length'] + $each_table['Index_length'];
$sum_size += $tblsize;
list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
}
//$display_rows = ' - ';
$sum_entries += $each_table['TABLE_ROWS'];
} elseif (preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $each_table['ENGINE'])) {
// Merge or BerkleyDB table: Only row count is accurate.
if ($is_show_stats) {
$formatted_size = ' - ';
$unit = '';
}
$sum_entries += $each_table['TABLE_ROWS'];
} else {
// Unknown table type.
if ($is_show_stats) {
$formatted_size = 'unknown';
$unit = '';
}
}
if (PMA_MYSQL_INT_VERSION >= 40100) {
if (isset($each_table['Collation'])) {
$collation = '<dfn title="'
. PMA_getCollationDescr($each_table['Collation']) . '">'
. $each_table['Collation'] . '</dfn>';
} else {
$collation = '---';
}
}
if ($is_show_stats) {
if (isset($formatted_overhead)) {
$overhead = '<a href="tbl_structure.php?'
. $tbl_url_query . '#showusage">' . $formatted_overhead
. ' ' . $overhead_unit . '</a>' . "\n";
unset($formatted_overhead);
$overhead_check .=
"document.getElementById('checkbox_tbl_$i').checked = true;";
} else {
$overhead = '-';
}
} // end if
} // end if (isset($each_table['TABLE_ROWS'])
if ($num_columns > 0 && $num_tables > $num_columns
&& (($row_count % $num_columns) == 0)) {
$row_count = 1;
$odd_row = true;
?>
</tr>
</tbody>
</table>
<?php
PMA_TableHeader();
}
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
<td align="center">
<input type="checkbox" name="selected_tbl[]"
value="<?php echo $table_encoded; ?>"
id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td>
<th><label for="checkbox_tbl_<?php echo $i; ?>"
title="<?php echo $alias; ?>"><?php echo $truename; ?></label>
</th>
<td align="center"><?php echo $browse_table; ?></td>
<td align="center">
<a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">
<?php echo $titles['Structure']; ?></a></td>
<td align="center"><?php echo $search_table; ?></td>
<?php if (! $db_is_information_schema) { ?>
<td align="center">
<a href="tbl_change.php?<?php echo $tbl_url_query; ?>">
<?php echo $titles['Insert']; ?></a></td>
<td align="center"><?php echo $empty_table; ?></td>
<td align="center">
<a href="sql.php?<?php echo $tbl_url_query;
?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php
echo urlencode($drop_query); ?>&amp;zero_rows=<?php
echo urlencode($drop_message); ?>"
onclick="return confirmLink(this, '<?php echo PMA_jsFormat($drop_query, false); ?>')">
<?php echo $titles['Drop']; ?></a></td>
<?php } // end if (! $db_is_information_schema)
// there is a null value in the ENGINE
// - when the table needs to be repaired, or
// - when it's a view
// so ensure that we'll display "in use" below for a table
// that needs to be repaired
if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
if ($table_is_view && $each_table['TABLE_ROWS'] >= $cfg['MaxExactCountViews']) {
$at_least_one_view_exceeds_max_count = true;
$show_superscript = '<sup>1</sup>';
} else {
$show_superscript = '';
}
?>
<td class="value"><?php echo PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td>
<?php if (!($cfg['PropertiesNumColumns'] > 1)) { ?>
<td nowrap="nowrap"><?php echo ($table_is_view ? $strView : $each_table['ENGINE']); ?></td>
<?php if (isset($collation)) { ?>
<td nowrap="nowrap"><?php echo $collation ?></td>
<?php } ?>
<?php } ?>
<?php if ($is_show_stats) { ?>
<td class="value"><a
href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage"
><?php echo $formatted_size . ' ' . $unit; ?></a></td>
<td class="value"><?php echo $overhead; ?></td>
<?php } // end if ?>
<?php } elseif ($table_is_view) { ?>
<td class="value">-</td>
<td><?php echo $strView; ?></td>
<td>---</td>
<?php if ($is_show_stats) { ?>
<td class="value">-</td>
<td class="value">-</td>
<?php } ?>
<?php } else { ?>
<td colspan="<?php echo ($structure_tbl_col_cnt - ($db_is_information_schema ? 5 : 8)) ?>"
align="center">
<?php echo $strInUse; ?></td>
<?php } // end if (isset($each_table['TABLE_ROWS'])) else ?>
</tr>
<?php
} // end foreach
// Show Summary
if ($is_show_stats) {
list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);
list($overhead_formatted, $overhead_unit) =
PMA_formatByteDown($overhead_size, 3, 1);
}
?>
</tbody>
<tbody>
<tr><td></td>
<th align="center" nowrap="nowrap">
<?php echo sprintf($strTables, PMA_formatNumber($num_tables, 0)); ?>
</th>
<th colspan="<?php echo ($db_is_information_schema ? 3 : 6) ?>" align="center">
<?php echo $strSum; ?></th>
<th class="value"><?php echo PMA_formatNumber($sum_entries, 0); ?></th>
<?php
if (!($cfg['PropertiesNumColumns'] > 1)) {
$default_engine = PMA_DBI_get_default_engine();
echo ' <th align="center">' . "\n"
. ' <dfn title="'
. sprintf($strDefaultEngine, $default_engine) . '">' .$default_engine . '</dfn></th>' . "\n";
// Have to account for old MySQL with no collation (bug 1554885)
if (PMA_MYSQL_INT_VERSION >= 40100) {
// we got a case where $db_collation was empty
echo ' <th align="center">' . "\n";
if (! empty($db_collation)) {
echo ' <dfn title="'
. PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation
. '</dfn>';
}
echo '</th>';
}
}
if ($is_show_stats) {
?>
<th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th>
<th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>
<?php
}
?>
</tr>
</tbody>
</table>
<div class="clearfloat">
<?php
// Check all tables url
$checkall_url = 'db_structure.php?' . PMA_generate_common_url($db);
?>
<img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<a href="<?php echo $checkall_url; ?>&amp;checkall=1"
onclick="if (markAllRows('tablesForm')) return false;">
<?php echo $strCheckAll; ?></a>
/
<a href="<?php echo $checkall_url; ?>"
onclick="if (unMarkAllRows('tablesForm')) return false;">
<?php echo $strUncheckAll; ?></a>
<?php if ($overhead_check != '') { ?>
/
<a href="#" onclick="unMarkAllRows('tablesForm');
<?php echo $overhead_check; ?> return false;">
<?php echo $strCheckOverhead; ?></a>
<?php } ?>
<select name="submit_mult" onchange="this.form.submit();" style="margin: 0 3em 0 3em;">
<?php
echo ' <option value="' . $strWithChecked . '" selected="selected">'
. $strWithChecked . '</option>' . "\n";
echo ' <option value="' . $strEmpty . '" >'
. $strEmpty . '</option>' . "\n";
echo ' <option value="' . $strDrop . '" >'
. $strDrop . '</option>' . "\n";
echo ' <option value="' . $strPrintView . '" >'
. $strPrintView . '</option>' . "\n";
echo ' <option value="' . $strCheckTable . '" >'
. $strCheckTable . '</option>' . "\n";
echo ' <option value="' . $strOptimizeTable . '" >'
. $strOptimizeTable . '</option>' . "\n";
echo ' <option value="' . $strRepairTable . '" >'
. $strRepairTable . '</option>' . "\n";
echo ' <option value="' . $strAnalyzeTable . '" >'
. $strAnalyzeTable . '</option>' . "\n";
?>
</select>
<script type="text/javascript" language="javascript">
<!--
// Fake js to allow the use of the <noscript> tag
//-->
</script>
<noscript>
<input type="submit" value="<?php echo $strGo; ?>" />
</noscript>
<?php echo implode("\n", $hidden_fields) . "\n"; ?>
</div>
</form>
<?php
// Notice about row count for views
if ($at_least_one_view_exceeds_max_count && !$db_is_information_schema) {
echo '<div class="notice">' . "\n";
echo '<sup>1</sup>' . PMA_sanitize(sprintf($strViewMaxExactCount, PMA_formatNumber($cfg['MaxExactCountViews'], 0), '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')) . "\n";
echo '</div>' . "\n";
}
?>
<hr />
<?php
/**
* Work on the database
* redesigned 2004-05-08 by mkkeck
*/
/* DATABASE WORK */
/* Printable view of a table */
echo '<p>';
echo '<a href="db_printview.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage
.'b_print.png" width="16" height="16" alt="" />';
}
echo $strPrintView . '</a> ';
echo '<a href="./db_datadict.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage
.'b_tblanalyse.png" width="16" height="16" alt="" />';
}
echo $strDataDict . '</a>';
echo '</p>';
if (empty($db_is_information_schema)) {
require './libraries/display_create_table.lib.php';
} // end if (Create Table dialog)
/**
* Displays the footer
*/
require_once './libraries/footer.inc.php';
?>

View File

@ -0,0 +1,70 @@
<?php
/* $Id: error.php 9621 2006-10-26 15:49:33Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
*
* phpMyAdmin fatal error display page
*
*/
/* Input sanitizing */
require_once('./libraries/sanitizing.lib.php');
/* Get variables */
$lang = isset( $_REQUEST['lang'] ) ? htmlspecialchars($_REQUEST['lang']) : 'en';
$dir = isset( $_REQUEST['dir'] ) ? htmlspecialchars($_REQUEST['dir']) : 'ltr';
// force utf-8 to avoid XSS with crafted URL and utf-7 in charset parameter
$charset = 'utf-8';
$type = isset( $_REQUEST['type'] ) ? htmlspecialchars($_REQUEST['type']) : 'error';
header('Content-Type: text/html; charset=' . $charset);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>">
<head>
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<style type="text/css">
<!--
html {
padding: 0;
margin: 0;
}
body {
font-family: sans-serif;
font-size: small;
color: #000000;
background-color: #F5F5F5;
margin: 1em;
}
h1 {
margin: 0;
padding: 0.3em;
font-size: 1.4em;
font-weight: bold;
color: #ffffff;
background-color: #ff0000;
}
p {
margin: 0;
padding: 0.5em;
border: 0.1em solid red;
background-color: #ffeeee;
}
//-->
</style>
</head>
<body>
<h1>phpMyAdmin - <?php echo $type; ?></h1>
<p><?php
if (get_magic_quotes_gpc()) {
echo PMA_sanitize(stripslashes($_REQUEST['error']));
} else {
echo PMA_sanitize($_REQUEST['error']);
}
?></p>
</body>
</html>

View File

@ -0,0 +1,668 @@
<?php
/* $Id: export.php 10259 2007-04-09 15:35:21Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Get the variables sent or posted to this script and a core script
*/
require_once('./libraries/common.lib.php');
require_once('./libraries/zip.lib.php');
require_once('./libraries/plugin_interface.lib.php');
PMA_checkParameters(array('what', 'export_type'));
// Scan plugins
$export_list = PMA_getPlugins('./libraries/export/', array('export_type' => $export_type, 'single_table' => isset($single_table)));
// Backward compatbility
$type = $what;
// Check export type
if (!isset($export_list[$type])) {
die('Bad type!');
}
/**
* valid compression methods
*/
$compression_methods = array(
'zip',
'gzip',
'bzip',
);
/**
* init and variable checking
*/
$compression = false;
$onserver = false;
$save_on_server = false;
$buffer_needed = false;
if (empty($_REQUEST['asfile'])) {
$asfile = false;
} else {
$asfile = true;
if (in_array($_REQUEST['compression'], $compression_methods)) {
$compression = $_REQUEST['compression'];
$buffer_needed = true;
}
if (!empty($_REQUEST['onserver'])) {
$onserver = $_REQUEST['onserver'];
// Will we save dump on server?
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
}
}
// Does export require to be into file?
if (isset($export_list[$type]['force_file']) && ! $asfile) {
$message = $strExportMustBeFile;
$GLOBALS['show_error_header'] = true;
$js_to_run = 'functions.js';
require_once('./libraries/header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
require('./server_export.php');
} elseif ($export_type == 'database') {
$active_page = 'db_export.php';
require('./db_export.php');
} else {
$active_page = 'tbl_export.php';
require('./tbl_export.php');
}
exit();
}
// Generate error url and check for needed variables
if ($export_type == 'server') {
$err_url = 'server_export.php?' . PMA_generate_common_url();
} elseif ($export_type == 'database' && strlen($db)) {
$err_url = 'db_export.php?' . PMA_generate_common_url($db);
// Check if we have something to export
if (isset($table_select)) {
$tables = $table_select;
} else {
$tables = array();
}
} elseif ($export_type == 'table' && strlen($db) && strlen($table)) {
$err_url = 'tbl_export.php?' . PMA_generate_common_url($db, $table);
} else {
die('Bad parameters!');
}
// Get the functions specific to the export type
require('./libraries/export/' . PMA_securePath($type) . '.php');
/**
* Increase time limit for script execution and initializes some variables
*/
@set_time_limit($cfg['ExecTimeLimit']);
if (!empty($cfg['MemoryLimit'])) {
@ini_set('memory_limit', $cfg['MemoryLimit']);
}
// Start with empty buffer
$dump_buffer = '';
$dump_buffer_len = 0;
// We send fake headers to avoid browser timeout when buffering
$time_start = time();
/**
* Output handler for all exports, if needed buffering, it stores data into
* $dump_buffer, otherwise it prints thems out.
*
* @param string the insert statement
*
* @return bool Whether output suceeded
*/
function PMA_exportOutputHandler($line)
{
global $time_start, $dump_buffer, $dump_buffer_len, $save_filename;
// Kanji encoding convert feature
if ($GLOBALS['output_kanji_conversion']) {
$line = PMA_kanji_str_conv($line, $GLOBALS['knjenc'], isset($GLOBALS['xkana']) ? $GLOBALS['xkana'] : '');
}
// If we have to buffer data, we will perform everything at once at the end
if ($GLOBALS['buffer_needed']) {
$dump_buffer .= $line;
if ($GLOBALS['onfly_compression']) {
$dump_buffer_len += strlen($line);
if ($dump_buffer_len > $GLOBALS['memory_limit']) {
if ($GLOBALS['output_charset_conversion']) {
$dump_buffer = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $dump_buffer);
}
// as bzipped
if ($GLOBALS['compression'] == 'bzip' && @function_exists('bzcompress')) {
$dump_buffer = bzcompress($dump_buffer);
}
// as a gzipped file
elseif ($GLOBALS['compression'] == 'gzip' && @function_exists('gzencode')) {
// without the optional parameter level because it bug
$dump_buffer = gzencode($dump_buffer);
}
if ($GLOBALS['save_on_server']) {
$write_result = @fwrite($GLOBALS['file_handle'], $dump_buffer);
if (!$write_result || ($write_result != strlen($dump_buffer))) {
$GLOBALS['message'] = sprintf($GLOBALS['strNoSpace'], htmlspecialchars($save_filename));
$GLOBALS['show_error_header'] = TRUE;
return FALSE;
}
} else {
echo $dump_buffer;
}
$dump_buffer = '';
$dump_buffer_len = 0;
}
} else {
$time_now = time();
if ($time_start >= $time_now + 30) {
$time_start = $time_now;
header('X-pmaPing: Pong');
} // end if
}
} else {
if ($GLOBALS['asfile']) {
if ($GLOBALS['save_on_server'] && strlen($line) > 0) {
$write_result = @fwrite($GLOBALS['file_handle'], $line);
if (!$write_result || ($write_result != strlen($line))) {
$GLOBALS['message'] = sprintf($GLOBALS['strNoSpace'], htmlspecialchars($save_filename));
$GLOBALS['show_error_header'] = TRUE;
return FALSE;
}
$time_now = time();
if ($time_start >= $time_now + 30) {
$time_start = $time_now;
header('X-pmaPing: Pong');
} // end if
} else {
// We export as file - output normally
if ($GLOBALS['output_charset_conversion']) {
$line = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $line);
}
echo $line;
}
} else {
// We export as html - replace special chars
echo htmlspecialchars($line);
}
}
return TRUE;
} // end of the 'PMA_exportOutputHandler()' function
// Defines the default <CR><LF> format. For SQL always use \n as MySQL wants this on all platforms.
if ($what == 'sql') {
$crlf = "\n";
} else {
$crlf = PMA_whichCrlf();
}
$output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls';
// Do we need to convert charset?
$output_charset_conversion = $asfile &&
$cfg['AllowAnywhereRecoding'] && $allow_recoding
&& isset($charset_of_file) && $charset_of_file != $charset
&& $type != 'xls';
// Use on fly compression?
$onfly_compression = $GLOBALS['cfg']['CompressOnFly'] && ($compression == 'gzip' | $compression == 'bzip');
if ($onfly_compression) {
$memory_limit = trim(@ini_get('memory_limit'));
// 2 MB as default
if (empty($memory_limit)) {
$memory_limit = 2 * 1024 * 1024;
}
if (strtolower(substr($memory_limit, -1)) == 'm') {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
} elseif (strtolower(substr($memory_limit, -1)) == 'k') {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
} elseif (strtolower(substr($memory_limit, -1)) == 'g') {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
} else {
$memory_limit = (int)$memory_limit;
}
// Some of memory is needed for other thins and as treshold.
// Nijel: During export I had allocated (see memory_get_usage function)
// approx 1.2MB so this comes from that.
if ($memory_limit > 1500000) {
$memory_limit -= 1500000;
}
// Some memory is needed for compression, assume 1/3
$memory_limit /= 8;
}
// Generate filename and mime type if needed
if ($asfile) {
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
if ($export_type == 'server') {
if (isset($remember_template)) {
PMA_setCookie('pma_server_filename_template', $filename_template);
}
$filename = str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template));
} elseif ($export_type == 'database') {
if (isset($remember_template)) {
PMA_setCookie('pma_db_filename_template', $filename_template);
}
$filename = str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)));
} else {
if (isset($remember_template)) {
PMA_setCookie('pma_table_filename_template', $filename_template);
}
$filename = str_replace('__TABLE__', $table, str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template))));
}
// convert filename to iso-8859-1, it is safer
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
$filename = PMA_convert_string($charset, 'iso-8859-1', $filename);
} else {
$filename = PMA_convert_string($convcharset, 'iso-8859-1', $filename);
}
// Grab basic dump extension and mime type
$filename .= '.' . $export_list[$type]['extension'];
$mime_type = $export_list[$type]['mime_type'];
// If dump is going to be compressed, set correct encoding or mime_type and add
// compression to extension
$content_encoding = '';
if ($compression == 'bzip') {
$filename .= '.bz2';
// browsers don't like this:
//$content_encoding = 'x-bzip2';
$mime_type = 'application/x-bzip2';
} elseif ($compression == 'gzip') {
$filename .= '.gz';
// Needed to avoid recompression by server modules like mod_gzip.
// It seems necessary to check about zlib.output_compression
// to avoid compressing twice
if (!@ini_get('zlib.output_compression')) {
$content_encoding = 'x-gzip';
$mime_type = 'application/x-gzip';
}
} elseif ($compression == 'zip') {
$filename .= '.zip';
$mime_type = 'application/zip';
}
}
// Open file on server if needed
if ($save_on_server) {
$save_filename = PMA_userDir($cfg['SaveDir']) . preg_replace('@[/\\\\]@', '_', $filename);
unset($message);
if (file_exists($save_filename) && empty($onserverover)) {
$message = sprintf($strFileAlreadyExists, htmlspecialchars($save_filename));
$GLOBALS['show_error_header'] = TRUE;
} else {
if (is_file($save_filename) && !is_writable($save_filename)) {
$message = sprintf($strNoPermission, htmlspecialchars($save_filename));
$GLOBALS['show_error_header'] = TRUE;
} else {
if (!$file_handle = @fopen($save_filename, 'w')) {
$message = sprintf($strNoPermission, htmlspecialchars($save_filename));
$GLOBALS['show_error_header'] = TRUE;
}
}
}
if (isset($message)) {
$js_to_run = 'functions.js';
require_once('./libraries/header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
require('./server_export.php');
} elseif ($export_type == 'database') {
$active_page = 'db_export.php';
require('./db_export.php');
} else {
$active_page = 'tbl_export.php';
require('./tbl_export.php');
}
exit();
}
}
/**
* Send headers depending on whether the user chose to download a dump file
* or not
*/
if (!$save_on_server) {
if ($asfile ) {
// Download
if (!empty($content_encoding)) {
header('Content-Encoding: ' . $content_encoding);
}
header('Content-Type: ' . $mime_type);
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
// lem9: Tested behavior of
// IE 5.50.4807.2300
// IE 6.0.2800.1106 (small glitch, asks twice when I click Open)
// IE 6.0.2900.2180
// Firefox 1.0.6
// in http and https
header('Content-Disposition: attachment; filename="' . $filename . '"');
if (PMA_USR_BROWSER_AGENT == 'IE') {
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Pragma: no-cache');
}
} else {
// HTML
if ($export_type == 'database') {
$num_tables = count($tables);
if ($num_tables == 0) {
$message = $strNoTablesFound;
$js_to_run = 'functions.js';
require_once('./libraries/header.inc.php');
$active_page = 'db_export.php';
require('./db_export.php');
exit();
}
}
$backup_cfgServer = $cfg['Server'];
require_once('./libraries/header.inc.php');
$cfg['Server'] = $backup_cfgServer;
unset($backup_cfgServer);
echo "\n" . '<div align="' . $cell_align_left . '">' . "\n";
//echo ' <pre>' . "\n";
echo ' <form name="nofunction">' . "\n"
// remove auto-select for now: there is no way to select
// only a part of the text; anyway, it should obey
// $cfg['TextareaAutoSelect']
//. ' <textarea name="sqldump" cols="50" rows="30" onclick="this.select();" id="textSQLDUMP" wrap="OFF">' . "\n";
. ' <textarea name="sqldump" cols="50" rows="30" id="textSQLDUMP" wrap="OFF">' . "\n";
} // end download
}
// Fake loop just to allow skip of remain of this code by break, I'd really
// need exceptions here :-)
do {
// Add possibly some comments to export
if (!PMA_exportHeader()) {
break;
}
// Will we need relation & co. setup?
$do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
}
if ($do_mime) {
require_once('./libraries/transformations.lib.php');
}
// Include dates in export?
$do_dates = isset($GLOBALS[$what . '_dates']);
/**
* Builds the dump
*/
// Gets the number of tables if a dump of a database has been required
if ($export_type == 'server') {
if (isset($db_select)) {
$tmp_select = implode($db_select, '|');
$tmp_select = '|' . $tmp_select . '|';
}
// Walk over databases
foreach ($GLOBALS['PMA_List_Database']->items as $current_db) {
if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))
|| !isset($tmp_select)) {
if (!PMA_exportDBHeader($current_db)) {
break 2;
}
if (!PMA_exportDBCreate($current_db)) {
break 2;
}
$tables = PMA_DBI_get_tables($current_db);
$views = array();
foreach ($tables as $table) {
// if this is a view, collect it for later; views must be exported
// after the tables
$is_view = PMA_Table::isView($current_db, $table);
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table')) {
break 3;
}
}
if (isset($GLOBALS[$what . '_data']) && ! $is_view) {
$local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
break 3;
}
}
}
foreach($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view')) {
break 3;
}
}
}
if (!PMA_exportDBFooter($current_db)) {
break 2;
}
}
}
} elseif ($export_type == 'database') {
if (!PMA_exportDBHeader($db)) {
break;
}
$i = 0;
$views = array();
// $tables contains the choices from the user (via $table_select)
foreach ($tables as $table) {
// if this is a view, collect it for later; views must be exported after
// the tables
$is_view = PMA_Table::isView($db, $table);
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table')) {
break 2;
}
}
if (isset($GLOBALS[$what . '_data']) && ! $is_view) {
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
break 2;
}
}
}
foreach ($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view')) {
break 2;
}
}
}
if (!PMA_exportDBFooter($db)) {
break;
}
} else {
if (!PMA_exportDBHeader($db)) {
break;
}
// We export just one table
if ($limit_to > 0 && $limit_from >= 0) {
$add_query = ' LIMIT '
. (($limit_from > 0) ? $limit_from . ', ' : '')
. $limit_to;
} else {
$add_query = '';
}
$is_view = PMA_Table::isView($db, $table);
if (isset($GLOBALS[$what . '_structure'])) {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table')) {
break;
}
}
// If this is an export of a single view, we have to export data;
// for example, a PDF report
if (isset($GLOBALS[$what . '_data'])) {
if (!empty($sql_query)) {
// only preg_replace if needed
if (!empty($add_query)) {
// remove trailing semicolon before adding a LIMIT
$sql_query = preg_replace('%;\s*$%', '', $sql_query);
}
$local_query = $sql_query . $add_query;
PMA_DBI_select_db($db);
} else {
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
}
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
break;
}
}
if (!PMA_exportDBFooter($db)) {
break;
}
}
if (!PMA_exportFooter()) {
break;
}
} while (FALSE);
// End of fake loop
if ($save_on_server && isset($message)) {
$js_to_run = 'functions.js';
require_once('./libraries/header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
require('./server_export.php');
} elseif ($export_type == 'database') {
$active_page = 'db_export.php';
require('./db_export.php');
} else {
$active_page = 'tbl_export.php';
require('./tbl_export.php');
}
exit();
}
/**
* Send the dump as a file...
*/
if (!empty($asfile)) {
// Convert the charset if required.
if ($output_charset_conversion) {
$dump_buffer = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $dump_buffer);
}
// Do the compression
// 1. as a gzipped file
if ($compression == 'zip') {
if (@function_exists('gzcompress')) {
$zipfile = new zipfile();
$zipfile -> addFile($dump_buffer, substr($filename, 0, -4));
$dump_buffer = $zipfile -> file();
}
}
// 2. as a bzipped file
elseif ($compression == 'bzip') {
if (@function_exists('bzcompress')) {
$dump_buffer = bzcompress($dump_buffer);
if ($dump_buffer === -8) {
require_once('./libraries/header.inc.php');
echo sprintf($strBzError, '<a href="http://bugs.php.net/bug.php?id=17300" target="_blank">17300</a>');
require_once('./libraries/footer.inc.php');
}
}
}
// 3. as a gzipped file
elseif ($compression == 'gzip') {
if (@function_exists('gzencode')) {
// without the optional parameter level because it bug
$dump_buffer = gzencode($dump_buffer);
}
}
/* If ve saved on server, we have to close file now */
if ($save_on_server) {
$write_result = @fwrite($file_handle, $dump_buffer);
fclose($file_handle);
if (strlen($dump_buffer) !=0 && (!$write_result || ($write_result != strlen($dump_buffer)))) {
$message = sprintf($strNoSpace, htmlspecialchars($save_filename));
} else {
$message = sprintf($strDumpSaved, htmlspecialchars($save_filename));
}
$js_to_run = 'functions.js';
require_once('./libraries/header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
require_once('./server_export.php');
} elseif ($export_type == 'database') {
$active_page = 'db_export.php';
require_once('./db_export.php');
} else {
$active_page = 'tbl_export.php';
require_once('./tbl_export.php');
}
exit();
} else {
echo $dump_buffer;
}
}
/**
* Displays the dump...
*/
else {
/**
* Close the html tags and add the footers in dump is displayed on screen
*/
//echo ' </pre>' . "\n";
echo '</textarea>' . "\n"
. ' </form>' . "\n";
echo '</div>' . "\n";
echo "\n";
?>
<script type="text/javascript" language="javascript">
//<![CDATA[
var bodyWidth=null; var bodyHeight=null;
if (document.getElementById('textSQLDUMP')) {
bodyWidth = self.innerWidth;
bodyHeight = self.innerHeight;
if (!bodyWidth && !bodyHeight) {
if (document.compatMode && document.compatMode == "BackCompat") {
bodyWidth = document.body.clientWidth;
bodyHeight = document.body.clientHeight;
} else if (document.compatMode && document.compatMode == "CSS1Compat") {
bodyWidth = document.documentElement.clientWidth;
bodyHeight = document.documentElement.clientHeight;
}
}
document.getElementById('textSQLDUMP').style.width=(bodyWidth-50) + 'px';
document.getElementById('textSQLDUMP').style.height=(bodyHeight-100) + 'px';
}
//]]>
</script>
<?php
require_once('./libraries/footer.inc.php');
} // end if
?>

View File

@ -0,0 +1,421 @@
<?php
/* $Id: import.php 9636 2006-10-27 13:04:15Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
/* Core script for import, this is just the glue around all other stuff */
/**
* Get the variables sent or posted to this script and a core script
*/
require_once('./libraries/common.lib.php');
$js_to_run = 'functions.js';
// default values
$GLOBALS['reload'] = false;
// Are we just executing plain query or sql file? (eg. non import, but query box/window run)
if (!empty($sql_query)) {
// run SQL query
$import_text = $sql_query;
$import_type = 'query';
$format = 'sql';
// refresh left frame on changes in table or db structure
if (preg_match('/^(CREATE|ALTER|DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) {
$GLOBALS['reload'] = true;
}
unset($sql_query);
} elseif (!empty($sql_localfile)) {
// run SQL file on server
$local_import_file = $sql_localfile;
$import_type = 'queryfile';
$format = 'sql';
unset($sql_localfile);
} elseif (!empty($sql_file)) {
// run uploaded SQL file
$import_file = $sql_file;
$import_type = 'queryfile';
$format = 'sql';
unset($sql_file);
} elseif (!empty($id_bookmark)) {
// run bookmark
$import_type = 'query';
$format = 'sql';
}
// If we didn't get any parameters, either user called this directly, or
// upload limit has been reached, let's assume the second possibility.
if ($_POST == array() && $_GET == array()) {
require_once('./libraries/header.inc.php');
$show_error_header = TRUE;
PMA_showMessage(sprintf($strUploadLimit, '[a@./Documentation.html#faq1_16@_blank]', '[/a]'));
require('./libraries/footer.inc.php');
}
// Check needed parameters
PMA_checkParameters(array('import_type', 'format'));
// We don't want anything special in format
$format = PMA_securePath($format);
// Import functions
require_once('./libraries/import.lib.php');
// Create error and goto url
if ($import_type == 'table') {
$err_url = 'tbl_import.php?' . PMA_generate_common_url($db, $table);
$goto = 'tbl_import.php';
} elseif ($import_type == 'database') {
$err_url = 'db_import.php?' . PMA_generate_common_url($db);
$goto = 'db_import.php';
} elseif ($import_type == 'server') {
$err_url = 'server_import.php?' . PMA_generate_common_url();
$goto = 'server_import.php';
} else {
if (empty($goto) || !preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) {
if (isset($table) && isset($db)) {
$goto = 'tbl_structure.php';
} elseif (isset($db)) {
$goto = 'db_structure.php';
} else {
$goto = 'server_sql.php';
}
}
if (isset($table) && isset($db)) {
$common = PMA_generate_common_url($db, $table);
} elseif (isset($db)) {
$common = PMA_generate_common_url($db);
} else {
$common = PMA_generate_common_url();
}
$err_url = $goto
. '?' . $common
. (preg_match('@^tbl_[a-z]*\.php$@', $goto) ? '&amp;table=' . urlencode($table) : '');
}
if (isset($db)) {
PMA_DBI_select_db($db);
}
@set_time_limit($cfg['ExecTimeLimit']);
if (!empty($cfg['MemoryLimit'])) {
@ini_set('memory_limit', $cfg['MemoryLimit']);
}
$timestamp = time();
if (isset($allow_interrupt)) {
$maximum_time = ini_get('max_execution_time');
} else {
$maximum_time = 0;
}
// set default values
$timeout_passed = FALSE;
$error = FALSE;
$read_multiply = 1;
$finished = FALSE;
$offset = 0;
$max_sql_len = 0;
$file_to_unlink = '';
$sql_query = '';
$sql_query_disabled = FALSE;
$go_sql = FALSE;
$executed_queries = 0;
$run_query = TRUE;
$charset_conversion = FALSE;
$reset_charset = FALSE;
$bookmark_created = FALSE;
// Bookmark Support: get a query back from bookmark if required
if (!empty($id_bookmark)) {
require_once('./libraries/bookmark.lib.php');
switch ($action_bookmark) {
case 0: // bookmarked query that have to be run
$import_text = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark, 'id', isset($action_bookmark_all));
if (isset($bookmark_variable) && !empty($bookmark_variable)) {
$import_text = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $import_text);
}
// refresh left frame on changes in table or db structure
if (preg_match('/^(CREATE|ALTER|DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $import_text)) {
$GLOBALS['reload'] = true;
}
break;
case 1: // bookmarked query that have to be displayed
$import_text = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
$run_query = FALSE;
break;
case 2: // bookmarked query that have to be deleted
$import_text = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
PMA_deleteBookmarks($db, $cfg['Bookmark'], $id_bookmark);
$run_query = FALSE;
$error = TRUE; // this is kind of hack to skip processing the query
break;
}
} // end bookmarks reading
// Do no run query if we show PHP code
if (isset($GLOBALS['show_as_php'])) {
$run_query = FALSE;
$go_sql = TRUE;
}
// Store the query as a bookmark before executing it if bookmarklabel was given
if (!empty($bkm_label) && !empty($import_text)) {
require_once('./libraries/bookmark.lib.php');
$bfields = array(
'dbase' => $db,
'user' => $cfg['Bookmark']['user'],
'query' => urlencode($import_text),
'label' => $bkm_label
);
// Should we replace bookmark?
if (isset($bkm_replace)) {
$bookmarks = PMA_listBookmarks($db, $cfg['Bookmark']);
foreach ($bookmarks as $key => $val) {
if ($val == $bkm_label) {
PMA_deleteBookmarks($db, $cfg['Bookmark'], $key);
}
}
}
PMA_addBookmarks($bfields, $cfg['Bookmark'], isset($bkm_all_users));
$bookmark_created = TRUE;
} // end store bookmarks
// We can not read all at once, otherwise we can run out of memory
$memory_limit = trim(@ini_get('memory_limit'));
// 2 MB as default
if (empty($memory_limit)) {
$memory_limit = 2 * 1024 * 1024;
}
// In case no memory limit we work on 10MB chunks
if ($memory_limit = -1) {
$memory_limit = 10 * 1024 * 1024;
}
// Calculate value of the limit
if (strtolower(substr($memory_limit, -1)) == 'm') {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
} elseif (strtolower(substr($memory_limit, -1)) == 'k') {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
} elseif (strtolower(substr($memory_limit, -1)) == 'g') {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
} else {
$memory_limit = (int)$memory_limit;
}
$read_limit = $memory_limit / 8; // Just to be sure, there might be lot of memory needed for uncompression
// handle filenames
if (!empty($local_import_file) && !empty($cfg['UploadDir'])) {
// sanitize $local_import_file as it comes from a POST
$local_import_file = PMA_securePath($local_import_file);
$import_file = PMA_userDir($cfg['UploadDir']) . $local_import_file;
} elseif (empty($import_file) || !is_uploaded_file($import_file)) {
$import_file = 'none';
}
// Do we have file to import?
if ($import_file != 'none' && !$error) {
// work around open_basedir and other limitations
$open_basedir = @ini_get('open_basedir');
// If we are on a server with open_basedir, we must move the file
// before opening it. The doc explains how to create the "./tmp"
// directory
if (!empty($open_basedir)) {
$tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : './tmp/');
// function is_writeable() is valid on PHP3 and 4
if (is_writeable($tmp_subdir)) {
$import_file_new = $tmp_subdir . basename($import_file);
if (move_uploaded_file($import_file, $import_file_new)) {
$import_file = $import_file_new;
$file_to_unlink = $import_file_new;
}
}
}
// Handle file compression
$compression = PMA_detectCompression($import_file);
if ($compression === FALSE) {
$message = $strFileCouldNotBeRead;
$show_error_header = TRUE;
$error = TRUE;
} else {
switch ($compression) {
case 'application/bzip2':
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
$import_handle = @bzopen($import_file, 'r');
} else {
$message = sprintf($strUnsupportedCompressionDetected, $compression);
$show_error_header = TRUE;
$error = TRUE;
}
break;
case 'application/gzip':
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
$import_handle = @gzopen($import_file, 'r');
} else {
$message = sprintf($strUnsupportedCompressionDetected, $compression);
$show_error_header = TRUE;
$error = TRUE;
}
break;
case 'application/zip':
if ($cfg['GZipDump'] && @function_exists('gzinflate')) {
include_once('./libraries/unzip.lib.php');
$import_handle = new SimpleUnzip();
$import_handle->ReadFile($import_file);
if ($import_handle->Count() == 0) {
$message = $strNoFilesFoundInZip;
$show_error_header = TRUE;
$error = TRUE;
} elseif ($import_handle->GetError(0) != 0) {
$message = $strErrorInZipFile . ' ' . $import_handle->GetErrorMsg(0);
$show_error_header = TRUE;
$error = TRUE;
} else {
$import_text = $import_handle->GetData(0);
}
// We don't need to store it further
$import_handle = '';
} else {
$message = sprintf($strUnsupportedCompressionDetected, $compression);
$show_error_header = TRUE;
$error = TRUE;
}
break;
case 'none':
$import_handle = @fopen($import_file, 'r');
break;
default:
$message = sprintf($strUnsupportedCompressionDetected, $compression);
$show_error_header = TRUE;
$error = TRUE;
break;
}
}
if (!$error && $import_handle === FALSE) {
$message = $strFileCouldNotBeRead;
$show_error_header = TRUE;
$error = TRUE;
}
} elseif (!$error) {
if (!isset($import_text) || empty($import_text)) {
$message = $strNoDataReceived;
$show_error_header = TRUE;
$error = TRUE;
}
}
// Convert the file's charset if necessary
if ($cfg['AllowAnywhereRecoding'] && $allow_recoding
&& isset($charset_of_file)) {
if ($charset_of_file != $charset) {
$charset_conversion = TRUE;
}
} elseif (PMA_MYSQL_INT_VERSION >= 40100
&& isset($charset_of_file) && $charset_of_file != 'utf8') {
PMA_DBI_query('SET NAMES \'' . $charset_of_file . '\'');
// We can not show query in this case, it is in different charset
$sql_query_disabled = TRUE;
$reset_charset = TRUE;
}
// Something to skip?
if (!$error && isset($skip)) {
$original_skip = $skip;
while ($skip > 0) {
PMA_importGetNextChunk($skip < $read_limit ? $skip : $read_limit);
$read_multiply = 1; // Disable read progresivity, otherwise we eat all memory!
$skip -= $read_limit;
}
unset($skip);
}
if (!$error) {
// Check for file existance
if (!file_exists('./libraries/import/' . $format . '.php')) {
$error = TRUE;
$message = $strCanNotLoadImportPlugins;
$show_error_header = TRUE;
} else {
// Do the real import
$plugin_param = $import_type;
require('./libraries/import/' . $format . '.php');
}
}
// Cleanup temporary file
if ($file_to_unlink != '') {
unlink($file_to_unlink);
}
// Reset charset back, if we did some changes
if ($reset_charset) {
PMA_DBI_query('SET CHARACTER SET utf8');
PMA_DBI_query('SET SESSION collation_connection =\'' . $collation_connection . '\'');
}
// Show correct message
if (!empty($id_bookmark) && $action_bookmark == 2) {
$message = $strBookmarkDeleted;
$display_query = $import_text;
$error = FALSE; // unset error marker, it was used just to skip processing
} elseif (!empty($id_bookmark) && $action_bookmark == 1) {
$message = $strShowingBookmark;
} elseif ($bookmark_created) {
$special_message = '[br]' . sprintf($strBookmarkCreated, htmlspecialchars($bkm_label));
} elseif ($finished && !$error) {
if ($import_type == 'query') {
$message = $strSuccess;
} else {
$message = sprintf($strImportSuccessfullyFinished, $executed_queries);
}
}
// Did we hit timeout? Tell it user.
if ($timeout_passed) {
$message = $strTimeoutPassed;
if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) {
$message .= ' ' . $strTimeoutNothingParsed;
}
}
// Parse and analyze the query, for correct db and table name
// in case of a query typed in the query window
require_once('./libraries/parse_analyze.lib.php');
// There was an error?
if (isset($my_die)) {
foreach ($my_die AS $key => $die) {
PMA_mysqlDie($die['error'], $die['sql'], '', $err_url, $error);
}
}
if ($go_sql) {
if (isset($_GET['pos'])) {
// comes from the Refresh link
$pos = $_GET['pos'];
} else {
// Set pos to zero to possibly append limit
$pos = 0;
}
require('./sql.php');
} else {
$active_page = $goto;
require('./' . $goto);
}
exit();
?>

View File

@ -0,0 +1,175 @@
<?php
/* $Id: index.php 9832 2007-01-09 09:50:49Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* forms frameset
*
* @uses libraries/common.lib.php global fnctions
* @uses libraries/relation.lib.php table relations
* @uses $GLOBALS['strNoFrames']
* @uses $GLOBALS['cfg']['QueryHistoryDB']
* @uses $GLOBALS['cfg']['Server']['user']
* @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe
* @uses $GLOBALS['cfg']['DefaultTabDatabase'] as src for the mainframe
* @uses $GLOBALS['cfg']['NaviWidth'] for navi frame width
* @uses $GLOBALS['collation_connection'] from $_REQUEST (grab_globals.lib.php)
* or common.lib.php
* @uses $GLOBALS['available_languages'] from common.lib.php (select_lang.lib.php)
* @uses $GLOBALS['db']
* @uses $GLOBALS['charset']
* @uses $GLOBALS['lang']
* @uses $GLOBALS['text_dir']
* @uses $_ENV['HTTP_HOST']
* @uses PMA_getRelationsParam()
* @uses PMA_purgeHistory()
* @uses PMA_generate_common_url()
* @uses PMA_VERSION
* @uses session_write_close()
* @uses time()
* @uses PMA_getenv()
* @uses header() to send charset
*/
/**
* Gets core libraries and defines some variables
*/
require_once './libraries/common.lib.php';
/**
* Includes the ThemeManager if it hasn't been included yet
*/
require_once './libraries/relation.lib.php';
// free the session file, for the other frames to be loaded
session_write_close();
// Gets the host name
// loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
if (empty($HTTP_HOST)) {
if (PMA_getenv('HTTP_HOST')) {
$HTTP_HOST = PMA_getenv('HTTP_HOST');
} else {
$HTTP_HOST = '';
}
}
// purge querywindow history
$cfgRelation = PMA_getRelationsParam();
if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
PMA_purgeHistory( $GLOBALS['cfg']['Server']['user'] );
}
unset($cfgRelation);
/**
* pass variables to child pages
*/
$drops = array('lang', 'server', 'convcharset', 'collation_connection',
'db', 'table');
foreach ($drops as $each_drop) {
if (! array_key_exists($each_drop, $_GET)) {
unset($_GET[$each_drop]);
}
}
unset($drops, $each_drop);
if (! isset($GLOBALS['db']) || ! strlen($GLOBALS['db'])) {
$main_target = $GLOBALS['cfg']['DefaultTabServer'];
} elseif (! isset($GLOBALS['table']) || ! strlen($GLOBALS['table'])) {
$_GET['db'] = $GLOBALS['db'];
$main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
} else {
$_GET['db'] = $GLOBALS['db'];
$_GET['table'] = $GLOBALS['table'];
$main_target = $GLOBALS['cfg']['DefaultTabTable'];
}
$url_query = PMA_generate_common_url($_GET);
if (isset($GLOBALS['target']) && is_string($GLOBALS['target']) && !empty($GLOBALS['target']) && in_array($GLOBALS['target'], $goto_whitelist)) {
$main_target = $GLOBALS['target'];
}
$main_target .= $url_query;
$lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][2];
// start output
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="<?php echo $lang_iso_code; ?>"
lang="<?php echo $lang_iso_code; ?>"
dir="<?php echo $GLOBALS['text_dir']; ?>">
<head>
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title>phpMyAdmin <?php echo PMA_VERSION; ?> -
<?php echo htmlspecialchars($HTTP_HOST); ?></title>
<meta http-equiv="Content-Type"
content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
<script type="text/javascript" language="javascript">
// <![CDATA[
// definitions used in querywindow.js
var common_query = '<?php echo PMA_escapeJsString(PMA_generate_common_url('', '', '&'));?>';
var opendb_url = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['DefaultTabDatabase']); ?>';
var safari_browser = <?php echo PMA_USR_BROWSER_AGENT == 'SAFARI' ? 'true' : 'false' ?>;
var querywindow_height = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowHeight']); ?>;
var querywindow_width = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowWidth']); ?>;
var collation_connection = '<?php echo PMA_escapeJsString($GLOBALS['collation_connection']); ?>';
var lang = '<?php echo PMA_escapeJsString($GLOBALS['lang']); ?>';
var server = '<?php echo PMA_escapeJsString($GLOBALS['server']); ?>';
var table = '<?php echo PMA_escapeJsString($GLOBALS['table']); ?>';
var db = '<?php echo PMA_escapeJsString($GLOBALS['db']); ?>';
var text_dir = '<?php echo PMA_escapeJsString($GLOBALS['text_dir']); ?>';
var pma_absolute_uri = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['PmaAbsoluteUri']); ?>';
// ]]>
</script>
<script src="./js/querywindow.js" type="text/javascript" language="javascript">
</script>
</head>
<frameset cols="<?php
if ($GLOBALS['text_dir'] === 'rtl') {
echo '*,';
}
echo $GLOBALS['cfg']['NaviWidth'];
if ($GLOBALS['text_dir'] === 'ltr') {
echo ',*';
}
?>" rows="*" id="mainFrameset">
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
<frame frameborder="0" id="frame_navigation"
src="navigation.php<?php echo $url_query; ?>"
name="frame_navigation" />
<?php } ?>
<frame frameborder="0" id="frame_content"
src="<?php echo $main_target; ?>"
name="frame_content" />
<?php if ($GLOBALS['text_dir'] === 'rtl') { ?>
<frame frameborder="0" id="frame_navigation"
src="navigation.php<?php echo $url_query; ?>"
name="frame_navigation" />
<?php } ?>
<noframes>
<body>
<p><?php echo $GLOBALS['strNoFrames']; ?></p>
</body>
</noframes>
</frameset>
<script type="text/javascript" language="javascript">
// <![CDATA[
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
var frame_content = window.frames[1];
var frame_navigation = window.frames[0];
<?php } else { ?>
var frame_content = window.frames[0];
var frame_navigation = window.frames[1];
<?php } ?>
// ]]>
</script>
</html>

View File

@ -0,0 +1,121 @@
/**************************************************
* dom-drag.js
* 09.25.2001
* www.youngpup.net
**************************************************
* 10.28.2001 - fixed minor bug where events
* sometimes fired off the handle, not the root.
**************************************************/
var Drag = {
obj : null,
init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
{
o.onmousedown = Drag.start;
o.hmode = bSwapHorzRef ? false : true ;
o.vmode = bSwapVertRef ? false : true ;
o.root = oRoot && oRoot != null ? oRoot : o ;
if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px";
if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px";
if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px";
if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
o.minX = typeof minX != 'undefined' ? minX : null;
o.minY = typeof minY != 'undefined' ? minY : null;
o.maxX = typeof maxX != 'undefined' ? maxX : null;
o.maxY = typeof maxY != 'undefined' ? maxY : null;
o.xMapper = fXMapper ? fXMapper : null;
o.yMapper = fYMapper ? fYMapper : null;
o.root.onDragStart = new Function();
o.root.onDragEnd = new Function();
o.root.onDrag = new Function();
},
start : function(e)
{
var o = Drag.obj = this;
e = Drag.fixE(e);
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
o.root.onDragStart(x, y);
o.lastMouseX = e.clientX;
o.lastMouseY = e.clientY;
if (o.hmode) {
if (o.minX != null) o.minMouseX = e.clientX - x + o.minX;
if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX;
} else {
if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
}
if (o.vmode) {
if (o.minY != null) o.minMouseY = e.clientY - y + o.minY;
if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY;
} else {
if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
}
document.onmousemove = Drag.drag;
document.onmouseup = Drag.end;
return false;
},
drag : function(e)
{
e = Drag.fixE(e);
var o = Drag.obj;
var ey = e.clientY;
var ex = e.clientX;
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
var nx, ny;
if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
if (o.xMapper) nx = o.xMapper(y)
else if (o.yMapper) ny = o.yMapper(x)
Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
Drag.obj.lastMouseX = ex;
Drag.obj.lastMouseY = ey;
Drag.obj.root.onDrag(nx, ny);
return false;
},
end : function()
{
document.onmousemove = null;
document.onmouseup = null;
Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),
parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
Drag.obj = null;
},
fixE : function(e)
{
if (typeof e == 'undefined') e = window.event;
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
return e;
}
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
/* $Id: indexes.js 7886 2005-11-23 19:10:30Z nijel $ */
/**
* Ensures a value submitted in a form is numeric and is in a range
*
* @param object the form
* @param string the name of the form field to check
* @param integer the minimum authorized value
* @param integer the maximum authorized value
*
* @return boolean whether a valid number has been submitted or not
*/
function checkFormElementInRange(theForm, theFieldName, message, min, max)
{
var theField = theForm.elements[theFieldName];
var val = parseInt(theField.value);
if (typeof(min) == 'undefined') {
min = 0;
}
if (typeof(max) == 'undefined') {
max = Number.MAX_VALUE;
}
// It's not a number
if (isNaN(val)) {
theField.select();
alert(errorMsg1);
theField.focus();
return false;
}
// It's a number but it is not between min and max
else if (val < min || val > max) {
theField.select();
alert(message.replace('%d', val));
theField.focus();
return false;
}
// It's a valid number
else {
theField.value = val;
}
return true;
} // end of the 'checkFormElementInRange()' function
/**
* Ensures indexes names are valid according to their type and, for a primary
* key, lock index name to 'PRIMARY'
*
* @return boolean false if there is no index form, true else
*/
function checkIndexName()
{
if (typeof(document.forms['index_frm']) == 'undefined') {
return false;
}
// Gets the elements pointers
var the_idx_name = document.forms['index_frm'].elements['index'];
var the_idx_type = document.forms['index_frm'].elements['index_type'];
// Index is a primary key
if (the_idx_type.options[0].value == 'PRIMARY' && the_idx_type.options[0].selected) {
document.forms['index_frm'].elements['index'].value = 'PRIMARY';
if (typeof(the_idx_name.disabled) != 'undefined') {
document.forms['index_frm'].elements['index'].disabled = true;
}
}
// Other cases
else {
if (the_idx_name.value == 'PRIMARY') {
document.forms['index_frm'].elements['index'].value = '';
}
if (typeof(the_idx_name.disabled) != 'undefined') {
document.forms['index_frm'].elements['index'].disabled = false;
}
}
return true;
} // end of the 'checkIndexName()' function
onload = checkIndexName;

View File

@ -0,0 +1,59 @@
/**
* Allows moving around inputs/select by Ctrl+arrows
*
* @param object event data
*/
function onKeyDownArrowsHandler(e) {
e = e||window.event;
var o = (e.srcElement||e.target);
if (!o) return;
if (o.tagName != "TEXTAREA" && o.tagName != "INPUT" && o.tagName != "SELECT") return;
if (navigator.userAgent.toLowerCase().indexOf('applewebkit/') != -1) {
if (e.ctrlKey || e.shiftKey || !e.altKey) return;
} else {
if (!e.ctrlKey || e.shiftKey || e.altKey) return;
}
if (!o.id) return;
var pos = o.id.split("_");
if (pos[0] != "field" || typeof pos[2] == "undefined") return;
var x = pos[2], y=pos[1];
// skip non existent fields
for (i=0; i<10; i++)
{
if (switch_movement) {
switch(e.keyCode) {
case 38: x--; break; // up
case 40: x++; break; // down
case 37: y--; break; // left
case 39: y++; break; // right
default: return;
}
} else {
switch(e.keyCode) {
case 38: y--; break; // up
case 40: y++; break; // down
case 37: x--; break; // left
case 39: x++; break; // right
default: return;
}
}
var id = "field_" + y + "_" + x;
var nO = document.getElementById(id);
if (!nO) {
var id = "field_" + y + "_" + x + "_0";
var nO = document.getElementById(id);
}
if (nO) break;
}
if (!nO) return;
nO.focus();
if (nO.tagName != 'SELECT') {
nO.select();
}
e.returnValue = false;
}

View File

@ -0,0 +1,130 @@
// vim: expandtab sw=4 ts=4 sts=4:
var today = new Date();
var expires = new Date(today.getTime() + (56 * 86400000));
var pma_navi_width;
var pma_saveframesize_timeout = null;
/**
* opens/closes (hides/shows) tree elements
*
* @param string id id of the element in the DOM
* @param boolean only_open do not close/hide element
*/
function toggle(id, only_open) {
var el = document.getElementById('subel' + id);
if (! el) {
return false;
}
var img = document.getElementById('el' + id + 'Img');
if (el.style.display == 'none' || only_open) {
el.style.display = '';
if (img) {
img.src = image_minus;
img.alt = '-';
}
} else {
el.style.display = 'none';
if (img) {
img.src = image_plus;
img.alt = '+';
}
}
return true;
}
function PMA_callFunctionDelayed(myfunction, delay)
{
if (typeof pma_saveframesize_timeout == "number") {
window.clearTimeout(pma_saveframesize_timeout);
pma_saveframesize_timeout = null;
}
}
/**
* saves current navigation frame width in a cookie
* usally called on resize of the navigation frame
*/
function PMA_saveFrameSizeReal()
{
pma_navi_width = document.getElementById('body_leftFrame').offsetWidth
//alert('from DOM: ' + typeof(pma_navi_width) + ' : ' + pma_navi_width);
if (pma_navi_width > 0) {
PMA_setCookie('pma_navi_width', pma_navi_width, expires);
//alert('framesize saved');
}
}
/**
* calls PMA_saveFrameSizeReal with delay
*/
function PMA_saveFrameSize()
{
//alert(typeof(pma_saveframesize_timeout) + ' : ' + pma_saveframesize_timeout);
if (typeof pma_saveframesize_timeout == "number") {
window.clearTimeout(pma_saveframesize_timeout);
pma_saveframesize_timeout = null;
}
pma_saveframesize_timeout = window.setTimeout(PMA_saveFrameSizeReal, 2000);
}
/**
* sets navigation frame width to the value stored in the cookie
* usally called on document load
*/
function PMA_setFrameSize()
{
pma_navi_width = PMA_getCookie('pma_navi_width');
//alert('from cookie: ' + typeof(pma_navi_width) + ' : ' + pma_navi_width);
if (pma_navi_width != null) {
if (parent.text_dir == 'ltr') {
parent.document.getElementById('mainFrameset').cols = pma_navi_width + ',*';
} else {
parent.document.getElementById('mainFrameset').cols = '*,' + pma_navi_width;
}
//alert('framesize set');
}
}
/**
* retrieves a named value from cookie
*
* @param string name name of the value to retrieve
* @return string value value for the given name from cookie
*/
function PMA_getCookie(name) {
var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
if ((!start) && (name != document.cookie.substring(0, name.length))) {
return null;
}
if (start == -1) {
return null;
}
var end = document.cookie.indexOf(";", len);
if (end == -1) {
end = document.cookie.length;
}
return unescape(document.cookie.substring(len,end));
}
/**
* stores a named value into cookie
*
* @param string name name of value
* @param string value value to be stored
* @param Date expires expire time
* @param string path
* @param string domain
* @param boolean secure
*/
function PMA_setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
( (secure) ? ";secure" : "");
}

View File

@ -0,0 +1,340 @@
/**
* holds the browser query window
*/
var querywindow = '';
/**
* holds the query to be load from a new query window
*/
var query_to_load = '';
/**
* sets current selected db
*
* @param string db name
*/
function setDb(new_db) {
//alert('setDb(' + new_db + ')');
if (new_db != db) {
// db has changed
//alert( new_db + '(' + new_db.length + ') : ' + db );
var old_db = db;
db = new_db;
if (window.frame_navigation.document.getElementById(db) == null) {
// db is unknown, reload complete left frame
refreshNavigation();
} else {
unmarkDbTable(old_db);
markDbTable(db);
}
// TODO: add code to expand db in lightview mode
// refresh querywindow
refreshQuerywindow();
}
}
/**
* sets current selected table (called from navigation.php)
*
* @param string table name
*/
function setTable(new_table) {
//alert('setTable(' + new_table + ')');
if (new_table != table) {
// table has changed
//alert( new_table + '(' + new_table.length + ') : ' + table );
table = new_table;
if (window.frame_navigation.document.getElementById(db + '.' + table) == null
&& table != '') {
// table is unknown, reload complete left frame
refreshNavigation();
}
// TODO: add code to expand table in lightview mode
// refresh querywindow
refreshQuerywindow();
}
}
function refreshMain(url) {
if (! url) {
if (db) {
url = opendb_url;
} else {
url = 'main.php';
}
}
goTo(url + '?server=' + encodeURIComponent(server) +
'&db=' + encodeURIComponent(db) +
'&table=' + encodeURIComponent(table) +
'&lang=' + encodeURIComponent(lang) +
'&collation_connection=' + encodeURIComponent(collation_connection),
'main' );
}
function refreshNavigation() {
goTo('navigation.php?server=' + encodeURIComponent(server) +
'&db=' + encodeURIComponent(db) +
'&table=' + encodeURIComponent(table) +
'&lang=' + encodeURIComponent(lang) +
'&collation_connection=' + encodeURIComponent(collation_connection)
);
}
/**
* adds class to element
*/
function addClass(element, classname)
{
if (element != null) {
element.className += ' ' + classname;
//alert('set class: ' + classname + ', now: ' + element.className);
}
}
/**
* removes class from element
*/
function removeClass(element, classname)
{
if (element != null) {
element.className = element.className.replace(' ' + classname, '');
// if there is no other class anem there is no leading space
element.className = element.className.replace(classname, '');
//alert('removed class: ' + classname + ', now: ' + element.className);
}
}
function unmarkDbTable(db, table)
{
var element_reference = window.frame_navigation.document.getElementById(db);
if (element_reference != null) {
//alert('remove from: ' + db);
removeClass(element_reference.parentNode, 'marked');
}
element_reference = window.frame_navigation.document.getElementById(db + '.' + table);
if (element_reference != null) {
//alert('remove from: ' + db + '.' + table);
removeClass(element_reference.parentNode, 'marked');
}
}
function markDbTable(db, table)
{
var element_reference = window.frame_navigation.document.getElementById(db);
if (element_reference != null) {
addClass(element_reference.parentNode, 'marked');
// scrolldown
element_reference.focus();
// opera marks the text, we dont want this ...
element_reference.blur();
}
element_reference = window.frame_navigation.document.getElementById(db + '.' + table);
if (element_reference != null) {
addClass(element_reference.parentNode, 'marked');
// scrolldown
element_reference.focus();
// opera marks the text, we dont want this ...
element_reference.blur();
}
// return to main frame ...
window.frame_content.focus();
}
/**
* sets current selected server, table and db (called from libraries/footer.inc.php)
*/
function setAll( new_lang, new_collation_connection, new_server, new_db, new_table ) {
//alert('setAll( ' + new_lang + ', ' + new_collation_connection + ', ' + new_server + ', ' + new_db + ', ' + new_table + ' )');
if (new_server != server || new_lang != lang
|| new_collation_connection != collation_connection) {
// something important has changed
server = new_server;
db = new_db;
table = new_table;
collation_connection = new_collation_connection;
lang = new_lang;
refreshNavigation();
} else if (new_db != db || new_table != table) {
// save new db and table
var old_db = db;
var old_table = table;
db = new_db;
table = new_table;
if (window.frame_navigation.document.getElementById(db) == null
&& window.frame_navigation.document.getElementById(db + '.' + table) == null ) {
// table or db is unknown, reload complete left frame
refreshNavigation();
} else {
unmarkDbTable(old_db, old_table);
markDbTable(db, table);
}
// TODO: add code to expand db in lightview mode
// refresh querywindow
refreshQuerywindow();
}
}
function reload_querywindow( db, table, sql_query ) {
if ( ! querywindow.closed && querywindow.location ) {
if ( ! querywindow.document.sqlform.LockFromUpdate
|| ! querywindow.document.sqlform.LockFromUpdate.checked ) {
querywindow.document.querywindow.db.value = db;
querywindow.document.querywindow.query_history_latest_db.value = db;
querywindow.document.querywindow.table.value = table;
querywindow.document.querywindow.query_history_latest_table.value = table;
if ( sql_query ) {
querywindow.document.querywindow.query_history_latest.value = sql_query;
}
querywindow.document.querywindow.submit();
}
}
}
/**
* brings query window to front and inserts query to be edited
*/
function focus_querywindow( sql_query ) {
/* if ( querywindow && !querywindow.closed && querywindow.location) { */
if ( !querywindow || querywindow.closed || !querywindow.location) {
// we need first to open the window and cannot pass the query with it
// as we dont know if the query exceeds max url length
/* url = 'querywindow.php?' + common_query + '&db=' + db + '&table=' + table + '&sql_query=SELECT * FROM'; */
query_to_load = sql_query;
open_querywindow();
insertQuery(0);
} else {
//var querywindow = querywindow;
if ( querywindow.document.querywindow.querydisplay_tab != 'sql' ) {
querywindow.document.querywindow.querydisplay_tab.value = "sql";
querywindow.document.querywindow.query_history_latest.value = sql_query;
querywindow.document.querywindow.submit();
querywindow.focus();
} else {
querywindow.focus();
}
}
return true;
}
/**
* inserts query string into query window textarea
* called from script tag in querywindow
*/
function insertQuery() {
if (query_to_load != '' && querywindow.document && querywindow.document.getElementById && querywindow.document.getElementById('sqlquery')) {
querywindow.document.getElementById('sqlquery').value = query_to_load;
query_to_load = '';
return true;
}
return false;
}
function open_querywindow( url ) {
if ( ! url ) {
url = 'querywindow.php?' + common_query + '&db=' + encodeURIComponent(db) + '&table=' + encodeURIComponent(table);
}
if (!querywindow.closed && querywindow.location) {
goTo( url, 'query' );
querywindow.focus();
} else {
querywindow=window.open( url, '',
'toolbar=0,location=0,directories=0,status=1,menubar=0,' +
'scrollbars=yes,resizable=yes,' +
'width=' + querywindow_width + ',' +
'height=' + querywindow_height );
}
if ( ! querywindow.opener ) {
querywindow.opener = window.window;
}
if ( window.focus ) {
querywindow.focus();
}
return true;
}
function refreshQuerywindow( url ) {
if ( ! querywindow.closed && querywindow.location ) {
if ( ! querywindow.document.sqlform.LockFromUpdate
|| ! querywindow.document.sqlform.LockFromUpdate.checked ) {
open_querywindow( url )
}
}
}
/**
* opens new url in target frame, with default beeing left frame
* valid is 'main' and 'querywindow' all others leads to 'left'
*
* @param string targeturl new url to load
* @param string target frame where to load the new url
*/
function goTo(targeturl, target) {
//alert('goto');
if ( target == 'main' ) {
target = window.frame_content;
} else if ( target == 'query' ) {
target = querywindow;
//return open_querywindow( targeturl );
} else if ( ! target ) {
target = window.frame_navigation;
}
if ( target ) {
if ( target.location.href == targeturl ) {
return true;
} else if ( target.location.href == pma_absolute_uri + targeturl ) {
return true;
}
if ( safari_browser ) {
target.location.href = targeturl;
} else {
target.location.replace(targeturl);
}
}
return true;
}
// opens selected db in main frame
function openDb(new_db) {
//alert('opendb(' + new_db + ')');
setDb(new_db);
setTable('');
refreshMain(opendb_url);
return true;
}
function updateTableTitle( table_link_id, new_title ) {
//alert('updateTableTitle');
if ( window.parent.frame_navigation.document.getElementById(table_link_id) ) {
var left = window.parent.frame_navigation.document;
left.getElementById(table_link_id).title = new_title;
new_title = left.getElementById('icon_' + table_link_id).alt + ': ' + new_title;
left.getElementById('browse_' + table_link_id).title = new_title;
return true;
}
return false;
}

View File

@ -0,0 +1,93 @@
/* $Id: server_privileges.js 7886 2005-11-23 19:10:30Z nijel $ */
/**
* Validates the password field in a form
*
* @param object the form
*
* @return boolean whether the field value is valid or not
*/
function checkPassword(the_form)
{
// Did the user select 'no password'?
if (typeof(the_form.elements['nopass']) != 'undefined' && the_form.elements['nopass'][0].checked) {
return true;
} else if (typeof(the_form.elements['pred_password']) != 'undefined' && (the_form.elements['pred_password'].value == 'none' || the_form.elements['pred_password'].value == 'keep')) {
return true;
}
// Validates
if (the_form.elements['pma_pw'].value == '') {
alert(jsPasswordEmpty);
the_form.elements['pma_pw2'].value = '';
the_form.elements['pma_pw'].focus();
return false;
} else if (the_form.elements['pma_pw'].value != the_form.elements['pma_pw2'].value) {
alert(jsPasswordNotSame);
the_form.elements['pma_pw'].value = '';
the_form.elements['pma_pw2'].value = '';
the_form.elements['pma_pw'].focus();
return false;
} // end if...else if
return true;
} // end of the 'checkPassword()' function
/**
* Validates the "add a user" form
*
* @return boolean whether the form is validated or not
*/
function checkAddUser(the_form)
{
if (the_form.elements['pred_hostname'].value == 'userdefined' && the_form.elements['hostname'].value == '') {
alert(jsHostEmpty);
the_form.elements['hostname'].focus();
return false;
}
if (the_form.elements['pred_username'].value == 'userdefined' && the_form.elements['username'].value == '') {
alert(jsUserEmpty);
the_form.elements['username'].focus();
return false;
}
return checkPassword(the_form);
} // end of the 'checkAddUser()' function
/**
* Generate a new password, which may then be copied to the form
* with suggestPasswordCopy().
*
* @param string the form name
*
* @return boolean always true
*/
function suggestPassword() {
var pwchars = "abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ.,:";
var passwordlength = 16; // do we want that to be dynamic? no, keep it simple :)
var passwd = document.getElementById('generated_pw');
passwd.value = '';
for ( i = 0; i < passwordlength; i++ ) {
passwd.value += pwchars.charAt( Math.floor( Math.random() * pwchars.length ) )
}
return passwd.value;
}
/**
* Copy the generated password (or anything in the field) to the form
*
* @param string the form name
*
* @return boolean always true
*/
function suggestPasswordCopy() {
document.getElementById('text_pma_pw').value = document.getElementById('generated_pw').value;
document.getElementById('text_pma_pw2').value = document.getElementById('generated_pw').value;
return true;
}

View File

@ -0,0 +1,339 @@
/* $Id: tbl_change.js 7886 2005-11-23 19:10:30Z nijel $ */
/**
* Modify from controls when the "NULL" checkbox is selected
*
* @param string the MySQL field type
* @param string the urlencoded field name
* @param string the md5 hashed field name
*
* @return boolean always true
*/
function nullify(theType, urlField, md5Field, multi_edit)
{
var rowForm = document.forms['insertForm'];
if (typeof(rowForm.elements['funcs' + multi_edit + '[' + urlField + ']']) != 'undefined') {
rowForm.elements['funcs' + multi_edit + '[' + urlField + ']'].selectedIndex = -1;
}
// "SET" field , "ENUM" field with more than 20 characters
// or foreign key field
if (theType == 1 || theType == 3 || theType == 4) {
rowForm.elements['field_' + md5Field + multi_edit + '[]'].selectedIndex = -1;
}
// Other "ENUM" field
else if (theType == 2) {
var elts = rowForm.elements['field_' + md5Field + multi_edit + '[]'];
// when there is just one option in ENUM:
if (elts.checked) {
elts.checked = false;
} else {
var elts_cnt = elts.length;
for (var i = 0; i < elts_cnt; i++ ) {
elts[i].checked = false;
} // end for
} // end if
}
// Other field types
else /*if (theType == 5)*/ {
rowForm.elements['fields' + multi_edit + '[' + urlField + ']'].value = '';
} // end if... else if... else
return true;
} // end of the 'nullify()' function
/**
* Unchecks the "NULL" control when a function has been selected or a value
* entered
*
* @param string the urlencoded field name
*
* @return boolean always true
*/
function unNullify(urlField, multi_edit)
{
var rowForm = document.forms['insertForm'];
if (typeof(rowForm.elements['fields_null[multi_edit][' + multi_edit + '][' + urlField + ']']) != 'undefined') {
rowForm.elements['fields_null[multi_edit][' + multi_edit + '][' + urlField + ']'].checked = false
} // end if
if (typeof(rowForm.elements['insert_ignore_' + multi_edit]) != 'undefined') {
rowForm.elements['insert_ignore_' + multi_edit].checked = false
} // end if
return true;
} // end of the 'unNullify()' function
var day;
var month;
var year;
var hour;
var minute;
var second;
var clock_set = 0;
/**
* Opens calendar window.
*
* @param string calendar.php parameters
* @param string form name
* @param string field name
* @param string edit type - date/timestamp
*/
function openCalendar(params, form, field, type) {
window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
dateField = eval("document." + form + "." + field);
dateType = type;
}
/**
* Formats number to two digits.
*
* @param int number to format.
* @param string type of number
*/
function formatNum2(i, valtype) {
f = (i < 10 ? '0' : '') + i;
if (valtype && valtype != '') {
switch(valtype) {
case 'month':
f = (f > 12 ? 12 : f);
break;
case 'day':
f = (f > 31 ? 31 : f);
break;
case 'hour':
f = (f > 24 ? 24 : f);
break;
default:
case 'second':
case 'minute':
f = (f > 59 ? 59 : f);
break;
}
}
return f;
}
/**
* Formats number to two digits.
*
* @param int number to format.
* @param int default value
* @param string type of number
*/
function formatNum2d(i, default_v, valtype) {
i = parseInt(i, 10);
if (isNaN(i)) return default_v;
return formatNum2(i, valtype)
}
/**
* Formats number to four digits.
*
* @param int number to format.
*/
function formatNum4(i) {
i = parseInt(i, 10)
return (i < 1000 ? i < 100 ? i < 10 ? '000' : '00' : '0' : '') + i;
}
/**
* Initializes calendar window.
*/
function initCalendar() {
if (!year && !month && !day) {
/* Called for first time */
if (window.opener.dateField.value) {
value = window.opener.dateField.value;
if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') {
if (window.opener.dateType == 'datetime') {
parts = value.split(' ');
value = parts[0];
if (parts[1]) {
time = parts[1].split(':');
hour = parseInt(time[0],10);
minute = parseInt(time[1],10);
second = parseInt(time[2],10);
}
}
date = value.split("-");
day = parseInt(date[2],10);
month = parseInt(date[1],10) - 1;
year = parseInt(date[0],10);
} else {
year = parseInt(value.substr(0,4),10);
month = parseInt(value.substr(4,2),10) - 1;
day = parseInt(value.substr(6,2),10);
hour = parseInt(value.substr(8,2),10);
minute = parseInt(value.substr(10,2),10);
second = parseInt(value.substr(12,2),10);
}
}
if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
dt = new Date();
year = dt.getFullYear();
month = dt.getMonth();
day = dt.getDate();
}
if (isNaN(hour) || isNaN(minute) || isNaN(second)) {
dt = new Date();
hour = dt.getHours();
minute = dt.getMinutes();
second = dt.getSeconds();
}
} else {
/* Moving in calendar */
if (month > 11) {
month = 0;
year++;
}
if (month < 0) {
month = 11;
year--;
}
}
if (document.getElementById) {
cnt = document.getElementById("calendar_data");
} else if (document.all) {
cnt = document.all["calendar_data"];
}
cnt.innerHTML = "";
str = ""
//heading table
str += '<table class="calendar"><tr><th width="50%">';
str += '<form method="NONE" onsubmit="return 0">';
str += '<a href="javascript:month--; initCalendar();">&laquo;</a> ';
str += '<select id="select_month" name="monthsel" onchange="month = parseInt(document.getElementById(\'select_month\').value); initCalendar();">';
for (i =0; i < 12; i++) {
if (i == month) selected = ' selected="selected"';
else selected = '';
str += '<option value="' + i + '" ' + selected + '>' + month_names[i] + '</option>';
}
str += '</select>';
str += ' <a href="javascript:month++; initCalendar();">&raquo;</a>';
str += '</form>';
str += '</th><th width="50%">';
str += '<form method="NONE" onsubmit="return 0">';
str += '<a href="javascript:year--; initCalendar();">&laquo;</a> ';
str += '<select id="select_year" name="yearsel" onchange="year = parseInt(document.getElementById(\'select_year\').value); initCalendar();">';
for (i = year - 25; i < year + 25; i++) {
if (i == year) selected = ' selected="selected"';
else selected = '';
str += '<option value="' + i + '" ' + selected + '>' + i + '</option>';
}
str += '</select>';
str += ' <a href="javascript:year++; initCalendar();">&raquo;</a>';
str += '</form>';
str += '</th></tr></table>';
str += '<table class="calendar"><tr>';
for (i = 0; i < 7; i++) {
str += "<th>" + day_names[i] + "</th>";
}
str += "</tr>";
var firstDay = new Date(year, month, 1).getDay();
var lastDay = new Date(year, month + 1, 0).getDate();
str += "<tr>";
dayInWeek = 0;
for (i = 0; i < firstDay; i++) {
str += "<td>&nbsp;</td>";
dayInWeek++;
}
for (i = 1; i <= lastDay; i++) {
if (dayInWeek == 7) {
str += "</tr><tr>";
dayInWeek = 0;
}
dispmonth = 1 + month;
if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') {
actVal = "" + formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day');
} else {
actVal = "" + formatNum4(year) + formatNum2(dispmonth, 'month') + formatNum2(i, 'day');
}
if (i == day) {
style = ' class="selected"';
current_date = actVal;
} else {
style = '';
}
str += "<td" + style + "><a href=\"javascript:returnDate('" + actVal + "');\">" + i + "</a></td>"
dayInWeek++;
}
for (i = dayInWeek; i < 7; i++) {
str += "<td>&nbsp;</td>";
}
str += "</tr></table>";
cnt.innerHTML = str;
// Should we handle time also?
if (window.opener.dateType != 'date' && !clock_set) {
if (document.getElementById) {
cnt = document.getElementById("clock_data");
} else if (document.all) {
cnt = document.all["clock_data"];
}
str = '';
init_hour = hour;
init_minute = minute;
init_second = second;
str += '<form method="NONE" class="clock" onsubmit="returnDate(\'' + current_date + '\')">';
str += '<input id="hour" type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_hour, \'hour\'); init_hour = this.value;" value="' + formatNum2(hour, 'hour') + '" />:';
str += '<input id="minute" type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_minute, \'minute\'); init_minute = this.value;" value="' + formatNum2(minute, 'minute') + '" />:';
str += '<input id="second" type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_second, \'second\'); init_second = this.value;" value="' + formatNum2(second, 'second') + '" />';
str += '<br />';
str += '<input type="submit" value="' + submit_text + '"/>';
str += '</form>';
cnt.innerHTML = str;
clock_set = 1;
}
}
/**
* Returns date from calendar.
*
* @param string date text
*/
function returnDate(d) {
txt = d;
if (window.opener.dateType != 'date') {
// need to get time
h = parseInt(document.getElementById('hour').value,10);
m = parseInt(document.getElementById('minute').value,10);
s = parseInt(document.getElementById('second').value,10);
if (window.opener.dateType == 'datetime') {
txt += ' ' + formatNum2(h, 'hour') + ':' + formatNum2(m, 'minute') + ':' + formatNum2(s, 'second');
} else {
// timestamp
txt += formatNum2(h, 'hour') + formatNum2(m, 'minute') + formatNum2(s, 'second');
}
}
window.opener.dateField.value = txt;
window.close();
}

View File

@ -0,0 +1,194 @@
/* $Id: tooltip.js 7886 2005-11-23 19:10:30Z nijel $ */
/**
* Displays the Tooltips (hints), if we have some
* 2005-01-20 added by Michael Keck (mkkeck)
*/
var ttXpos = 0, ttYpos = 0;
var ttXadd = 10, ttYadd = -10;
var ttDisplay = 0, ttHoldIt = 0;
// Check if browser does support dynamic content and dhtml
var ttNS4 = (document.layers) ? 1 : 0; // the old Netscape 4
var ttIE4 = (document.all) ? 1 : 0; // browser wich uses document.all
var ttDOM = (document.getElementById) ? 1 : 0; // DOM-compatible browsers
if (ttDOM) { // if DOM-compatible, set the others to false
ttNS4 = 0;
ttIE4 = 0;
}
var myTooltipContainer = null;
if ( (ttDOM) || (ttIE4) || (ttNS4) ) {
// mouse-event
if ( ttNS4 ) {
document.captureEvents(Event.MOUSEMOVE);
} else {
document.onmousemove = mouseMove;
}
}
/**
* init the tooltip and write the text into it
*
* @param string theText tooltip content
*/
function textTooltip(theText) {
if (ttDOM || ttIE4) { // document.getEelementById || document.all
myTooltipContainer.innerHTML = ""; // we should empty it first
myTooltipContainer.innerHTML = theText;
} else if (ttNS4) { // document.layers
var layerNS4 = myTooltipContainer.document;
layerNS4.write(theText);
layerNS4.close();
}
}
/**
* @var integer
*/
var ttTimerID = 0;
/**
* swap the Tooltip // show and hide
*
* @param boolean stat view status
*/
function swapTooltip(stat) {
if (ttHoldIt!=1) {
if (stat!='default') {
if (stat=='true')
showTooltip(true);
else if (stat=='false')
showTooltip(false);
} else {
if (ttDisplay)
ttTimerID = setTimeout("showTooltip(false);",500);
else
showTooltip(true);
}
} else {
if (ttTimerID) {
clearTimeout(ttTimerID);
ttTimerID = 0;
}
showTooltip(true);
}
}
/**
* show / hide the Tooltip
*
* @param boolean stat view status
*/
function showTooltip(stat) {
if (stat==false) {
if (ttNS4)
myTooltipContainer.visibility = "hide";
else
myTooltipContainer.style.visibility = "hidden";
ttDisplay = 0;
} else {
if (ttNS4)
myTooltipContainer.visibility = "show";
else
myTooltipContainer.style.visibility = "visible";
ttDisplay = 1;
}
}
/**
* hold it, if we create or move the mouse over the tooltip
*/
function holdTooltip() {
ttHoldIt = 1;
swapTooltip('true');
ttHoldIt = 0;
}
/**
* move the tooltip to mouse position
*
* @param integer posX horiz. position
* @param integer posY vert. position
*/
function moveTooltip(posX, posY) {
if (ttDOM || ttIE4) {
myTooltipContainer.style.left = posX + "px";
myTooltipContainer.style.top = posY + "px";
} else if (ttNS4) {
myTooltipContainer.left = posX;
myTooltipContainer.top = posY;
}
}
/**
* build the tooltip
*
* @param string theText tooltip content
*/
function pmaTooltip( theText ) {
// reference to TooltipContainer
if ( null == myTooltipContainer ) {
if (ttNS4) {
myTooltipContainer = document.TooltipContainer;
} else if (ttIE4) {
myTooltipContainer = document.all('TooltipContainer');
} else if (ttDOM) {
myTooltipContainer = document.getElementById('TooltipContainer');
} else {
return;
}
if ( typeof( myTooltipContainer ) == 'undefined' ) {
return;
}
}
var plusX=0, plusY=0, docX=0, docY=0;
var divHeight = myTooltipContainer.clientHeight;
var divWidth = myTooltipContainer.clientWidth;
if (navigator.appName.indexOf("Explorer")!=-1) {
if (document.documentElement && document.documentElement.scrollTop) {
plusX = document.documentElement.scrollLeft;
plusY = document.documentElement.scrollTop;
docX = document.documentElement.offsetWidth + plusX;
docY = document.documentElement.offsetHeight + plusY;
} else {
plusX = document.body.scrollLeft;
plusY = document.body.scrollTop;
docX = document.body.offsetWidth + plusX;
docY = document.body.offsetHeight + plusY;
}
} else {
docX = document.body.clientWidth;
docY = document.body.clientHeight;
}
ttXpos = ttXpos + plusX;
ttYpos = ttYpos + plusY;
if ((ttXpos + divWidth) > docX)
ttXpos = ttXpos - (divWidth + (ttXadd * 2));
if ((ttYpos + divHeight) > docY)
ttYpos = ttYpos - (divHeight + (ttYadd * 2));
textTooltip(theText);
moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd));
holdTooltip();
}
/**
* register mouse moves
*
* @param event e
*/
function mouseMove(e) {
if ( typeof( event ) != 'undefined' ) {
ttXpos = event.x;
ttYpos = event.y;
} else {
ttXpos = e.pageX;
ttYpos = e.pageY;
}
}

View File

@ -0,0 +1,192 @@
/* $Id: user_password.js 7886 2005-11-23 19:10:30Z nijel $ */
/**
* Validates the password field in a form
*
* @param object the form
*
* @return boolean whether the field value is valid or not
*/
function checkPassword(the_form)
{
// Gets the elements pointers
if (the_form.name == 'addUserForm' || the_form.name == 'chgPassword') {
var pswd_index = 1;
var pswd1_name = 'pma_pw';
var pswd2_name = 'pma_pw2';
} else {
pswd_index = 2;
pswd1_name = 'new_pw';
pswd2_name = 'new_pw2';
}
// Validates
if (the_form.elements['nopass'][pswd_index].checked) {
if (the_form.elements[pswd1_name].value == '') {
alert(jsPasswordEmpty);
the_form.elements[pswd2_name].value = '';
the_form.elements[pswd1_name].focus();
return false;
} else if (the_form.elements[pswd1_name].value != the_form.elements[pswd2_name].value) {
alert(jsPasswordNotSame);
the_form.elements[pswd1_name].value = '';
the_form.elements[pswd2_name].value = '';
the_form.elements[pswd1_name].focus();
return false;
} // end if...else if
} // end if
return true;
} // end of the 'checkPassword()' function
/**
* Validates the "add an user" form
*
* @return boolean whether the form is validated or not
*/
function checkAddUser()
{
var the_form = document.forms['addUserForm'];
if (the_form.elements['anyhost'][1].checked && the_form.elements['host'].value == '') {
alert(jsHostEmpty);
the_form.elements['host'].focus();
return false;
}
if (the_form.elements['anyuser'][1].checked && the_form.elements['pma_user'].value == '') {
alert(jsUserEmpty);
the_form.elements['pma_user'].focus();
return false;
}
return checkPassword(the_form);
} // end of the 'checkAddUser()' function
/**
* Validates the "update a profile" form
*
* @return boolean whether the form is validated or not
*/
function checkUpdProfile()
{
var the_form = document.forms['updUserForm'];
if (the_form.elements['anyhost'][1].checked && the_form.elements['new_server'].value == '') {
alert(jsHostEmpty);
the_form.elements['new_server'].focus();
return false;
}
if (the_form.elements['anyuser'][1].checked && the_form.elements['new_user'].value == '') {
alert(jsUserEmpty);
the_form.elements['new_user'].focus();
return false;
}
return checkPassword(the_form);
} // end of the 'checkUpdProfile()' function
/**
* Gets the list of selected options in combo
*
* @param object the form to check
*
* @return string the list of selected options
*/
function getSelected(the_field) {
var the_list = '';
var opts = the_field.options;
var opts_cnt = opts.length;
for (var i = 0; i < opts_cnt; i++) {
if (opts[i].selected) {
the_list += opts[i].text + ', ';
}
} // end for
return the_list.substring(0, the_list.length - 2);
} // end of the 'getSelected()' function
/**
* Reloads the page to get tables names in a database or fields names in a
* table
*
* @param object the input text box to build the query from
*/
function change(the_field) {
var l = location.href;
var lpos = l.indexOf('?lang');
var box_name = the_field.name;
var the_form = the_field.form.elements;
var sel_idx = null;
if (box_name == 'newdb') {
the_form['anydb'][0].checked = true;
the_form['anytable'][0].checked = true;
the_form['anycolumn'][0].checked = true;
if (typeof(the_form['dbgrant']) != 'undefined') {
the_form['dbgrant'].selectedIndex = -1;
}
if (typeof(the_form['tablegrant']) != 'undefined') {
the_form['tablegrant'].selectedIndex = -1;
}
if (typeof(the_form['colgrant']) != 'undefined') {
the_form['colgrant'].selectedIndex = -1;
}
}
else {
if (lpos <= 0) {
l += '?lang=' + the_form['lang'].value
+ '&convcharset=' . the_form['convcharset'].value
+ '&server=' + the_form['server'].value
+ '&grants=1'
+ '&host=' + escape(the_form['host'].value)
+ '&pma_user=' + escape(the_form['pma_user'].value);
sel_idx = the_form['dbgrant'].selectedIndex;
if (sel_idx > 0) {
l += '&dbgrant=' + escape(the_form['dbgrant'].options[sel_idx].text);
}
sel_idx = the_form['tablegrant'].selectedIndex;
if (sel_idx > 0) {
l += '&tablegrant=' + escape(the_form['tablegrant'].options[sel_idx].text);
}
}
var lpos = l.indexOf('&' + box_name);
if (lpos > 0) {
l = l.substring(0, lpos);
} // end if
location.href = l + '&' + box_name + '=' + escape(getSelected(the_field));
}
} // end of the 'change()' function
/**
* Checks/unchecks all privileges
*
* @param string the form name
* @param boolean whether to check or to uncheck the element
*
* @return boolean always true
*/
function checkForm(the_form, do_check) {
var elts = document.forms[the_form].elements;
var elts_cnt = elts.length;
for (var i = 0; i < elts_cnt; i++) {
var whichElt = elts[i].name;
if (whichElt.indexOf('_priv') >= 0) {
document.forms[the_form].elements[whichElt].checked = do_check;
} // end if
} // end for
return true;
} // end of the 'checkForm()' function

View File

@ -0,0 +1,32 @@
#!/bin/bash
# $Id: add_message.sh 9537 2006-10-12 16:27:13Z nijel $
#
# Shell script that adds a message to all message files (Lem9)
#
# Example: add_message.sh '$strNewMessage' 'new message contents'
#
if [ $# -ne 2 ] ; then
echo "usage: add_message.sh '\$strNewMessage' 'new message contents'"
exit 1
fi
for file in *.inc.php
do
echo $file " "
grep -v '?>' ${file} > ${file}.new
case $file in
english*)
echo "$1 = '"$2"';" >> ${file}.new
;;
*)
echo "$1 = '"$2"'; //to translate" >> ${file}.new
;;
esac
echo "?>" >> ${file}.new
rm $file
mv ${file}.new $file
done
./sort_lang.sh english*
echo " "
echo "Message added to all message files (including english)"

View File

@ -0,0 +1,32 @@
#!/bin/bash
# $Id: add_message_file.sh 7364 2005-09-24 08:49:52Z nijel $
#
# Shell script that adds a message file to all message files
# adding "//to translate" on each line
#
# Example: add_message_file.sh xxx
#
if [ $# -ne 1 ] ; then
echo "usage: add_message_file.sh filename"
exit 1
fi
for file in *.inc.php
do
echo $file " "
grep -v '?>' ${file} > ${file}.new
case $file in
english*)
sed -n 's/\(.*\);/\1;/p' $1 >> ${file}.new
;;
*)
sed -n 's/\(.*\);/\1; \/\/to translate/p' $1 >> ${file}.new
;;
esac
echo "?>" >> ${file}.new
rm $file
mv ${file}.new $file
done
./sort_lang.sh english*
echo " "
echo "Messages added to add message files (including english)"

View File

@ -0,0 +1,62 @@
#!/bin/sh
# $Id: check_lang.sh 9393 2006-09-08 11:28:23Z lem9 $
##
# Shell script to check that all language files are syncronized
# Catches duplicate/missing strings
#
# Robin Johnson <robbat2@users.sourceforge.net>
# August 9, 2002
##
MASTER="english-iso-8859-1.inc.php"
TMPDIR="tmp-check"
FILEPAT="*.inc.php"
STRINGMATCH='^[[:space:]]*\$[[:alnum:]_]+[[:blank:]]+='
IGNOREMATCH='strEncto|strKanjiEncodConvert|strXkana|allow_recoding|doc_lang'
if [ "`which diffstat`" = "" ] ; then
echo 'You need diffstat to use this!'
exit 1
fi
rm -rf $TMPDIR
mkdir -p $TMPDIR
# Build the list of variables in each file
echo "Building data"
for f in $FILEPAT;
do
awk "/$STRINGMATCH/ && ! /$IGNOREMATCH/ { print \$1 }" $f | sort > $TMPDIR/$f
done
# Build the diff files used for checking
# And if there are no differences, delete the empty files
echo "Comparing data"
for f in $FILEPAT;
do
if [ ! $MASTER = $f ]; then
if diff -u $TMPDIR/$MASTER $TMPDIR/$f >$TMPDIR/$f.diff ; then
rm -f $TMPDIR/$f.diff $TMPDIR/$f
fi
fi
done
# Cleanup
rm -f $TMPDIR/$MASTER
# Build the nice difference table
echo "Differences"
diffstat -f 0 $TMPDIR/*.diff >$TMPDIR/diffstat 2>/dev/null
echo "Dupe Miss Filename"
head -n -1 $TMPDIR/diffstat | \
while read filename sep change add plus sub minus edits exclaim;
do
echo "$add $sub $filename";
done
echo
echo "Dupe = Duplicate Variables"
echo "Miss = Missing Variables"
echo "For exact problem listings, look in the $TMPDIR/ directory"
echo "Please remember to remove '$TMPDIR/' once you are done"

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