<?php
include_once("c_AD_setting.php");
class c_page_cab_AD_setting_users extends c_page_cab_AD_setting
{
  public $h1='Пользователи - ActiveDirectory' ;

 function block_main()
 { global $member ;

   $this->page_title() ;

   //include_once('panel_list_edit.php');
   //panel_list_edit(array('title_list'=>'Роли персонала','title_create'=>'Новая роль','list_name'=>'IL_roll','read_only_id'=>$member->info['rol'])) ;
   $this->panel_list_edit($_SESSION['ARR_roll']) ;

 }

 function panel_list_edit($recs)
{ //$recs_rol_by_AD=array() ;
  $recs_rol_by_account=array() ;
  //$recs_AD_to_rol=execSQL_row('select personal_id,id from view_IL_ad_groups where personal_id>0') ;
  $recs_account=execSQL_row('select obj_name,rol from obj_site_account where clss=210 and enabled=1 and rol>0') ;
  if (_sizeof($recs_account)) foreach($recs_account as $account_name=>$rol_id)  $recs_rol_by_account[$rol_id][]=$account_name ;

  ?><form>

    <table class="basic fz_small">
        <tr>
            <th>Логин</th>
            <th><input data-required="" type="text" name="search-login" class="big input_required" value=""></th>
            <th><button class="v2" cmd="AD/search_user">Найти</button></th>
        </tr>
   </table>
    <div id="user_info"></div>
    <div id="debug"></div>
   </form>
    <script>
        $j(document).ready(function() {
            $j('#user_info').on('change', '.ad-role-select', function(e) {
                var $el = $j(this)
                var guid = $el.data('guid')
                var role_id = $el.val()
                $j('#save_'+guid).attr('role_id', role_id)
            });

            $j('#user_info').on('change', '.ad-group-select', function(e) {
                var $el = $j(this)
                var guid = $el.data('guid')
                var group_id = $el.val()
                $j('#save_'+guid).attr('group_id', group_id)
            })
        });
    </script>
    <?
}


}



?>
