Пример #1
0
$info = array();
$retinfo = $xmlrpc->do_getsessioninfo($vserver_id, $ip);
if (is_array($retinfo)) {
    // Send stop accounting to Radius
    $ip =& $retinfo["ip"];
    $username =& $retinfo["username"];
    $session_id =& $retinfo["session_id"];
    $session_start =& $retinfo["session_start"];
    $mac_address =& $retinfo["mac_address"];
    $isinfo = true;
} else {
    $valid = false;
}
if (!empty($_POST['do_logout'])) {
    if ($isinfo) {
        $result = $xmlrpc->do_stopsession($vserver_id, $ip, returnMacAddress(), RADIUS_TERM_USER_REQUEST);
        if ($result === true) {
            $valid = false;
            $message = get_message('OK_USER_LOGOUT');
            $isstopacct = true;
        } else {
            $valid = false;
            $message = get_message('ERR_LOGOUT_FAILED');
            $show_info = true;
        }
    }
    if ($isstopacct) {
        // Send account stop to radius
        $racct = new rahu_radius_acct($username);
        $racct->host = $config["RADIUS_HOST"];
        $racct->port = $config["RADIUS_ACCT_PORT"];