public function acceptPolicies(bool $save = true)
    {
        $nb_site = $this->nb_application->getHTTPServer()->getSite();
        if ($nb_site === null || !($nb_site instanceof CNabuSite)) {
            throw new ENabuCoreException(ENabuCoreException::ERROR_SITE_NOT_FOUND);
        }

        if ($this->isUserLogged()) {
            $this->nb_user->setPoliciesAccepted('T');
            $this->nb_user->setPoliciesDatetime(date('Y-m-d H:i:s', time()));

            if ($nb_site->getEnableSessionStrictPolicies() === 'T') {
                session_regenerate_id(true);
            }

            if ($save &&
                $this->nb_user->save() &&
                strlen($url = $nb_site->getLoginRedirectionTargetLink($this->nb_site_role)->getBestQualifiedURL()) > 0
            ) {

                $after_login = $url . "?logged";
                throw new ENabuRedirectionException(301, new CNabuHTTPRedirection(301, $url));
            }
        }
    }