$code = substr(base64_encode($_POST['email']), 0, -1);
mail($_POST['email'], 'Registartion on the forum color-school.dev', 'Link for activation: http://color-school.dev/account/activate/code/' . substr($code, -5) . substr($code, 0, -5), 'From:color-school.dev');
MessageSend(3, 'You are registerd, activate <b> ' . $_POST['email'] . '</b> email');
echo 'OK';
} else if ($Module == 'activate' and $Param['code']) {
if (!$_SESSION['USER_ACTIVE_EMAIL']) {
$email = base64_decode(substr($Param['code'], 5) . substr($Param['code'], 0, 5));
if (strpos($email, '@') !== false) {
mysqli_query($CONNECT, "UPDATE `users` SET `active` = 1 WHERE `email` ='$email'");
$_SESSION['USER_ACTIVE_EMAIL'] = $email;
MessageSend(3, 'E-mail <b>' . $email . '</b> is activated', '/login');
} else MessageSend(1, 'E-mail dose not avtivated.', '/login');
} else MessageSend(1, 'E-mail <b>' . $_SESSION['USER_ACTIVE_EMAIL'] . '</b> already is active.', '/login');
}