Пример #1
0
function get_default_code($smarty, $module_name, &$pDB, $arrConf, $credentials)
{
    $jsonObject = new PaloSantoJSON();
    $feature = getParameter("fc_name");
    if ($credentials['userlevel'] == 'superadmin') {
        $domain = getParameter('organization');
    } else {
        $domain = $credentials['domain'];
    }
    $pFC = new paloFeatureCodePBX($pDB, $domain);
    if (!$pFC->validateFeatureCodePBX()) {
        $jsonObject->set_error(_tr("Invalid Organization"));
    } else {
        $arrFC = $pFC->getFeaturesCode($domain, $feature);
        if ($arrFC == FALSE) {
            $jsonObject->set_error(_tr($pFC->errMsg));
        } else {
            $jsonObject->set_message($arrFC);
        }
    }
    return $jsonObject->createJSON();
}