Esempio n. 1
0
function sipstation_confirm_key($key)
{
    $xml_array = sipstation_get_config(trim($key));
    if ($xml_array['status'] == 'success') {
        switch ($xml_array['query_status']) {
            case 'SUCCESS':
                return 'valid';
            case 'TEMPNOTAVAIL':
                return 'tempnotavail';
            case 'BADKEY':
                sipstation_remove_key();
            default:
                return 'invalid';
        }
    } else {
        return $xml_array['status'];
    }
}
Esempio n. 2
0
    case "refresh_display":
        $action($_POST);
        exit;
        break;
    case "remove_all":
        //just delete and re-add
        foreach ($_POST['trunkid'] as $trunk_id) {
            core_trunks_del($trunk_id, 'sip');
        }
        sipstation_remove_key();
        needreload();
        break;
    case "edit":
        //just delete and re-add
        if ($remove_key) {
            sipstation_remove_key();
            $key_status = 'nokey';
        } elseif ($key_status == 'nokey') {
            // TOOD: provide feedback if they give blank blank key, maybe just js validation?
            $set_key_status = sipstation_set_key($account_key);
        }
        break;
    default:
}
$status = sipstation_check_key();
// nokey, valid, invalid, noserver, tempnotavail
?>
</div>
<div class="content">
  <!--h2><?php 
//echo _("Edit Settings");