public function DoReset()
 {
     if (!AuthenticationManager::supports(__CA_AUTH_ADAPTER_FEATURE_RESET_PASSWORDS__)) {
         $this->Login();
         return;
     }
     $vs_token = $this->getRequest()->getParameter('token', pString);
     $vs_username = $this->getRequest()->getParameter('username', pString);
     $t_user = new ca_users();
     $vs_pw = $this->getRequest()->getParameter('password', pString);
     $vs_pw_check = $this->getRequest()->getParameter('password2', pString);
     if ($t_user->load($vs_username)) {
         if ($t_user->isValidToken($vs_token)) {
             // no password match
             if ($vs_pw !== $vs_pw_check) {
                 $this->notification->addNotification(_t("Passwords did not match. Please try again."), __NOTIFICATION_TYPE_ERROR__);
                 $this->view->setVar('notifications', $this->notification->getNotifications());
                 $this->view->setVar('renderForm', true);
                 $this->view->setVar('token', $vs_token);
                 $this->view->setVar('username', $vs_username);
                 $this->render('password_reset_form_html.php');
             } else {
                 $t_user->set('password', $vs_pw);
                 $t_user->setMode(ACCESS_WRITE);
                 $t_user->update();
                 $this->notification->addNotification(_t("Password was successfully changed. You can now log in with your new password."), __NOTIFICATION_TYPE_INFO__);
                 $this->view->setVar('notifications', $this->notification->getNotifications());
                 $this->Login();
             }
         }
     }
 }