<?php
include_once(_DIR_TO_CLASS.'/c_page.php') ;
class c_page_cab_AD_select_rol extends c_page
{
 public $h1='Выбор роли ЭСМО при авторизации через AD' ;

 function check_access()  { return(1) ; }

 function body()
 {
     $this->body_autorize() ;
 }

 function panel_autorize()  {$this->panel_form_autorize() ;}

  function panel_form_autorize($options=array())
  {   $arr_rols=$_SESSION['autorize_process']['arr_rols'] ;
      //damp_array($_SESSION['autorize_process'],1,-1) ;
      ?><form id="sky-form" class="sky-form" style="min-width:600px;">
             <header><img src="<?echo _LOGO_CAB?>"></header>
             <fieldset>
                 <div class="row">
                   <label class="label"><?echo $this->h1?></label>
                   <?if ($_SESSION['autorize_process']['account_id']){?>
                   <section  data-select>
                   <label class="select">
                           <select name="rol_id_to_auth">
                               <? if (_sizeof($arr_rols)) foreach($arr_rols as $id){?><option value="<?echo $id?>"><?echo $_SESSION['ARR_roll'][$id]['obj_name']?></option><?} ?>
                           </select><i></i>
                   </label>
                   </section><?}
                   else {?><div class="alert">Не передан ID сотрудника, выбор роли невозможен</div><?}
                   ?>
                 </div>
             </fieldset>
             <footer><button class="button v2" cmd="AD/cancel_check_sertificate">Отмена</button>
                 <? if ($_SESSION['autorize_process']['account_id'] and $_SESSION['autorize_process']['from_AD']){?><button class="button v2" cmd="AD/fixed_selected_rol">Войти под выбранной ролью</button><?}?>
             </footer>
         </form>
      <?
  }

 function block_main() {}


}
?>
