<?php
/**
 * [BEGIN_COT_EXT]
 * Hooks=global
 * [END_COT_EXT]
 */

defined('COT_CODE') or die('Wrong URL');

global $moderauth_groups, $moderauth_ext, $moderauth;

$moderauth_groups = array(
  5 => array(
    'market',
    'projects',
    'page',
    'portfolio',
    'certificates',
    'ds', //support
    'ds_dialogs',
    'ds_dialog_show',
    'marketorders',
    'banlist',
    'user_detailsinfoblock',
    'faq',
    'payments'
  ),
  6 => array(
    'market',
    'projects',
    'page',
    'portfolio',
    'certificates',
    'ds_dialogs',
    'ds_dialog_show',
    'banlist',
    'user_detailsinfoblock'
  ),
  8 => array(
    'ds',
    'banlist'
  ),
  9 => array(
    'marketorders',
    'banlist'
  ),
);
$moderauth_ext = array();
foreach($moderauth_groups as $key => $val) {
  foreach($val as $ext) {
    $moderauth_ext[$ext][] = $key;
  }
}
$cfg['ds']['supportinfo']['modergroups'] = $moderauth_ext['ds'];

$moderauth = array();

if($usr['id'] > 0 && in_array($usr['maingrp'], array_keys($moderauth_groups)) && is_array($moderauth_groups[$usr['maingrp']])) {
  $moderauth = $moderauth_groups[$usr['maingrp']];
}