Ejemplo n.º 1
0
                $result = mysql_query($query);
                if (!$result) {
                    $ok = false;
                    $ret = 'Invalid query: ' . mysql_error() . "\n";
                    $ret .= 'Query: ' . $query;
                }
            } else {
                if (isset($_REQUEST['reply'])) {
                    $_to = $_REQUEST['to'];
                    $_name = $_REQUEST['name'];
                }
            }
        }
    }
    $messages = get_msg_count($_SESSION['webid']);
    $private_msg = get_msg_count($_SESSION['webid'], 1, 0);
}
// send a new message using the pingback protocol
if (isset($_REQUEST['doit']) && isset($_REQUEST['to'])) {
    $ret .= sendPing($_REQUEST['to'], $_REQUEST['message'], BASE_URI, true);
}
// display form to send local messages
$ret .= "<div class=\"wall-new r5\">\n";
$ret .= "<form method=\"post\" action=\"messages\">\n";
$ret .= "<input type=\"hidden\" name=\"doit\" value=\"1\" />\n";
$ret .= "<input type=\"hidden\" name=\"to\" id=\"to\" value=\"" . $_to . "\" />\n";
$ret .= "<table border=\"0\">\n";
$ret .= "<tr valign=\"top\">\n";
$ret .= "   <td style=\"width: 80px\"><p><a href=\"view?webid=" . urlencode($_SESSION["webid"]) . "\" target=\"_blank\">\n";
$ret .= "       <img class=\"r5\" title=\"" . $_SESSION['usr'] . "\" alt=\"" . $_SESSION['usr'] . "\" width=\"64\" src=\"" . $_SESSION['img'] . "\" />\n";
$ret .= "   </a></p></td>\n";
Ejemplo n.º 2
0
        $owner_hash = $_REQUEST['user'];
        // mark all wall messages as read when the user checks his personal wall
        if ($_SESSION['webid'] == $owner_webid) {
            $query = "UPDATE pingback_messages SET new='0' WHERE ";
            $query .= "to_hash='" . mysql_real_escape_string($_SESSION['user_hash']) . "' ";
            $query .= "AND wall='1'";
            $result = mysql_query($query);
            if (!$result) {
                $ret .= error('Database error while trying to update message status!');
            } else {
                if ($result !== true) {
                    mysql_free_result($result);
                }
            }
            $messages = get_msg_count($_SESSION['webid']);
            $wall_msg = get_msg_count($_SESSION['webid'], 1, 1);
        }
    } else {
        // display a warning for the user
        $warning = true;
    }
} else {
    // generic wall
    $feed_hash = 'local';
    $owner_webid = 'local';
    $owner_hash = 'local';
}
// delete a post
if (isset($_REQUEST['del'])) {
    // verify if we're logged in or not
    check_auth(IDP, $page_uri);
Ejemplo n.º 3
0
                $_SESSION['user_hash'] = $_SESSION['myprofile']->get_hash();
            }
        }
        // Store some data in the session
        setcookie('tzRemember', '1');
        // Log success
        $log->LogInfo("[SUCCESS] Authenticated " . $webid . " => " . $auth->authnDiagnostic);
    } else {
        // log reason why it failed
        $log->LogInfo("[FAILURE] Fail to authenticate " . $webid . " => " . $auth->authnDiagnostic);
    }
}
// Get the number of messages
if (isset($_SESSION['webid']) && $_SESSION['webid']) {
    $messages = get_msg_count($_SESSION['webid']);
    $wall_msg = get_msg_count($_SESSION['webid'], True, True);
}
// Bad place to add logic for adding/removing friends.
// add a specific person as friend
if (isset($_SESSION['myprofile']) && $_SESSION['myprofile']->is_local($webid) && isset($_REQUEST['action']) && $_REQUEST['action'] == 'addfriend') {
    // add friend and display confirmation
    $confirmation = $_SESSION['myprofile']->add_friend($_REQUEST['add_webid']);
    $_SESSION['myprofile'] = new MyProfile($_SESSION['webid'], BASE_URI, SPARQL_ENDPOINT);
    $_SESSION['myprofile']->load(true);
}
// remove a specific person from friends
if (isset($_SESSION['myprofile']) && $_SESSION['myprofile']->is_local($webid) && isset($_REQUEST['action']) && $_REQUEST['action'] == 'delfriend') {
    // remove friend and display confirmation
    $confirmation = $_SESSION['myprofile']->del_friend($_REQUEST['del_webid']);
    $_SESSION['myprofile'] = new MyProfile($_SESSION['webid'], BASE_URI, SPARQL_ENDPOINT);
    $_SESSION['myprofile']->load(true);
Ejemplo n.º 4
0
        $result = $db->query("SELECT * FROM cc" . $n . "_amessage WHERE allianzid='{$userdata['allianzid']}' AND boardid='{$boardid}' ORDER BY time DESC");
        while ($row = $db->fetch_array($result)) {
            $title = c_trim($row['title']);
            $text = c_trim($row['text']);
            $username = c_trim($row['username']);
            $dates = date("d.m.Y H:i:s", $row['time']);
            eval("\$allianz_message_bit .= \"" . $tpl->get("alliance_message_bit") . "\";");
        }
        eval("\$tpl->output(\"" . $tpl->get("ali_board_show") . "\");");
        exit;
    } else {
        $board = explode("\n", $allianz['boards']);
        for ($i = 0; $i < count($board); $i++) {
            $allianzboardid = $i + 1;
            $anzahl_msg = 0;
            $anzahl_msg = get_msg_count($allianzboardid);
            $boardname = c_trim($board[$i]);
            eval("\$allianz_board_bit .= \"" . $tpl->get("alliance_board_bit") . "\";");
        }
        eval("\$tpl->output(\"" . $tpl->get("ali_board") . "\");");
        exit;
    }
}
if ($action == "kick") {
    if ($userdata['is_ali_admin'] == 0) {
        show_error('ln_allianz_e_12', $modul_name);
        exit;
    }
    $kick_counter = 0;
    $result = $db->query("SELECT * FROM cc" . $n . "_users WHERE allianzid='" . $allianz['aid'] . "'");
    while ($row = $db->fetch_array($result)) {