Index: branches/5.2.x/units/gateways/gw_event_handler.php =================================================================== diff -u -N -r14258 -r14702 --- branches/5.2.x/units/gateways/gw_event_handler.php (.../gw_event_handler.php) (revision 14258) +++ branches/5.2.x/units/gateways/gw_event_handler.php (.../gw_event_handler.php) (revision 14702) @@ -1,6 +1,6 @@ Application->isAdminUser) { - return ; + if ( !$this->Application->isAdminUser ) { + return; } - $fh = opendir(GW_CLASS_PATH); + $gateways = glob(GW_CLASS_PATH . DIRECTORY_SEPARATOR . '*.php'); - while( $entry=readdir($fh) ) - { - if ( !is_file(GW_CLASS_PATH.'/'.$entry) ) continue; - $pathinfo = pathinfo($entry); - if ( $pathinfo['extension'] != 'php') continue; + if ( !$gateways ) { + return; + } + foreach ($gateways as $gateway_file) { $class_name = false; - include_once(GW_CLASS_PATH.'/'.$entry); - if (!$class_name) continue; + include_once($gateway_file); + + if ( !$class_name ) { + continue; + } + $tmp = new $class_name(); + /* @var $tmp kGWBase */ + $tmp->Install(); } - } } \ No newline at end of file