2828EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929*/
3030
31+ require_once realpath (dirname (__FILE__ )) . '/classes/ispconfig_addon_installer.inc.php ' ;
32+
3133class installer_base {
3234
3335 var $ wb = array ();
@@ -397,8 +399,6 @@ public function add_database_server_record() {
397399 $ this ->db ->query ($ sql , $ conf ['hostname ' ], $ mail_server_enabled , $ web_server_enabled , $ dns_server_enabled , $ file_server_enabled , $ db_server_enabled , $ server_ini_content , $ current_db_version , $ proxy_server_enabled , $ firewall_server_enabled );
398400 $ conf ['server_id ' ] = $ this ->db ->insertID ();
399401 }
400-
401-
402402 }
403403
404404 public function detect_ips (){
@@ -2183,7 +2183,7 @@ public function install_ispconfig() {
21832183 // TODO: Implement a selector which modules and plugins shall be enabled.
21842184 $ dir = $ install_dir .'/server/mods-available/ ' ;
21852185 if (is_dir ($ dir )) {
2186- if ($ dh = opendir ($ dir )) {
2186+ if (( $ dh = opendir ($ dir) )) {
21872187 while (($ file = readdir ($ dh )) !== false ) {
21882188 if ($ file != '. ' && $ file != '.. ' && substr ($ file , -8 , 8 ) == '.inc.php ' ) {
21892189 include_once $ install_dir .'/server/mods-available/ ' .$ file ;
@@ -2210,7 +2210,7 @@ public function install_ispconfig() {
22102210
22112211 $ dir = $ install_dir .'/server/plugins-available/ ' ;
22122212 if (is_dir ($ dir )) {
2213- if ($ dh = opendir ($ dir )) {
2213+ if (( $ dh = opendir ($ dir) )) {
22142214 while (($ file = readdir ($ dh )) !== false ) {
22152215 if ($ conf ['apache ' ]['installed ' ] == true && $ file == 'nginx_plugin.inc.php ' ) continue ;
22162216 if ($ conf ['nginx ' ]['installed ' ] == true && $ file == 'apache2_plugin.inc.php ' ) continue ;
@@ -2828,7 +2828,7 @@ protected function insert_db_credentials($tContents) {
28282828 }
28292829
28302830 private function loadAddonClasses ($ path ) {
2831- $ libpath = $ conf [ ' ispconfig_install_dir ' ] . ' /addons ' ;
2831+ $ libpath = $ path ;
28322832 if (($ dir = opendir ($ libpath ))) {
28332833 while (false !== ($ cur = readdir ($ dir ))) {
28342834 if ($ cur === '. ' || $ cur === '.. ' || strpos ($ cur , '.. ' ) !== false || !is_dir ($ libpath . '/ ' . $ cur )) {
@@ -2867,15 +2867,12 @@ public function raiseEvent($event_name) {
28672867 if (is_null ($ this ->addon_classes )) {
28682868 // load addon libs
28692869 $ this ->addon_classes = array ();
2870- $ addonpath = $ conf ['ispconfig_install_dir ' ] . '/addons ' ;
2871- $ this ->loadAddonClasses ($ addonpath );
28722870
2873- // check for addon libs in install dir
2874- $ addonpath = realpath (dirname (__FILE__ ) . '/.. ' ) . '/addons ' ;
2871+ $ addonpath = $ conf ['ispconfig_install_dir ' ] . '/addons ' ;
28752872 $ this ->loadAddonClasses ($ addonpath );
28762873 }
28772874
2878- $ call_method = 'onRaisedEvent ' ;
2875+ $ call_method = 'onRaisedInstallerEvent ' ;
28792876 reset ($ this ->addon_classes );
28802877 foreach ($ this ->addon_classes as $ cl ) {
28812878 if (method_exists ($ cl , $ call_method )) {
0 commit comments