import {readFileSync,writeFileSync,copyFileSync,existsSync} from 'node:fs'; import {pathToFileURL} from 'node:url'; export function styleSupportAccess(source){ if(source.includes('support-access-page'))return source; const old="exit('Support administration permission required.');"; if(!source.includes(old))throw Error('Support access guard did not match; no file changed.'); const html='Support access · DuneRealms

IMPERIAL BUREAU · SUPPORT

Administration access required

Your central account needs Support Administration access. After a rights update, reopen this workspace to renew your support session.

Return to Support Tickets →
'; return source.replace(old,"header('Content-Type: text/html; charset=utf-8');exit('"+html+"');"); } if(process.argv[1]&&import.meta.url===pathToFileURL(process.argv[1]).href){ const root=process.argv[2];if(!root)throw Error('Provide the osTicket root.'); const file=root+'/dune-sso.php',before=readFileSync(file,'utf8'),after=styleSupportAccess(before); if(after!==before){if(!existsSync(file+'.before-dune-access-style'))copyFileSync(file,file+'.before-dune-access-style');writeFileSync(file,after);} console.log('Support access style verified.'); }