break; case 'changePassword': if (isset($_POST['password']) && isset($_POST['forgot_id'])) { MultiSession::logoutUser(); echo $api->changePassword(); } break; case 'sendChartToMail': if (isset($_POST['mails']) && trim($_POST['mails']) != '' && isset($_POST['elem']) && isset($_POST['note']) && isset($_POST['svg_w']) && isset($_POST['svg_h'])) { $message = $_POST['elem']; $note = $_POST['note']; $width = intval($_POST['svg_w']); $height = intval($_POST['svg_h']); try { if ($_POST['send_all'] == "true") { $message = $api->svgToPDF($message, $width, $height); $type = "pdf"; } else { $message = $api->svgToPng($message, $width, $height); $type = "png"; } } catch (Exception $e) { echo "Internal error while attempting to generate graph image"; } if (strpos($_POST['mails'], ",")) { $mails = explode(",", $_POST['mails']); $incorrectMails = 0; foreach ($mails as $mail) { if (!filter_var(trim($mail), FILTER_VALIDATE_EMAIL)) { $incorrectMails++; }