예제 #1
0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * PHP Template.
 * Author: Sheetal Patil. Sun Microsystems, Inc.
 *
 */
session_start();
require_once "../etc/config.php";
$connection = DBConnection::getInstance();
$isFriend = Users_Controller::getInstance();
$user = $_REQUEST['query'];
$reqUser = $_REQUEST['reqUser'];
$flag = $_REQUEST['flag'];
$loggedinuser = $_SESSION["uname"];
if (!is_null($user) && !empty($user)) {
    $users = $isFriend->findUser($user, $loggedinuser, $connection);
}
ob_start();
require "../views/findUsers.php";
$fillContent = ob_get_clean();
if ($flag == "add") {
    $fillMessage = "<font color=green>Friendship requested</font>";
} else {
    if ($flag == "delete") {
        $fillMessage = "<font color=green>You have revoked your friendship request to " . $reqUser . "</font>";
예제 #2
0
파일: login.php 프로젝트: rshariffdeen/olio
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * PHP Template.
 * Author: Sheetal Patil. Sun Microsystems, Inc.
 * 
 * login.php processes the login request and forwards to the home page.
 *
 */
session_start();
require_once "../etc/config.php";
$connection = DBConnection::getInstance();
$register = Users_Controller::getInstance();
if ($_POST['submit'] == "Login") {
    $un = $_POST['user_name'];
    $pwd = $_POST['password'];
    $result = $register->authenticate($un, $pwd, $connection);
    if ($result->next()) {
        session_register("uname");
        $uname = $un;
        $sid = session_id();
        $_SESSION["uname"] = $uname;
        $_SESSION["sid"] = $sid;
        $success = "authenticated";
    }
    unset($result);
    $numFriendshipReq = $register->numFriendshipRequests($un, $connection);
    $_SESSION["friendshipreqs"] = $numFriendshipReq;
예제 #3
0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * PHP Template.
 * Author: Sheetal Patil. Sun Microsystems, Inc.
 *
 */
session_start();
require_once "../etc/config.php";
require_once '../etc/phpcassa_config.php';
$friends = Users_Controller::getInstance();
$person = $_REQUEST['person'];
$friend = $_REQUEST['friend'];
$revokeSql = new ColumnFamily($conn, 'PERSON_PERSON');
$index_exp_person = CassandraUtil::create_index_expression('Person_username', $friend);
$index_exp_friend = CassandraUtil::create_index_expression('friends_username', $person);
$index_clause = CassandraUtil::create_index_clause(array($index_exp_person, $index_exp_friend));
$result = $revokeSql->get_indexed_slices($index_clause);
foreach ($result as $key => $col) {
    $revokeSql->remove($col['id']);
}
$outgoingRequests = $friends->outgoingRequests($person, $conn);
echo "<font color=green>You have revoked your friendship request to " . $friend . "</font>\n";
echo $outgoingRequests;
?>