File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,21 @@ function update($event_name,$data) {
186186 if ($ this ->action != 'insert ' ) $ this ->action = 'update ' ;
187187
188188 if ($ data ["new " ]["type " ] != "vhost " && $ data ["new " ]["parent_domain_id " ] > 0 ) {
189+
190+ $ old_parent_domain_id = intval ($ data ["old " ]["parent_domain_id " ]);
191+ $ new_parent_domain_id = intval ($ data ["new " ]["parent_domain_id " ]);
192+
193+ // If the parent_domain_id has been chenged, we will have to update the old site as well.
194+ if ($ data ["new " ]["parent_domain_id " ] != $ data ["old " ]["parent_domain_id " ]) {
195+ $ tmp = $ app ->db ->queryOneRecord ("SELECT * FROM web_domain WHERE domain_id = " .$ old_parent_domain_id ." AND active = 'y' " );
196+ $ data ["new " ] = $ tmp ;
197+ $ data ["old " ] = $ tmp ;
198+ $ this ->action = 'update ' ;
199+ $ this ->update ($ event_name ,$ data );
200+ }
201+
189202 // This is not a vhost, so we need to update the parent record instead.
190- $ parent_domain_id = intval ($ data ["new " ]["parent_domain_id " ]);
191- $ tmp = $ app ->db ->queryOneRecord ("SELECT * FROM web_domain WHERE domain_id = " .$ parent_domain_id ." AND active = 'y' " );
203+ $ tmp = $ app ->db ->queryOneRecord ("SELECT * FROM web_domain WHERE domain_id = " .$ new_parent_domain_id ." AND active = 'y' " );
192204 $ data ["new " ] = $ tmp ;
193205 $ data ["old " ] = $ tmp ;
194206 $ this ->action = 'update ' ;
You can’t perform that action at this time.
0 commit comments