Beispiel #1
0
 public function GetAuthorizeInfo($updateInfo = false)
 {
     $ViAccount = new CVoxImplantAccount();
     if ($updateInfo) {
         $ViAccount->UpdateAccountInfo();
     }
     $ViUser = new CVoxImplantUser();
     $userInfo = $ViUser->GetUserInfo($this->userId);
     if (!$userInfo) {
         $this->error = new CVoxImplantError(__METHOD__, $ViUser->GetError()->code, GetMessage('VI_GET_USER_INFO', array('#CODE#' => $ViUser->GetError()->code)));
         return false;
     }
     $userData = CIMContactList::GetUserData(array('ID' => $this->userId, 'DEPARTMENT' => 'N', 'HR_PHOTO' => 'Y'));
     return array('SERVER' => str_replace('voximplant.com', 'bitrixphone.com', $userInfo['call_server']), 'LOGIN' => $userInfo['user_login'], 'HASH' => defined('BX_MOBILE') ? $userInfo['user_password'] : md5(time() . randString()), 'CALLERID' => $userInfo['user_backphone'], 'HR_PHOTO' => $userData['hrphoto']);
 }
Beispiel #2
0
<?php

if (!$USER->IsAdmin()) {
    return;
}
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/main/options.php');
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/voximplant/options.php');
CModule::IncludeModule('voximplant');
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("VI_TAB_SETTINGS"), "ICON" => "voximplant_config", "TITLE" => GetMessage("VI_TAB_TITLE_SETTINGS_2")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$ViAccount = new CVoxImplantAccount();
$ViAccount->UpdateAccountInfo();
if ($ViAccount->GetError()->error) {
    $accountName = '-';
    $accountBalance = '-';
    if ($ViAccount->GetError()->code == 'LICENCE_ERROR') {
        $errorMessage = GetMessage('VI_ACCOUNT_ERROR_LICENSE');
    } else {
        $errorMessage = GetMessage('VI_ACCOUNT_ERROR');
    }
} else {
    $accountName = $ViAccount->GetAccountName();
    $accountBalance = $ViAccount->GetAccountBalance() . ' ' . $ViAccount->GetAccountCurrency();
    $errorMessage = '';
}
if (strlen($_POST['Update']) > 0 && check_bitrix_sessid()) {
    if (strlen($_POST['PUBLIC_URL']) > 0 && strlen($_POST['PUBLIC_URL']) < 12) {
        $errorMessage = GetMessage('VI_ACCOUNT_ERROR_PUBLIC');
    } else {
        if (strlen($_POST['Update']) > 0) {
            COption::SetOptionString("voximplant", "portal_url", $_POST['PUBLIC_URL']);