Esempio n. 1
0
function gs_get_lang_global($gs_lang_opt, $gs_lang_format)
{
    $lang = "";
    switch ($gs_lang_opt) {
        case GS_LANG_OPT_AST:
            $lang_src = gs_get_conf("GS_INTL_ASTERISK_LANG");
            break;
        case GS_LANG_OPT_GS:
            $lang_src = gs_get_conf("GS_INTL_LANG");
            break;
        default:
            return false;
    }
    switch ($gs_lang_format) {
        case GS_LANG_FORMAT_AST:
            return substr($lang_src, 0, 2);
            break;
        case GS_LANG_FORMAT_GS:
            if ($gs_lang_opt == GS_LANG_OPT_GS) {
                return $lang_src;
            }
            return gs_lang_ast2gs($lang_src);
            break;
        default:
            return false;
            break;
    }
    return false;
}
Esempio n. 2
0
    case "500":
        $phone_has_microbrowser = FALSE;
        break;
    default:
        $phone_has_microbrowser = TRUE;
        break;
}
$db = gs_db_slave_connect();
//---debug
$user_id = @gs_prov_user_id_by_mac_addr($db, $mac);
if (!$user_id) {
    die;
}
$userinfo = @gs_prov_get_user_info($db, $user_id);
// setup i18n stuff
gs_setlang(gs_lang_ast2gs($userinfo["language"]));
gs_loadtextdomain('gemeinschaft-gui');
gs_settextdomain('gemeinschaft-gui');
//--- echo the phone directory
echo '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>' . "\n";
if (!$phone_has_microbrowser) {
    //--- this phone does not have microbrowser capabilities, so create
    //--- a company directory based on the local users table
    $query = 'SELECT ' . '  `u`.`lastname` `ln`, `u`.`firstname` `fn`, `s`.`name` `ext` ' . 'FROM ' . '  `users` `u` ' . 'JOIN ' . '  `ast_sipfriends` `s` ON (`s`.`_user_id`=`u`.`id`) ' . 'WHERE ' . '  `u`.`pb_hide` = 0 ' . '  AND `u`.`nobody_index` IS NULL ' . 'ORDER BY `u`.`lastname`, `u`.`firstname`';
    $rs = $db->execute($query);
    if ($rs->numRows() !== 0) {
        echo '<directory>', "\n";
        echo '   <item_list>', "\n";
        while ($r = $rs->fetchRow()) {
            echo '      <item>', "\n";
            echo '         <fn>' . $r['fn'] . '</fn>', "\n";