mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-10 21:26:35 +01:00
Merge branch 'htmlentities_for_filename_with_special_char' into 'development'
Htmlentities for filename with special char See merge request xevidos/codiad!7
This commit is contained in:
commit
9acbdafa82
@ -709,7 +709,7 @@ class Filemanager extends Common {
|
||||
"url"=>$add,
|
||||
"thumbnail_url"=>$add,
|
||||
"delete_url"=>$add,
|
||||
"delete_type"=>"DELETE"
|
||||
"delete_type"=>'DELETE'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -98,11 +98,12 @@ if ( ! ( defined( "DBHOST" ) && defined( "DBNAME" ) && defined( "DBUSER" ) && de
|
||||
$aValidDBType = [
|
||||
'mysql'
|
||||
,'postgresql'
|
||||
//,'sqlite'
|
||||
];
|
||||
|
||||
//Is selected database type valid?
|
||||
if(!in_array($dbtype,$aValidDBType)){
|
||||
die( "Invalid database. Please select one of ".implode(", "$aValidDBType)."." );
|
||||
die( "Invalid database. Please select one of ".implode(", ",$aValidDBType)."." );
|
||||
}
|
||||
|
||||
try {
|
||||
@ -115,130 +116,16 @@ if ( ! ( defined( "DBHOST" ) && defined( "DBNAME" ) && defined( "DBUSER" ) && de
|
||||
}
|
||||
$bind_vars = array();
|
||||
$bind = "";
|
||||
$sql = [];
|
||||
$sql['mysql'] = "
|
||||
$database_sql_fullpath = $path.'/components/install/sql/'.$dbtype.".sql";
|
||||
if(!is_file($database_sql_fullpath)){
|
||||
die("Could not find the sql of the database ".$dbtype." to execute");
|
||||
}
|
||||
$sql = file_get_contents($database_sql_fullpath);
|
||||
|
||||
--
|
||||
-- Table structure for table options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS options (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
value text NOT NULL,
|
||||
CONSTRAINT option_name UNIQUE (name)
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table projects
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS projects (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
path varchar(255) NOT NULL,
|
||||
owner varchar(255) NOT NULL,
|
||||
access text,
|
||||
CONSTRAINT project UNIQUE (path, owner)
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table users
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
first_name varchar(255) DEFAULT NULL,
|
||||
last_name varchar(255) DEFAULT NULL,
|
||||
username varchar(255) NOT NULL,
|
||||
password text NOT NULL,
|
||||
email varchar(255) DEFAULT NULL,
|
||||
project varchar(255) DEFAULT NULL,
|
||||
access varchar(255) NOT NULL,
|
||||
groups text,
|
||||
token text,
|
||||
CONSTRAINT username UNIQUE (username)
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table user_options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_options (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
username varchar(255) NOT NULL,
|
||||
value text NOT NULL,
|
||||
CONSTRAINT option_name UNIQUE (name,username)
|
||||
);
|
||||
|
||||
";
|
||||
|
||||
$sql['postgresql'] = "
|
||||
|
||||
--
|
||||
-- Table structure for table options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS options (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name varchar(255) NOT NULL UNIQUE,
|
||||
value TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table projects
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS projects (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
path varchar(255) NOT NULL UNIQUE,
|
||||
owner varchar(255) NOT NULL UNIQUE,
|
||||
access text
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table users
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id SERIAL PRIMARY KEY,
|
||||
first_name varchar(255) DEFAULT NULL,
|
||||
last_name varchar(255) DEFAULT NULL,
|
||||
username varchar(255) NOT NULL UNIQUE,
|
||||
password text NOT NULL,
|
||||
email varchar(255) DEFAULT NULL,
|
||||
project varchar(255) DEFAULT NULL,
|
||||
access varchar(255) NOT NULL,
|
||||
groups text,
|
||||
token text
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table user_options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_options (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name varchar(255) NOT NULL UNIQUE,
|
||||
username varchar(255) NOT NULL UNIQUE,
|
||||
value text NOT NULL
|
||||
);
|
||||
|
||||
";
|
||||
|
||||
try {
|
||||
|
||||
$result = $connection->exec($sql[$dbtype]);
|
||||
//Create the database
|
||||
$result = $connection->exec($sql);
|
||||
} catch( PDOException $e ) {
|
||||
|
||||
die($e->getMessage());
|
||||
|
57
components/install/sql/mysql.sql
Normal file
57
components/install/sql/mysql.sql
Normal file
@ -0,0 +1,57 @@
|
||||
--
|
||||
-- Table structure for table options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS options (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
value text NOT NULL,
|
||||
CONSTRAINT option_name UNIQUE (name)
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table projects
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS projects (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
path varchar(255) NOT NULL,
|
||||
owner varchar(255) NOT NULL,
|
||||
access text,
|
||||
CONSTRAINT project UNIQUE (path, owner)
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table users
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
first_name varchar(255) DEFAULT NULL,
|
||||
last_name varchar(255) DEFAULT NULL,
|
||||
username varchar(255) NOT NULL,
|
||||
password text NOT NULL,
|
||||
email varchar(255) DEFAULT NULL,
|
||||
project varchar(255) DEFAULT NULL,
|
||||
access varchar(255) NOT NULL,
|
||||
groups text,
|
||||
token text,
|
||||
CONSTRAINT username UNIQUE (username)
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table user_options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_options (
|
||||
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
username varchar(255) NOT NULL,
|
||||
value text NOT NULL,
|
||||
CONSTRAINT option_name UNIQUE (name,username)
|
||||
);
|
53
components/install/sql/postgresql.sql
Normal file
53
components/install/sql/postgresql.sql
Normal file
@ -0,0 +1,53 @@
|
||||
--
|
||||
-- Table structure for table options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS options (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name varchar(255) NOT NULL UNIQUE,
|
||||
value TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table projects
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS projects (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name varchar(255) NOT NULL,
|
||||
path varchar(255) NOT NULL UNIQUE,
|
||||
owner varchar(255) NOT NULL UNIQUE,
|
||||
access text
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table users
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id SERIAL PRIMARY KEY,
|
||||
first_name varchar(255) DEFAULT NULL,
|
||||
last_name varchar(255) DEFAULT NULL,
|
||||
username varchar(255) NOT NULL UNIQUE,
|
||||
password text NOT NULL,
|
||||
email varchar(255) DEFAULT NULL,
|
||||
project varchar(255) DEFAULT NULL,
|
||||
access varchar(255) NOT NULL,
|
||||
groups text,
|
||||
token text
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table user_options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_options (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name varchar(255) NOT NULL UNIQUE,
|
||||
username varchar(255) NOT NULL UNIQUE,
|
||||
value text NOT NULL
|
||||
);
|
53
components/install/sql/sqlite.sql
Normal file
53
components/install/sql/sqlite.sql
Normal file
@ -0,0 +1,53 @@
|
||||
--
|
||||
-- Table structure for table options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS options (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name CHAR(255) NOT NULL UNIQUE,
|
||||
value TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table projects
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS projects (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name CHAR(255) NOT NULL,
|
||||
path CHAR(255) NOT NULL UNIQUE,
|
||||
owner CHAR(255) NOT NULL UNIQUE,
|
||||
access text
|
||||
);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table users
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
first_name CHAR(255) DEFAULT NULL,
|
||||
last_name CHAR(255) DEFAULT NULL,
|
||||
username CHAR(255) NOT NULL UNIQUE,
|
||||
password text NOT NULL,
|
||||
email CHAR(255) DEFAULT NULL,
|
||||
project CHAR(255) DEFAULT NULL,
|
||||
access CHAR(255) NOT NULL,
|
||||
groups text,
|
||||
token text
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table user_options
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_options (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name CHAR(255) NOT NULL UNIQUE,
|
||||
username CHAR(255) NOT NULL UNIQUE,
|
||||
value text NOT NULL
|
||||
);
|
Loading…
Reference in New Issue
Block a user