Esempio n. 1
0
                        $POD->currentUser()->addMeta('twitter_secret', $access_token_info['oauth_token_secret']);
                        $POD->currentUser()->addMeta('twitter_name', (string) $json->screen_name);
                        $POD->currentUser()->addMeta('twitter_id', (string) $json->id);
                        $POD->addMessage("You have successfully connected your Twitter account.");
                    } else {
                        $POD->addMessage("Another account is already connected to the Twitter account you chose.");
                    }
                } else {
                    // is there a person with this twitter info already in the db?  if so, log her in!
                    $user = $POD->getPeople(array('twitter_token' => $access_token_info['oauth_token']));
                    if ($user->count() == 1) {
                        $user = $user->getNext();
                        // if so, and the user is logged out, log him in!
                        $days = 15;
                        setcookie('pp_auth', $user->get('authSecret'), time() + 86400 * $days, "/");
                        header("Location: " . $POD->siteRoot(false));
                        exit;
                    }
                }
            }
        }
    } catch (OAuthException $E) {
        $POD->addMessage("Your Twitter login failed. Try again!");
    }
}
if (isset($_GET['group'])) {
    setcookie('pp_group', $_GET['group'], time() + 60 * 60 * 24 * 30, "/");
}
$POD->header('Connect with Twitter');
if (!$POD->isAuthenticated()) {
    $user = $POD->getPerson();
Esempio n. 2
0
* Handles permalinks, comments and voting for this type of content
*
* Documentation for this pod can be found here:
* http://peoplepods.net/readme/new-content-type
/**********************************************/
include_once "content_type.php";
// this defines some variables for use within this pod
include_once "../../PeoplePods.php";
if ($_POST) {
    $lockdown = 'verified';
} else {
    $lockdown = null;
}
$POD = new PeoplePod(array('debug' => 0, 'lockdown' => $lockdown, 'authSecret' => @$_COOKIE['pp_auth']));
if (!$POD->libOptions("enable_core_pages")) {
    header("Location: " . $POD->siteRoot(false));
    exit;
}
if (isset($_GET['stub'])) {
    $doc = $POD->getContent(array('stub' => $_GET['stub']));
} else {
    if (isset($_GET['id'])) {
        $doc = $POD->getContent(array('id' => $_GET['id']));
    } else {
        if (isset($_POST['id'])) {
            $doc = $POD->getContent(array('id' => $_POST['id']));
        }
    }
}
if (!$doc->success()) {
    header("Status: 404 Not Found");
Esempio n. 3
0
* This file is part of PeoplePods
* (c) xoxco, inc  
* http://peoplepods.net http://xoxco.com
*
* core_usercontent/list.php
* Handles the blog style reverse chronological list this type of content
*
* Documentation for this pod can be found here:
* http://peoplepods.net/readme/new-content-type
/**********************************************/
include_once "content_type.php";
// this defines some variables for use within this pod
include_once "../../PeoplePods.php";
$POD = new PeoplePod(array('authSecret' => @$_COOKIE['pp_auth'], 'debug' => 0));
if (!$POD->libOptions("enable_contenttype_{$content_type}_list")) {
    header("Location: " . $POD->siteRoot(false));
    exit;
}
$offset = 0;
if (isset($_GET['offset'])) {
    $offset = $_GET['offset'];
}
$wikis = $POD->getContents(array('type' => $content_type));
$POD->header('List of supported wikis!');
?>

	<div class="column_8">
		<? 
		if ($POD->libOptions("enable_contenttype_wiki_add")) 
			if($POD->isAuthenticated() && $POD->currentUser()->get('adminUser')){ ?>
				<p>Add a new wiki now! <a href="<? $POD->siteRoot(); echo $edit_pattern; ?>">Click here!</a></p>
Esempio n. 4
0
* Documentation for this pod can be found here:
* http://peoplepods.net/readme
/**********************************************/


	include_once("../../PeoplePods.php");
	if ($_POST || isset($_GET['command'])) { 
		$lockdown = 'verified';
	} else {
		$lockdown = null;
	}

	$POD = new PeoplePod(array('debug'=>0,'lockdown'=>$lockdown,'authSecret'=>@$_COOKIE['pp_auth']));

	if (!$POD->libOptions('enable_core_groups')) { 
		header("Location: " . $POD->siteRoot(false));
		exit;
	}
	
	$group = $POD->getGroup(array('stub'=>$_GET['stub']));
	
	if (!$group->success()) {
		header("Status: 404 Not Found");
		echo "404 Not Found";
		exit;
	}
	if ($group->get('type')=="private") { 
		if (!$POD->isAuthenticated() || !$group->isMember($POD->currentUser())) { 
			header("Status: 404 Not Found");
			echo "404 Not Found";
			exit;
Esempio n. 5
0
			/lists/tags/foo
			/lists/user/benbrown/tags/foo
			/lists/type/post
			/lists/type/post/tag/foo
			/lists/search/keyword
			/lists/type/post/search/keyword


*
* Documentation for this pod can be found here:
* http://peoplepods.net/readme
/**********************************************/
include_once "../../PeoplePods.php";
$POD = new PeoplePod(array('authSecret' => @$_COOKIE['pp_auth']));
if (!$POD->libOptions('enable_core_feeds')) {
    header("Location: " . $POD->siteRoot(false));
    exit;
}
// lets parse the parameters we got passed in so we know what kind of feed to create
$arguments = explode("/", $_GET['args']);
$field = null;
foreach ($arguments as $arg) {
    if ($field) {
        $param[$field] = $arg;
        $field = null;
    } else {
        $field = $arg;
    }
}
// set up our fail indicator var
$REDALERT = false;
Esempio n. 6
0
* This file is part of PeoplePods
* (c) xoxco, inc  
* http://peoplepods.net http://xoxco.com
*
* core_usercontent/edit.php
* Handles the add/edit form for this type of content
*
* Documentation for this pod can be found here:
* http://peoplepods.net/readme/new-content-type
/**********************************************/
include_once "content_type.php";
// this defines some variables for use within this pod
include_once "../../PeoplePods.php";
$POD = new PeoplePod(array('debug' => 0, 'lockdown' => 'verified', 'authSecret' => @$_COOKIE['pp_auth']));
if (!$POD->libOptions("enable_contenttype_{$content_type}_add")) {
    header("Location: " . $POD->siteRoot(false));
    exit;
}
// by default, this script will redirect to the homepage of the site.
// this can be changed by passing in an alternative via the redirect parameter
$redirect = $POD->siteRoot(false);
if ($_POST) {
    if (isset($_POST['id'])) {
        $content = $POD->getContent(array('id' => $_POST['id']));
        if (!$content->success()) {
            $POD->addMessage($content->error());
        }
        if (!$content->isEditable()) {
            $POD->addMessage("Access Denied");
        }
    } else {
Esempio n. 7
0
			/feeds/tags/foo
			/feeds/user/benbrown/tags/foo
			/feeds/type/post
			/feeds/type/post/tag/foo
			/feeds/search/keyword
			/feeds/type/post/search/keyword


*
* Documentation for this pod can be found here:
* http://peoplepods.net/readme
/**********************************************/
include_once "../../PeoplePods.php";
$POD = new PeoplePod(array('authSecret' => @$_COOKIE['pp_auth']));
if (!$POD->libOptions('enable_core_feeds')) {
    header("Location: " . $POD->siteRoot(false));
    exit;
}
require_once "class.rss.php";
// ****************************************************************************//
// FEED HELPER FUNCTIONS
// ****************************************************************************//
$asc2uni = array();
for ($i = 128; $i < 256; $i++) {
    $asc2uni[chr($i)] = "&#x" . dechex($i) . ";";
}
function xmlformat($str)
{
    global $asc2uni;
    $str = str_replace("&", "&amp;", $str);
    $str = str_replace("<", "&lt;", $str);
Esempio n. 8
0
$display = 'page';
if (strpos($_SERVER['HTTP_USER_AGENT'], "iPhone") || strpos($_SERVER['HTTP_USER_AGENT'], "Android")) {
    //	$display='touch';
}
if (!($key && $secret)) {
    $POD->header('Configuration Required');
    echo '<div class="info">Configuration required!</div>';
    echo '<p>To enable Facebook login, please set the Facebook API key and secret via the PeoplePods command center.</p>';
    echo '<P>To obtain the necessary details from Facebook, <a href="http://www.facebook.com/developers/">register your app</a>.</p>';
    $POD->footer();
    exit;
}
$user = null;
if (isset($_GET['code'])) {
    $code = $_GET['code'];
    $oauth_token = file_get_contents("https://graph.facebook.com/oauth/access_token?client_id=" . $key . "&redirect_uri=" . $POD->siteRoot(false) . "/facebook&client_secret=" . urlencode($secret) . "&code=" . urlencode($code));
    list($junk, $oauth_token) = explode("=", $oauth_token);
    // if authenticated, add to user
    // if not, new user time!
    if ($POD->isAuthenticated() && !$POD->currentUser()->facebook_token) {
        $user = $POD->currentUser();
        $test = $POD->getPeople(array('facebook_token' => $oauth_token));
        if ($test->count() == 0) {
            $user->addMeta('facebook_token', $oauth_token);
            $json = $user->getFacebookInfo();
            $user->set('fbuid', $json->id);
            $POD->addMessage("You have successfully connected your Facebook account.");
        } else {
            $POD->addMessage("Another account is already connected to the Facebook account you chose.");
        }
    } else {
Esempio n. 9
0
/***********************************************
* This file is part of PeoplePods
* (c) xoxco, inc  
* http://peoplepods.net http://xoxco.com
*
* core_profiles/profile.php
* Handles requests to user profiles
*
* Documentation for this pod can be found here:
* http://peoplepods.net/readme/messaging
/**********************************************/
include_once "../../PeoplePods.php";
$POD = new PeoplePod(array('debug' => 0, 'authSecret' => @$_COOKIE['pp_auth']));
if (!$POD->libOptions('enable_core_profiles')) {
    header("Location: " . $POD->siteRoot(false));
    exit;
}
$profile_username = $_GET['username'];
$PROFILE_PERSON = $POD->getPerson(array('stub' => $profile_username));
if ($POD->isAuthenticated()) {
    $POD->currentUser()->expireAlertsAbout($PROFILE_PERSON);
}
if ($PROFILE_PERSON->success()) {
    $POD->header($PROFILE_PERSON->get('nick'), $POD->siteRoot(false) . '/feeds/person/' . $PROFILE_PERSON->get('stub'));
    $PROFILE_PERSON->output();
    $POD->footer();
} else {
    header("Status: 404 Not Found");
    echo "404 Not Found";
}