$USER->Login($oRequest->arParameters['admin_login'], $oRequest->arParameters['admin_password']);
     $MOD_RIGHT = $APPLICATION->GetGroupRight("controller");
     if ($MOD_RIGHT < "T") {
         $oResponse->status = "413 Bad admin";
         $oResponse->text = GetMessage("CTRLR_WS_ERR_BAD_LEVEL");
         break;
     }
     $oResponse->secret_id = $oRequest->arParameters['member_secret_id'];
     // check if that site is agree?
     //if(!($res = CControllerMember::RegisterMemberByTicket($oRequest->member_id, $oRequest->arParameters['member_secret_id'], $oRequest->arParameters['ticket_id'], $oRequest->arParameters['url'], $oRequest->session_id)))
     $ar_member = array("MEMBER_ID" => $oRequest->member_id, "SECRET_ID" => $oRequest->arParameters['member_secret_id'], "NAME" => strlen($oRequest->arParameters['name']) > 0 ? $oRequest->arParameters['name'] : $oRequest->arParameters['url'], "URL" => $oRequest->arParameters['url'], "EMAIL" => $oRequest->arParameters['email'], "CONTACT_PERSON" => $oRequest->arParameters['contact_person'], "CONTROLLER_GROUP_ID" => $oRequest->arParameters['group_id'] ? $oRequest->arParameters['group_id'] : COption::GetOptionInt("controller", "default_group", 1), "SHARED_KERNEL" => $oRequest->arParameters['shared_kernel'] == "Y" ? "Y" : "N");
     $dbr_mem = CControllerMember::GetList(array(), array("URL" => CControllerMember::_GoodURL($oRequest->arParameters['url']), "DISCONNECTED" => "I"));
     if (($ar_mem = $dbr_mem->Fetch()) && CControllerMember::_GoodURL($ar_mem["URL"]) == CControllerMember::_GoodURL($oRequest->arParameters['url'])) {
         $ar_member["ID"] = $ar_mem["ID"];
     }
     if ($ID = CControllerMember::RegisterMemberByTicket($ar_member, $oRequest->arParameters['ticket_id'], $oRequest->session_id)) {
         $oResponse->status = "200 OK";
         $oResponse->arParameters['ID'] = $ID;
     } else {
         $oResponse->status = "453 RegisterMemberByTicket error";
         $e = $APPLICATION->GetException();
         $oResponse->text = $e->GetString();
     }
     break;
     // all ok? then we need update settings
 // all ok? then we need update settings
 case 'init_group_update':
     $dbr = CControllerMember::GetByGuid($oRequest->member_id);
     if ($ar = $dbr->Fetch()) {
         if (CControllerMember::SetGroupSettings($ar["ID"]) !== false) {
             $oResponse->status = "200 OK";
 $arFields = array("ACTIVE" => $_REQUEST["ACTIVE"], "NAME" => $_REQUEST["NAME"], "URL" => $_REQUEST["PROTOCOL"] . $_REQUEST["URL"], "CONTACT_PERSON" => $_REQUEST["CONTACT_PERSON"], "EMAIL" => $_REQUEST["EMAIL"], "DATE_ACTIVE_FROM" => $_REQUEST["DATE_ACTIVE_FROM"], "DATE_ACTIVE_TO" => $_REQUEST["DATE_ACTIVE_TO"], "MEMBER_ID" => $_REQUEST["MEMBER_ID"], "NOTES" => $_REQUEST["NOTES"], "CONTROLLER_GROUP_ID" => $_REQUEST["CONTROLLER_GROUP_ID"]);
 if (COption::GetOptionString("controller", "show_hostname") == "Y") {
     $arFields["HOSTNAME"] = $_REQUEST["HOSTNAME"];
 }
 if (ControllerIsSharedMode()) {
     $arFields["SHARED_KERNEL"] = $_REQUEST["SHARED_KERNEL"];
 }
 $USER_FIELD_MANAGER->EditFormAddFields($ENTITY_ID, $arFields);
 if ($ID > 0) {
     if ($MOD_RIGHT >= "V") {
         $res = CControllerMember::Update($ID, $arFields);
     }
 } else {
     if ($sRegistrationMode == "ticket") {
         $arFields["SECRET_ID"] = $_REQUEST["SECRET_ID"];
         if (!($ID = CControllerMember::RegisterMemberByTicket($arFields, $_REQUEST["TICKET_ID"], $_REQUEST["PROTOCOL"] . $_REQUEST["URL"]))) {
             if ($e = $APPLICATION->GetException()) {
                 $message = new CAdminMessage(GetMessage("CTRLR_MEM_EDIT_ERR4"), $e);
             }
             $bRegistrationByTicketError = true;
         }
     } elseif ($sRegistrationMode == "password") {
         if (strlen($_REQUEST["ADMIN_LOGIN"]) < 0 || strlen($_REQUEST["ADMIN_PASSWORD"]) <= 0) {
             $e = new CApplicationException(GetMessage("CTRLR_MEM_EDIT_ERR5"));
             $message = new CAdminMessage(GetMessage("CTRLR_MEM_EDIT_ERR4"), $e);
         } elseif (!($ID = CControllerMember::RegisterMemberByPassword($arFields, $_REQUEST["ADMIN_LOGIN"], $_REQUEST["ADMIN_PASSWORD"]))) {
             if ($e = $APPLICATION->GetException()) {
                 $message = new CAdminMessage(GetMessage("CTRLR_MEM_EDIT_ERR4"), $e);
             }
             $bRegistrationByTicketError = true;
         }