diff --git a/code/web/private_php/ams/autoload/mail_handler.php b/code/web/private_php/ams/autoload/mail_handler.php index c57b93250..643b57076 100644 --- a/code/web/private_php/ams/autoload/mail_handler.php +++ b/code/web/private_php/ams/autoload/mail_handler.php @@ -122,6 +122,7 @@ class Mail_Handler{ $id_user = $recipient; $recipient = NULL; } + $db = new DBLayer($db); $db->insert("email", array('Recipient' => $recipient, 'Subject' => $subject, 'Body' => $body, 'Status' => 'NEW', 'Attempts'=> 0, 'Sender' => $from,'UserId' => $id_user, 'MessageId' => 0, 'TicketId'=> $ticket_id)); } diff --git a/code/web/private_php/ams/autoload/sync.php b/code/web/private_php/ams/autoload/sync.php index fac64be0d..1160b91b5 100644 --- a/code/web/private_php/ams/autoload/sync.php +++ b/code/web/private_php/ams/autoload/sync.php @@ -106,14 +106,14 @@ class Sync{ if ($OS == 2) { $processes = explode( "\n", shell_exec( "tasklist.exe" )); - foreach( $processes as $process ) + foreach( $processes as $key => $value ) { - if( strpos( "Image Name", $process ) === 0 - || strpos( "===", $process ) === 0 ) + if( empty($value) != '1' && strpos( "Image Name", $value ) === 0 + || empty($value) != '1' && strpos( "===", $value ) === 0 ) continue; $matches = false; - preg_match( "/(.*?)\s+(\d+).*$/", $process, $matches ); - if ($pid = $matches[ 2 ]) { + preg_match( "/(.*?)\s+(\d+).*$/", $value, $matches ); + if (isset($matches[ 2 ]) && $pid = $matches[ 2 ]) { return true; } } diff --git a/code/web/private_php/ams/mail/placeholder b/code/web/private_php/ams/mail/placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/code/web/private_php/setup/config/config.php b/code/web/private_php/setup/config/config.php index d0cb88faf..4ec62d551 100644 --- a/code/web/private_php/setup/config/config.php +++ b/code/web/private_php/setup/config/config.php @@ -71,11 +71,6 @@ $cfg['mail']['host'] = "ryzomcore.org"; $SUPPORT_GROUP_IMAP_CRYPTKEY = '%cryptKeyIMAP%'; $TICKET_MAILING_SUPPORT = false; -//You have to create this dir at first! -//The incoming emails will be backed up here and the log file keeps track of the mail_cron job. -$MAIL_DIR = "/home/username/mail"; -$MAIL_LOG_PATH = "/home/username/mail/cron_mail.log"; - //terms of service url location $TOS_URL ="http://www.gnu.org/licenses/agpl-3.0.html"; @@ -101,6 +96,11 @@ $AMS_TRANS = $AMS_LIB . '/translations'; $AMS_CACHEDIR = $AMS_LIB . '/cache'; $AMS_PLUGINS = $AMS_LIB . '/plugins'; $AMS_TMPDIR = $AMS_LIB . '/tmp'; + +//The incoming emails will be backed up here and the log file keeps track of the mail_cron job. +$MAIL_DIR = $AMS_LIB."/mail"; +$MAIL_LOG_PATH = $AMS_LIB."/mail/mail.log"; + // Here your inc and func resides $SITEBASE = $PUBLIC_PHP_PATH . '/ams/' ;