예제 #1
0
파일: resource_view.php 프로젝트: ztobs/wsf
        $href = $_GET["url"];
    }
    $rate = $_POST["rate"];
    $comment_area = $_POST["comment_area"];
}
$href = LABS_PHP_HOME . "/" . $href;
$aschild = isset($_GET["aschild"]);
if ($aschild) {
    $js_parency = "parent.";
} else {
    $js_parency = "window.";
}
//extracting data from registry,
$rr = new RemoteRegistry(REGISTRY_ATOM_INTERFACE, $username, $password);
if (isset($rate) && !empty($rate)) {
    $rr->rateResource($href, $rate);
}
if (isset($comment_area) && !empty($comment_area)) {
    $comment = new Comment();
    $comment->text = $comment_area;
    $comment->user = $username;
    $rr->addComment($href, $comment);
}
$content = $rr->get($href);
$title = $content->title;
$parent_title = $content->parent_path;
$extracted_title = substr($title, strlen($parent_title) + 1);
$author = $content->author_username;
$created_time = date('M d Y h:i:s A', (int) $content->created_time);
$last_updated_user = $content->last_updated_username;
$last_updated_time = date('M d Y h:i:s A', (int) strtotime($content->updated));
예제 #2
0
파일: login.php 프로젝트: ztobs/wsf
<?php

require_once "defines.php";
require_once REGISTRY_PATH . "RemoteRegistry.php";
session_start();
$username = $_POST["username"];
$password = $_POST["password"];
$login_failed = FALSE;
if ($username !== NULL && !empty($username)) {
    $rr = new RemoteRegistry(REGISTRY_ATOM_INTERFACE, $username, $password);
    $response = $rr->rateResource(LABS_PHP_HOME, 5);
    if ($response == "200") {
        $_SESSION["wsf_php_demo_site_username"] = $username;
        $_SESSION["wsf_php_demo_site_password"] = $password;
        header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php");
    } else {
        $login_failed = true;
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php 
if (WEB_VERSION == "php") {
    ?>
    <title>Login - PHP Web Services - Code, Samples, Demos and Tutorials</title>
<?php 
} else {