diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 77f4d14dc77..5e32a637c8f 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -131,8 +131,12 @@ if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') $ $form = new Form($db); $linuxlike = 1; -if (preg_match('/^win/i', PHP_OS)) $linuxlike = 0; -if (preg_match('/^mac/i', PHP_OS)) $linuxlike = 0; +if (preg_match('/^win/i', PHP_OS)) { + $linuxlike = 0; +} +if (preg_match('/^mac/i', PHP_OS)) { + $linuxlike = 0; +} if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE = 'mail'; $port = !empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : ini_get('smtp_port'); diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index fd1bcb69bdb..9b333d7b4f1 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -29,7 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "admin", "products", "sms", "other", "errors")); -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); if (!$user->admin) { accessforbidden(); @@ -43,8 +44,6 @@ $substitutionarrayfortest = array( '__FIRSTNAME__' => 'TESTFirstname' ); -$action = GETPOST('action', 'aZ09'); - /* * Actions @@ -62,9 +61,7 @@ if ($action == 'update' && !$cancel) { } -/* - * Send sms - */ +// Send sms if ($action == 'send' && !$_POST['cancel']) { $error = 0; @@ -135,6 +132,8 @@ if ($action == 'send' && !$_POST['cancel']) { * View */ +$form = new Form($db); + $linuxlike = 1; if (preg_match('/^win/i', PHP_OS)) { $linuxlike = 0; @@ -162,7 +161,6 @@ if (!count($listofmethods)) { } if ($action == 'edit') { - $form = new Form($db); print '