From dfdd7698c34644ce8c43b59df59bd9d81e10c7a0 Mon Sep 17 00:00:00 2001 From: botanic Date: Tue, 9 Sep 2014 17:20:23 -0700 Subject: [PATCH 1/3] fix windows warnings in sync --- code/web/private_php/ams/autoload/sync.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } } From 74df36b1795d73d9837a3d72e945125712ca1259 Mon Sep 17 00:00:00 2001 From: botanic Date: Tue, 9 Sep 2014 17:26:20 -0700 Subject: [PATCH 2/3] FIX #197 Added default config values that should work for mail config settings in case people are lazy --- code/web/private_php/ams/mail/placeholder | 0 code/web/private_php/setup/config/config.php | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 code/web/private_php/ams/mail/placeholder 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/' ; From cafe41fa24f741d3bb15d964cd43784a15afa93e Mon Sep 17 00:00:00 2001 From: botanic Date: Tue, 9 Sep 2014 17:29:59 -0700 Subject: [PATCH 3/3] FIX #192 --- code/web/private_php/ams/autoload/mail_handler.php | 1 + 1 file changed, 1 insertion(+) 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)); }