diff --git a/web/ajax/log.php b/web/ajax/log.php index d5483b7ca..16f7ac573 100644 --- a/web/ajax/log.php +++ b/web/ajax/log.php @@ -185,7 +185,7 @@ switch ( $_REQUEST['task'] ) { $Servers = ZM\Server::find(); $servers_by_Id = array(); # There is probably a better way to do this. - foreach ( $servers as $server ) { + foreach ( $Servers as $server ) { $servers_by_Id[$server->Id()] = $server; } @@ -245,6 +245,9 @@ switch ( $_REQUEST['task'] ) { } $exportKey = substr(md5(rand()), 0, 8); $exportFile = 'zm-log.'.$exportExt; + + // mkdir will generate a warning if it exists, but that is ok + error_reporting(0); if ( ! ( mkdir(ZM_DIR_EXPORTS) || file_exists(ZM_DIR_EXPORTS) ) ) { ZM\Fatal('Can\'t create exports dir at \''.ZM_DIR_EXPORTS.'\''); } @@ -371,8 +374,16 @@ switch ( $_REQUEST['task'] ) { <'.strtolower($field).'>'.htmlspecialchars($value).' ' ); fwrite( $exportFP, - ' - '.translate('DateTime').''.translate('Component').''.translate('Pid').''.translate('Level').''.translate('Message').''.translate('File').''.translate('Line').' + ' + + '.translate('DateTime').' + '.translate('Component').' + '.translate('Server').' + '.translate('Pid').' + '.translate('Level').' + '.translate('Message').' + '.translate('File').' + '.translate('Line').' ' );