From bd7995d68c514a788b0d35dd179466d5a97bb4ca Mon Sep 17 00:00:00 2001 From: pavlov346346-source Date: Sat, 12 Sep 2026 10:10:25 +0300 Subject: [PATCH] fix: expose manager account and password controls --- public/core/account-center-v1780.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/public/core/account-center-v1780.js b/public/core/account-center-v1780.js index a9a0766..070e41e 100644 --- a/public/core/account-center-v1780.js +++ b/public/core/account-center-v1780.js @@ -1,7 +1,7 @@ (()=>{ 'use strict'; if(window.CateriumAccountCenterV1780)return; -const VERSION='17.8.0-account-center-v2'; +const VERSION='17.8.0-account-center-v3'; const $=(s,r=document)=>r.querySelector(s); const qa=(s,r=document)=>[...r.querySelectorAll(s)]; const esc=v=>window.SunSafe?.escapeHTML?window.SunSafe.escapeHTML(String(v??'')):String(v??''); @@ -42,6 +42,7 @@ function installStyle(){ #cateriumAccountCenter .cac-company-actions{display:flex;gap:10px;flex-wrap:wrap} #sunCurrentUserLabel{cursor:pointer} #sunCurrentUserLabel:hover{text-decoration:underline;text-underline-offset:3px} + #cateriumAccountButton{display:flex!important} #sun-cloud-users-modal [data-caterium-owner-row="1"]{background:#fff9e8;border:1px solid #ead39a;border-radius:10px;padding:10px} #sun-cloud-users-modal .caterium-owner-chip{display:inline-flex;align-items:center;border-radius:999px;background:#f4dfad;color:#6d5118;padding:5px 9px;font-size:11px;font-weight:900} @media(max-width:720px){#cateriumAccountCenter{padding:0;place-items:stretch}#cateriumAccountCenter .cac-shell{width:100%;max-height:none;height:100dvh;border-radius:0}#cateriumAccountCenter .cac-grid{grid-template-columns:1fr}#cateriumAccountCenter .cac-card.wide{grid-column:auto}#cateriumAccountCenter .cac-head,#cateriumAccountCenter .cac-body{padding-left:18px;padding-right:18px}} @@ -80,10 +81,11 @@ function render(){
На новый адрес придёт письмо подтверждения.
-

Пароль

+

Смена пароля

+
Пароль меняется только для вашего аккаунта. Администратор компании его не видит.
${owner?`

Компания и пользователи

Создавайте сотрудников, назначайте им рабочую роль и включайте только нужные права.

`:''}

Сеанс

@@ -125,10 +127,21 @@ function sanitizeRbac(){ } const addRole=$('#sunRbacEmployeeRole',body);if(addRole)qa('option[value="admin"]',addRole).forEach(o=>o.remove()); } +function ensureSidebarEntry(){ + const footer=$('.sun-side-footer');if(!footer||!session()?.user)return; + let button=$('#cateriumAccountButton'); + if(!button){ + button=document.createElement('button'); + button.id='cateriumAccountButton';button.type='button';button.className='sun-side-action';button.title='Профиль, email и пароль'; + button.innerHTML='Мой аккаунт'; + footer.insertBefore(button,footer.querySelector('#sunLogoutBtn')||footer.firstChild); + } + if(!button.dataset.cateriumAccountBound){button.dataset.cateriumAccountBound='1';button.addEventListener('click',open)} +} function bindEntry(){ const label=$('#sunCurrentUserLabel');if(label&&!label.dataset.cateriumAccountBound){label.dataset.cateriumAccountBound='1';label.title='Открыть личный кабинет';label.addEventListener('click',open)} const ss=session();const uid=ss?.user?.id||'';if(uid&&uid!==lastUserId){lastUserId=uid;snapshot=null;} - sanitizeRbac(); + ensureSidebarEntry();sanitizeRbac(); } installStyle();ensureModal();bindEntry(); const obs=new MutationObserver(bindEntry);obs.observe(document.documentElement,{childList:true,subtree:true});