forked from unimatrix/web
fix: preserve election board bookmarks and avoid duplicate policy checks
This commit is contained in:
parent
29087e1e7e
commit
dbf4a026aa
3 changed files with 5 additions and 11 deletions
|
|
@ -48,3 +48,7 @@ idempotently by application ID; never expose private application records.
|
|||
- Add idempotent confirmed-candidature topic publication and lifecycle synchronization. Election Board navigation is provided; automatic candidature topics are not implemented. Applications and ballots remain authoritative in the existing election service.
|
||||
|
||||
Ordinary SSH as unimatrix works; sudo -n currently requires interactive authentication. Native publication therefore needs restored privileged access or the server administrator. Uploading approved sources into /tmp is not publication.
|
||||
|
||||
## Deleted organisations
|
||||
|
||||
On clan deletion, current central membership grants disappear. Preserve forum history and let native MyBB autoprune handle eventual post cleanup. No custom clan/forum deletion or cleanup worker is required (user decision, 16 November 2026).
|
||||
|
|
|
|||
|
|
@ -23,16 +23,6 @@ function dune_apply_system_board_membership(array $identity): void {
|
|||
while ($row = $db->fetch_array($checks)) if ((int)$row['policy_count'] === count($gids)) $covered[(int)$row['fid']] = true;
|
||||
foreach ($fids as $fid) if (empty($covered[$fid])) throw new RuntimeException('Forum group policies require refresh');
|
||||
}
|
||||
// A newly created native group must not fall back to permissive global
|
||||
// defaults. Pause access until its explicit policies are provisioned.
|
||||
$userGroups=array_values(array_unique(array_filter(array_merge([(int)$mybb->user['usergroup']],array_map('intval',explode(',',(string)($mybb->user['additionalgroups']??'')))))));
|
||||
$privateFids=array_map(fn($board)=>(int)$board['fid'],array_values($boards));
|
||||
if ($privateFids && $userGroups) {
|
||||
$counts=[];
|
||||
$query=$db->simple_select('forumpermissions','fid,COUNT(DISTINCT gid) AS policies','fid IN ('.implode(',',$privateFids).') AND gid IN ('.implode(',',$userGroups).')',['group_by'=>'fid']);
|
||||
while($row=$db->fetch_array($query))$counts[(int)$row['fid']]=(int)$row['policies'];
|
||||
foreach($privateFids as $fid)if(($counts[$fid]??0)!==count($userGroups))throw new RuntimeException('Forum group policy refresh required');
|
||||
}
|
||||
$projection = $identity['systemBoards'] ?? null;
|
||||
if (!is_array($projection)) throw new RuntimeException('Forum membership projection unavailable');
|
||||
$GLOBALS['dune_system_board_identity'] = $identity;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const cpOrigin='https://cp.dunerealms.com';
|
||||
export const politicalPages={elections:['house-elections','imperial-elections','election-bene','election-guild','election-clan-delegate','applications','electoral-roll'],directory:['all-applications','candidates-emperor','candidates-atreides','candidates-harkonnen','candidates-corrino','candidates-ordos','candidates-bene','candidates-guild','candidates-clan-delegate'],offices:['office-register','imperial-senate','small-council','politics-overview','landsraad','formal-council','imperial-command'],decisions:['decisions-emperor','decisions-house','decisions-bene','decisions-guild','decisions-clan-delegate'],tools:['council-motd','imperial-water','imperial-spice']};
|
||||
export const politicalPages={elections:['house-elections','imperial-elections','election-bene','election-guild','election-clan-delegate','applications','election-boards','electoral-roll'],directory:['all-applications','candidates-emperor','candidates-atreides','candidates-harkonnen','candidates-corrino','candidates-ordos','candidates-bene','candidates-guild','candidates-clan-delegate'],offices:['office-register','imperial-senate','small-council','politics-overview','landsraad','formal-council','imperial-command'],decisions:['decisions-emperor','decisions-house','decisions-bene','decisions-guild','decisions-clan-delegate'],tools:['council-motd','imperial-water','imperial-spice']};
|
||||
export function governmentRoute(value){const parts=value.replace(/^#/,'').split('/'),page=parts[1]||parts[0];for(const [tab,pages]of Object.entries(politicalPages))if(pages.includes(page))return tab+'/'+page;const tab=Object.hasOwn(politicalPages,parts[0])?parts[0]:'elections';return tab+'/'+politicalPages[tab][0];}
|
||||
export function politicalFrameMessage(event,frame){
|
||||
if(event.origin!==cpOrigin||event.source!==frame.contentWindow)return null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff