$form_login does not exist!", "", "", "YES"); $result = db_query("SELECT password FROM mailbox WHERE username='$form_login'"); if ($result['rows'] == 1) { $row = mysql_fetch_array($result['result']); $db_passwd = $row['password']; $keys = preg_split('/\$/', $row['password']); $checked_passwd = md5crypt($form_passwd, $keys[2]); $result = db_query("SELECT * FROM mailbox WHERE username='$form_login' AND password='$checked_passwd' AND active='1'"); if ($result['rows'] != 1) print_error("The password that you have entered is not correct!", "", "", "YES"); } $result = db_query("SELECT email FROM vacation WHERE email='$form_login'"); if ($result['rows'] == 0 and !empty($_POST['cancel'])) print_error("Unable to cancel your \"Out of the Office\" message! (vacation)", "", "", "YES"); if ($result['rows'] == 1 and empty($_POST['cancel'])) print_error("There is already an \"Out of the Office\" message present! (vacation)", "", "", "YES"); $result = db_query("SELECT goto FROM alias WHERE address='$form_login'"); if ($result['rows'] == 1) { $row = mysql_fetch_array($result['result']); if (!empty($_POST['cancel'])) { $db_goto = preg_replace("/,$vacation_email/", "", $row['goto']); } else { $db_goto = $row['goto'] . ",$vacation_email"; } } else { if ($result['rows'] != 1) print_error("Unable collect your data! (alias)", "", "", "YES"); } $result = db_query("UPDATE alias SET goto='$db_goto', change_date=NOW() WHERE address='$form_login'"); if ($result['rows'] != 1) print_error("Unable to create your \"Out of the Office\" message! (alias)", "", "", "YES"); if (!empty($_POST['cancel'])) $result = db_query("DELETE FROM vacation WHERE email='$form_login'"); if (!empty($_POST['submit'])) $result = db_query("INSERT INTO vacation (email,subject,body) VALUES('$form_login', '$form_subject', '$form_body')"); if ($result['rows'] == 1) { print "