diff --git a/index.php b/index.php
index 9b9b31a..6f8f6c4 100755
--- a/index.php
+++ b/index.php
@@ -11,12 +11,12 @@
 use Gregwar\Captcha\PhraseBuilder;
 
 $URI = array_slice(explode("/", explode('?', $_SERVER['REQUEST_URI'], 2)[0]), -1)[0];
-if (strlen($URI) == 2){
+if (strlen($URI) == 2) {
     $GLOBALS["cc"] = $URI;
     $_SESSION["cc"] = $URI;
 }
 
-if (isset($_GET["lang"])){
+if (isset($_GET["lang"])) {
     $GLOBALS["cc"] = $_GET["lang"];
     $_SESSION["cc"] = $_GET["lang"];
 }
@@ -24,21 +24,48 @@
 $TEMPLATE = template_path();
 
 
-
-function register_page($error=false){
-    $TEMPLATE = template_path();
+function send_confirmation_email(string $mail, object $smtp, string $url)
+{
     include 'config.php';
-    if ($error)
-        include $TEMPLATE.'error.htm';
-    $_SESSION["captcha_token"] = generateRandomString(12);
-    include $TEMPLATE."register.htm";
+    include 'utils.php';
+    include "mail.php";
+    $TEMPLATE = template_path();
+    include $TEMPLATE . "emails.php";
+
+    send_mail($mail, $smtp, (object) [
+        "subject" => $MAIL_TEMPLATE->subject,
+        "text"    => str_replace("{{url}}", $url, $MAIL_TEMPLATE->text),
+        "html"    => str_replace("{{url}}", $url, $MAIL_TEMPLATE->html)
+    ]);
+}
+
+function send_recovery_email(string $mail, object $smtp, string $url)
+{
+    include 'config.php';
+    include 'utils.php';
+    include "mail.php";
+    $TEMPLATE = template_path();
+    include $TEMPLATE . "emails.php";
+
+    send_mail($mail, $smtp, (object) [
+        "subject" => $RECOVERY_EMAIL_TEMPLATE->subject,
+        "text"    => str_replace("{{url}}", $url, $RECOVERY_EMAIL_TEMPLATE->text),
+        "html"    => str_replace("{{url}}", $url, $RECOVERY_EMAIL_TEMPLATE->html)
+    ]);
+}
+
+function reload_captcha_script()
+{
+    include 'config.php';
+    $TEMPLATE = template_path();
+    include $TEMPLATE . "strings.php";
     echo '
     <script>
         const reload_captcha = async (e) => {
             var cont = document.getElementById("reload_captcha");
-            cont.innerHTML = "<div class=\'spinner-border text-info\' role=\'status\'><span class=\'sr-only\'>'.$STRINGS->reloading_captcha.'</span></div>";
+            cont.innerHTML = "<div class=\'spinner-border text-info\' role=\'status\'><span class=\'sr-only\'>' . $STRINGS->reloading_captcha . '</span></div>";
             var img = document.getElementById("captcha")
-            var url =  "'.$BASE_URL.'/captcha.php?token='.$_SESSION["captcha_token"].'"
+            var url =  "' . $BASE_URL . '/captcha.php?token=' . $_SESSION["captcha_token"] . '"
             await fetch(url, { cache: "reload", mode: "no-cors" })
              .then(() => {
                 img.src = url+"&t=" + new Date().getTime();
@@ -57,12 +84,24 @@
     ';
 }
 
+function register_page($error = false)
+{
+    $TEMPLATE = template_path();
+    include 'config.php';
+    if ($error)
+        include $TEMPLATE . 'error.htm';
+    $_SESSION["captcha_token"] = generateRandomString(12);
+    include $TEMPLATE . "register.htm";
+    reload_captcha_script();
+}
 
-function verify_request($user){
+
+function verify_request($user)
+{
     $TEMPLATE = template_path();
     unset($_SESSION['captcha_token']);
     include 'validators.php';
-    include $TEMPLATE.'strings.php';
+    include $TEMPLATE . 'strings.php';
     $password = $_POST["password"];
     $error = "";
 
@@ -74,56 +113,52 @@
 
 
     if (!(isset($_SESSION['captcha']) && PhraseBuilder::comparePhrases($_SESSION['captcha'], $_POST['captcha']))) {
-        $error = $error."Wrong captcha!<br>";
+        $error = $error . $STRINGS->wrong_captcha;
     }
     unset($_SESSION["captcha"]);
-    
+
     return $error;
 }
 
-function approve_request($user){
+function approve_request($user)
+{
     include "mail.php";
     $token = generateRandomString();
     redis_set($token, $user, $MAIL_CONFIRMATION_AWAIT_DELAY);
     $pending = redis_get("pending");
-    if ($pending){
+    if ($pending) {
         $maillist = $pending->mails;
         array_push($maillist, $user->email);
-    }
-    else
+    } else
         $maillist = [$user->email];
-    redis_set("pending", (object)["mails"=>$maillist], $MAIL_CONFIRMATION_AWAIT_DELAY);
+    redis_set("pending", (object)["mails" => $maillist], $MAIL_CONFIRMATION_AWAIT_DELAY);
 
-    $url = $BASE_URL."?type=confirmation&token=".$token;
+    $url = $BASE_URL . "?type=confirmation&token=" . $token;
     if (in_array(explode("@", $user->email)[1], $MAIL_HOST_DIRECT_FALLBACK))
         $smtp = $FALLBACK_SMTP;
     else
         $smtp = $SMTP;
-    send_mail($user->email, $smtp, (object) [
-        "subject" => $MAIL_TEMPLATE->subject, 
-        "text" => str_replace("{{url}}", $url, $MAIL_TEMPLATE->text),
-        "html" => str_replace("{{url}}", $url, $MAIL_TEMPLATE->html)
-    ]);
+    send_confirmation_email($user->email, $smtp, $url);
     $_SESSION['resend'] = generateRandomString(12);
     $_SESSION['token'] = $token;
     $_SESSION['email'] = $user->email;
     $TEMPLATE = template_path();
-    include $TEMPLATE."confirm_your_email.htm";
+    include $TEMPLATE . "confirm_your_email.htm";
 }
 
 
 // PAGE
-include $TEMPLATE."header.htm";
+include $TEMPLATE . "header.htm";
 
 if ($_SERVER["REQUEST_METHOD"] == "POST") {
     include 'ldap.php';
     if (isset($_POST['type'])) {
         switch ($_POST['type']) {
             case "register":
-                $user = new User($_POST["username"], $_POST["name"], $_POST["last_name"], $_POST["email"], $_POST["password"]); 
-                if (redis_inc_ipdata(getClientIP(), "register", true) > $HOURLY_REGISTRATIONS){
-                    include $TEMPLATE."registration_limit.htm";
-                }else{
+                $user = new User($_POST["username"], $_POST["name"], $_POST["last_name"], $_POST["email"], $_POST["password"]);
+                if (redis_inc_ipdata(getClientIP(), "register", true) > $HOURLY_REGISTRATIONS) {
+                    include $TEMPLATE . "registration_limit.htm";
+                } else {
                     $error = verify_request($user);
                     if ($error)
                         register_page($error);
@@ -132,72 +167,158 @@
                 }
                 break;
             case "recover":
+                $TEMPLATE = template_path();
+                unset($_SESSION['captcha_token']);
+                include $TEMPLATE . 'strings.php';
+
+                $email = $_POST["email"];
+                if (!ldap_mail_count($email)) {
+                    $error = $error . $STRINGS->recover_email_not_registered;
+                }
+
+                if (!(isset($_SESSION['captcha']) && PhraseBuilder::comparePhrases($_SESSION['captcha'], $_POST['captcha']))) {
+                    $error = $error . $STRINGS->wrong_captcha;
+                }
+
+                unset($_SESSION["captcha"]);
+                if (redis_inc_ipdata(getClientIP(), "register", true) > $HOURLY_REGISTRATIONS) {
+                    include $TEMPLATE . "registration_limit.htm";
+                } else {
+                    if ($error) {
+                        include $TEMPLATE . 'error.htm';
+                        include $TEMPLATE . "register.htm";
+                        reload_captcha_script();
+                    } else {
+                        include $TEMPLATE . 'strings.php';
+                        $token = generateRandomString();
+                        redis_set($token, $email, $MAIL_CONFIRMATION_AWAIT_DELAY);
+
+                        $url = $BASE_URL . "?type=password_change&token=" . $token;
+                        if (in_array(explode("@", $email)[1], $MAIL_HOST_DIRECT_FALLBACK))
+                            $smtp = $FALLBACK_SMTP;
+                        else
+                            $smtp = $SMTP;
+                        send_confirmation_email($user->email, $smtp, $url);
+                        $_SESSION['resend']  = generateRandomString(12);
+                        $_SESSION['token']   = $token;
+                        $_SESSION['email']   = $email;
+                        $_SESSION['recover'] = $email;
+                        $TEMPLATE = template_path();
+                        include $TEMPLATE . "confirm_your_email.htm";
+                        send_recovery_email($email, $smtp, $url);
+                    }
+                }
                 break;
-        }
+
+            case "password_change":
+                include 'validators.php';
+                include 'ldap.php';
+                $TEMPLATE = template_path();
+                include $TEMPLATE . "register.htm";
+                $password = $_POST['password'];
+                $error = validate_password($password);
+                if ($error) {
+                    include $TEMPLATE . 'error.htm';
+                    include $TEMPLATE . "recover_new_password_form.htm";
+                }else {
+                    include $TEMPLATE . "recover_success.htm";
+                    include $TEMPLATE . "email.php";
+                    include 'mail.php';
+                    $email = $_SESSION["email_change"];
+                    if (change_password($email, $password)) {
+                        if (in_array(explode("@", $email)[1], $MAIL_HOST_DIRECT_FALLBACK))
+                            $smtp = $FALLBACK_SMTP;
+                        else
+                            $smtp = $SMTP;
+                        send_mail($email, $smtp, $PASSWORD_CHANGED_EMAIL_TEMPLATE);
+                        unset($_SESSION["email_change"]);
+                    }
+                    else {
+                        include $TEMPLATE . "strings.php";
+                        echo $STRINGS->change_password_ldap_error;
+                    }
+                }
+                break;
     }
 } elseif (isset($_GET['type'])) {
     switch ($_GET['type']) {
         case "confirmation":
-            if (!isset($_GET["token"])){
+            if (!isset($_GET["token"])) {
                 echo $RUNTIME_ERROR->user_trying_invalid_get;
-            }else{
+            } else {
                 include "ldap.php";
                 $token = $_GET["token"];
                 $user = redis_get($token);
-                if ($user){
-                    if (ldap_add_user($user)){
+                if ($user && gettype($user) == "object") {
+                    if (ldap_add_user($user)) {
                         if ($REDIRECT_TO)
-                            header( "refresh:5;url=".$REDIRECT_TO);
+                            header("refresh:5;url=" . $REDIRECT_TO);
 
                         $pending = redis_get("pending");
-                        if ($pending){
+                        if ($pending) {
                             $maillist = $pending->mails;
-                            if (in_array($user->email, $maillist)){
+                            if (in_array($user->email, $maillist)) {
                                 unset($maillist[array_search($user->email, $maillist)]);
-                                redis_set("pending", (object)["mails"=>$maillist], $MAIL_CONFIRMATION_AWAIT_DELAY);
+                                redis_set("pending", (object)["mails" => $maillist], $MAIL_CONFIRMATION_AWAIT_DELAY);
                             }
                         }
                         redis_inc_ipdata(getClientIP(), "register");
                         echo $STRINGS->email_confirmation;
-                        include $TEMPLATE."mail_confirmed.htm";
-                    }else{
+                        include $TEMPLATE . "mail_confirmed.htm";
+                    } else {
                         echo $STRINGS->email_confirmation;
-                        include $TEMPLATE."registration_error.htm";
+                        include $TEMPLATE . "registration_error.htm";
                     }
                     redis_delete($token);
-                }else{
-                    include $TEMPLATE."token_expired.htm";
+                } else {
+                    include $TEMPLATE . "token_expired.htm";
                 }
             }
             break;
         case "resend":
-            if (isset($_GET['token']) && isset($_SESSION['resend']) && $_GET['token'] == $_SESSION['resend']){
-                include "mail.php";
-                include $TEMPLATE."resend_mail.htm";
+            if (isset($_GET['token']) && isset($_SESSION['resend']) && $_GET['token'] == $_SESSION['resend']) {
+                include $TEMPLATE . "resend_mail.htm";
                 $token = $_SESSION['token'];
-                $url = $BASE_URL."?type=confirmation&token=".$token;
+                $url = $BASE_URL . "?type=confirmation&token=" . $token;
                 $smtp = $FALLBACK_SMTP;
-                $mail = $_SESSION["email"];
-                send_mail($mail, $smtp, (object) [
-                    "subject" => $MAIL_TEMPLATE->subject, 
-                    "text" => str_replace("{{url}}", $url, $MAIL_TEMPLATE->text),
-                    "html" => str_replace("{{url}}", $url, $MAIL_TEMPLATE->html)
-                ]);
+                $address = $_SESSION["email"];
+                if (isset($_SESSION['recover'])){
+                    $url = $BASE_URL . "?type=password_change&token=" . $token;
+                    send_recovery_email($address, $smtp, $url);
+                    unset($_SESSION['recover']);
+                }
+                else
+                    send_confirmation_email($address, $smtp, $url);
                 unset($_SESSION['resend']);
                 unset($_SESSION['token']);
                 unset($_SESSION['email']);
             }
             break;
+
         case "recover":
+            $TEMPLATE = template_path();
+            include $TEMPLATE . "register.htm";
+            include 'config.php';
+            $_SESSION["captcha_token"] = generateRandomString(12);
+            reload_captcha_script();
             break;
-        case "confirm_recover":
+
+        case "password_change":
+            $TEMPLATE = template_path();
+            include $TEMPLATE . "register.htm";
+            $token = $_GET["token"];
+            $email = redis_get($token);
+            $_SESSION["email_change"] = $email;
+            if ($email && gettype($email) == "string"){
+                include $TEMPLATE . "recover_new_password_form.htm";
+            } else {
+                include $TEMPLATE . "token_expired.htm";
+            }
             break;
     }
-
-
 } else {
     unset($_SESSION['captcha_token']);
     register_page();
 }
 
-include $TEMPLATE."bottom.htm";
+include $TEMPLATE . "bottom.htm";
