Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
480
Issues
480
List
Boards
Labels
Service Desk
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISPConfig
ISPConfig 3
Commits
85204d6c
Commit
85204d6c
authored
Jan 29, 2014
by
Till Brehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended resync function, added:
- database users - email forwarders and aliases - clients
parent
4193f48b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
interface/web/tools/lib/lang/en_resync.lng
interface/web/tools/lib/lang/en_resync.lng
+1
-0
interface/web/tools/resync.php
interface/web/tools/resync.php
+45
-0
interface/web/tools/templates/resync.htm
interface/web/tools/templates/resync.htm
+6
-0
No files found.
interface/web/tools/lib/lang/en_resync.lng
View file @
85204d6c
...
...
@@ -8,6 +8,7 @@ $wb['resync_cron_txt'] = 'Resync cronjobs';
$wb
[
'resync_db_txt'
]
=
'Resync clientdb config'
;
$wb
[
'resync_mailbox_txt'
]
=
'Resync Mailboxes'
;
$wb
[
'resync_dns_txt'
]
=
'Resync DNS records'
;
$wb
[
'resync_client_txt'
]
=
'Resync Client records'
;
$wb
[
'btn_start_txt'
]
=
'Start'
;
$wb
[
'btn_cancel_txt'
]
=
'Cancel'
;
?>
\ No newline at end of file
interface/web/tools/resync.php
View file @
85204d6c
...
...
@@ -106,6 +106,16 @@ if(isset($_POST['resync_cron']) && $_POST['resync_cron'] == 1) {
//* Resyncing Databases
if
(
isset
(
$_POST
[
'resync_db'
])
&&
$_POST
[
'resync_db'
]
==
1
)
{
$db_table
=
'web_database_user'
;
$index_field
=
'database_user_id'
;
$sql
=
"SELECT * FROM "
.
$db_table
.
" WHERE 1"
;
$records
=
$app
->
db
->
queryAllRecords
(
$sql
);
if
(
is_array
(
$records
))
{
foreach
(
$records
as
$rec
)
{
$app
->
db
->
datalogUpdate
(
$db_table
,
$rec
,
$index_field
,
$rec
[
$index_field
],
true
);
$msg
.
=
"Resynced Database user: "
.
$rec
[
'database_user'
]
.
'<br />'
;
}
}
$db_table
=
'web_database'
;
$index_field
=
'database_id'
;
$sql
=
"SELECT * FROM "
.
$db_table
.
" WHERE active = 'y'"
;
...
...
@@ -144,6 +154,16 @@ if(isset($_POST['resync_mailbox']) && $_POST['resync_mailbox'] == 1) {
$msg
.
=
"Resynced Mailbox: "
.
$rec
[
'email'
]
.
'<br />'
;
}
}
$db_table
=
'mail_forwarding'
;
$index_field
=
'forwarding_id'
;
$sql
=
"SELECT * FROM "
.
$db_table
;
$records
=
$app
->
db
->
queryAllRecords
(
$sql
);
if
(
is_array
(
$records
))
{
foreach
(
$records
as
$rec
)
{
$app
->
db
->
datalogUpdate
(
$db_table
,
$rec
,
$index_field
,
$rec
[
$index_field
],
true
);
$msg
.
=
"Resynced Alias: "
.
$rec
[
'source'
]
.
'<br />'
;
}
}
}
//* Resyncing dns zones
...
...
@@ -169,6 +189,31 @@ if(isset($_POST['resync_dns']) && $_POST['resync_dns'] == 1) {
}
//* Resyncing Clients
if
(
isset
(
$_POST
[
'resync_client'
])
&&
$_POST
[
'resync_client'
]
==
1
)
{
$tform_def_file
=
"form/client.tform.php"
;
$app
->
uses
(
'tpl,tform,tform_actions'
);
$app
->
load
(
'tform_actions'
);
$db_table
=
'client'
;
$index_field
=
'client_id'
;
$sql
=
"SELECT * FROM "
.
$db_table
;
$records
=
$app
->
db
->
queryAllRecords
(
$sql
);
if
(
is_array
(
$records
))
{
foreach
(
$records
as
$rec
)
{
$app
->
db
->
datalogUpdate
(
$db_table
,
$rec
,
$index_field
,
$rec
[
$index_field
],
true
);
$tmp
=
new
tform_actions
;
$tmp
->
id
=
$rec
[
$index_field
];
$tmp
->
dataRecord
=
$rec
;
$tmp
->
oldDataRecord
=
$rec
;
$app
->
plugin
->
raiseEvent
(
'client:client:on_after_update'
,
$tmp
);
$msg
.
=
"Resynced Client: "
.
$rec
[
'contact_name'
]
.
'<br />'
;
unset
(
$tmp
);
}
}
}
$app
->
tpl
->
setVar
(
'msg'
,
$msg
);
$app
->
tpl
->
setVar
(
'error'
,
$error
);
...
...
interface/web/tools/templates/resync.htm
View file @
85204d6c
...
...
@@ -46,6 +46,12 @@
<div
class=
"multiField"
>
<input
id=
"resync_dns"
type=
"checkbox"
value=
"1"
name=
"resync_dns"
/>
</div>
</div>
<div
class=
"ctrlHolder"
>
<p
class=
"label"
>
{tmpl_var name="resync_client_txt"}
</p>
<div
class=
"multiField"
>
<input
id=
"resync_client"
type=
"checkbox"
value=
"1"
name=
"resync_client"
/>
</div>
</div>
</fieldset>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment