Skip to content
GitLab
Explore
Sign in
Register
Helmo
ISPConfig 3
Compare revisions
develop to xxxx-wordpress-install
Commits on Source (2)
Mockup code for a wordpress installation plugin
· 6d1c7243
Helmo
authored
Jan 24, 2023
6d1c7243
todo
· e5793496
Helmo
authored
Jan 29, 2023
e5793496
Hide whitespace changes
Inline
Side-by-side
install/sql/incremental/upd_dev_collection.sql
View file @
e5793496
ALTER
TABLE
`mail_user`
CHANGE
`quota`
`quota`
BIGINT
(
20
)
NOT
NULL
DEFAULT
'0'
;
/* install_wordpress */
ALTER
TABLE
`web_domain`
ADD
`task_request`
VARCHAR
(
255
)
NOT
NULL
AFTER
`last_jailkit_hash`
;
ALTER
TABLE
`web_domain`
ADD
`task_request_options`
MEDIUMTEXT
NOT
NULL
AFTER
`task_request`
;
interface/web/sites/form/web_vhost_domain.tform.php
View file @
e5793496
...
...
@@ -298,6 +298,12 @@ $form["tabs"]['domain'] = array (
'default'
=>
'y'
,
'value'
=>
array
(
0
=>
'n'
,
1
=>
'y'
)
),
'install_wordpress'
=>
array
(
'datatype'
=>
'VARCHAR'
,
'formtype'
=>
'CHECKBOX'
,
'default'
=>
'n'
,
'value'
=>
array
(
0
=>
'n'
,
1
=>
'y'
)
),
//#################################
// END Datatable fields
//#################################
...
...
interface/web/sites/templates/web_vhost_domain_edit.htm
View file @
e5793496
...
...
@@ -275,6 +275,12 @@
</div>
</div>
{tmpl_hook name="end_form"}
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
{tmpl_var name='XXXX_txt'}Install wordpress?
</label>
<div
class=
"col-sm-9"
>
{tmpl_var name='install_wordpress'}
</div>
</div>
<input
type=
"hidden"
name=
"id"
value=
"{tmpl_var name='id'}"
>
...
...
interface/web/sites/web_vhost_domain_edit.php
View file @
e5793496
...
...
@@ -1261,6 +1261,17 @@ class page_action extends tform_actions {
}
}
if
(
$this
->
dataRecord
[
'install_wordpress'
]
)
{
//TODO create database + user, store in $options
// TODO look at the sys_remoteaction table
$this
->
dataRecord
[
'task_request'
]
=
'install_wordpress'
;
$this
->
dataRecord
[
'task_request_options'
]
=
json_encode
(
$options
);
unset
(
this
->
dataRecord
[
'install_wordpress'
]);
}
$this
->
validateDefaultFastcgiPhpVersion
();
parent
::
onSubmit
();
...
...
server/plugins-available/wordpress_plugin.inc.php
0 → 100644
View file @
e5793496
<?php
class
wordpress_plugin
{
var
$plugin_name
=
'wordpress_plugin'
;
var
$class_name
=
'wordpress_plugin'
;
function
onLoad
()
{
global
$app
;
// Register for the events
$app
->
plugins
->
registerEvent
(
'web_domain_insert'
,
$this
->
plugin_name
,
'install_wordpress'
);
$app
->
plugins
->
registerEvent
(
'web_domain_update'
,
$this
->
plugin_name
,
'install_wordpress'
);
}
// Handle the creation of SSL certificates
function
install_wordpress
(
$event_name
,
$data
)
{
global
$app
,
$conf
;
$app
->
uses
(
'system'
);
// load the server configuration options
$app
->
uses
(
'getconf'
);
if
(
empty
(
$data
[
'new'
][
'task_request'
]))
{
return
true
;
}
// TODO Use $data['new']['document_root']
// Get db credentials from $data ? pass via task_request_options field as json?
// Generate admin_userlogin password for wordpress, mail the data to the client?
# Download and extract WordPress
#wp core download # --locale=nl_NL\n".
#wp core config --dbname=$var[db_name] --dbuser=$var[db_username] --dbpass=$var[password] --dbhost=.
#wp core install --url=https://www... --title='' --admin_user= --admin_email=info@ --admin_password=
// Cleanup the task_request field content
}
}