peepagg-cvs Mailing List for People Aggregator
Brought to you by:
chalko,
marccanter
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(28) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sv...@2n...> - 2004-04-08 16:20:34
|
Author: esigler
Date: 2004-04-08 09:19:55 -0700 (Thu, 08 Apr 2004)
New Revision: 66
Added:
trunk/publicroot/htaccess-dist
trunk/publicroot/preferences.php
trunk/templates/html/preferences.tpl
Modified:
trunk/classes/paUserInfo.php
trunk/docs/INSTALL
trunk/lib/cache.php
trunk/lib/rdf.php
trunk/publicroot/
trunk/publicroot/private.php
trunk/publicroot/thumbnail.php
trunk/publicroot/view.php
trunk/schema/database.sql
trunk/templates/html/private.tpl
Log:
Removed .htaccess from being a version-controlled resource.=20
Added htaccess-dist (like config.php/config.php-dist).
(Makes it so potential installers _have to_ poke at certain things,
and also gets our bot ban list out of the public eye.)
Created preferences pages (for certain kinds of info display).
Not done yet, but use /preferences to see the current work.
Thumbnailer (aka not just scaling the images, but actually shrinking them=
+ caching them)
Database tables added in this revision:
CREATE TABLE user_preferences (
id int(10) NOT NULL AUTO_INCREMENT,
user_id int(10) NOT NULL,
pref_name varchar(255) NOT NULL,
pref_value text,=20
PRIMARY KEY (id),
UNIQUE ID (id)
);
CREATE TABLE thumbcache (
id int(10) NOT NULL AUTO_INCREMENT,
url varchar(255),
data text,
type varchar(255), =20
timestamp timestamp,
PRIMARY KEY (id),
UNIQUE ID (id)
);
Note also, that thumbnail.php currently does a system call
to "convert", which is a part of ImageMagick. Future revs
will probably do something different for image manip.
Install docs updated to reflect changes.
Modified: trunk/classes/paUserInfo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/classes/paUserInfo.php 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/classes/paUserInfo.php 2004-04-08 16:19:55 UTC (rev 66)
@@ -272,6 +272,43 @@
function __wakeup() {
$this->refresh();
}
+
+ function setPref($pref_name, $pref_value) {
+ global $database;
+ $safe_name =3D $database->qstr($pref_name);
+ $safe_value =3D $database->qstr($pref_value);
+ if($this->getPref($pref_name)) {
+ if($pref_value) {
+ $sql =3D "UPDATE user_preferences SET pref_value=3D$safe_val=
ue WHERE user_id=3D'$this->userID' AND pref_name=3D$safe_name";
+ } else {
+ $sql =3D "DELETE FROM user_preferences WHERE user_id=3D'$thi=
s->userID' AND pref_name=3D$safe_name";
+ }
+ } else {
+ if($pref_value) {
+ $sql =3D "INSERT INTO user_preferences (user_id, pref_name, =
pref_value) VALUES ('$this->userID', $safe_name, $safe_value)";
+ }
+ }
+
+ if($sql)
+ $database->Execute($sql);
+ }
+ =20
+ function getPref($pref_name) {
+ global $database;
+ $safe_pref =3D $database->qstr($pref_name);
+ $sql =3D "SELECT pref_value FROM user_preferences WHERE user_id=3D=
'$this->userID' AND pref_name=3D$safe_pref";
+ $results =3D $database->Execute($sql);
+ if($results) {
+ if($results->RecordCount()) {
+ $row =3D $results->FetchRow();
+ return $row["pref_value"];
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
}
=20
?>
Modified: trunk/docs/INSTALL
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/INSTALL 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/docs/INSTALL 2004-04-08 16:19:55 UTC (rev 66)
@@ -25,10 +25,15 @@
=20
This section is most likely incomplete.
=20
+Also, currently, PeopleAggregator uses ImageMagick to shrink images and
+thumbnail them. Make sure "convert" is in a web-server accessable path.
+This will change in future releases.
+
PeopleAggregator Installation:
=20
1) Load schema/database.sql into the MySQL database of your choice
2) Move lib/config.php-dist to lib/config.php and change everything to t=
he information you wish=20
+3) Move publicroot/htaccess-dist to publicroot/.htaccess and change ever=
ything as appropriate
3) Make a temp file directory (/tmp/pa usually) and make it webserver wr=
itable
4) Point a webserver at publicroot
5) You're up and running!
Modified: trunk/lib/cache.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lib/cache.php 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/lib/cache.php 2004-04-08 16:19:55 UTC (rev 66)
@@ -11,7 +11,7 @@
function fetch_url($url) {
//OK, we look up the URL in the db, and if it's there, and less than =
X hours old, we get it!
=20
- global $database;
+ global $database, $pa_server_url;
=20
//FIXME: We need to make sure that there's a proper http: in front of=
this URL
if(!pa_is_url_valid($url))
Modified: trunk/lib/rdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lib/rdf.php 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/lib/rdf.php 2004-04-08 16:19:55 UTC (rev 66)
@@ -127,6 +127,7 @@
}
=20
function makemodel($url) {
+ global $pa_server_url;
$parser =3D new RdfParser();
=20
//This little ereg saves us the task of having to go "http" fetch a p=
rofile if we know it's local.
@@ -147,6 +148,10 @@
set_error_handler("parser_error_handler");
$model =3D $parser->generateModel($rdf_data);
restore_error_handler();
+
+ if($model)
+ $model->index();
+
return $model;
} else {
return false;
Property changes on: trunk/publicroot
___________________________________________________________________
Name: svn:ignore
+ .htaccess
Copied: trunk/publicroot/htaccess-dist (from rev 65, trunk/publicroot/.ht=
access)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/.htaccess 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/publicroot/htaccess-dist 2004-04-08 16:19:55 UTC (rev 66)
@@ -0,0 +1,16 @@
+php_flag allow_url_fopen 1
+php_flag magic_quotes_gpc 0=20
+
+RewriteEngine on
+RewriteCond %{HTTP_HOST} ^www\.peopleaggregator\.com$ [NC]
+RewriteRule ^(.*)$ http://peopleaggregator.com/$1 [R=3D301,L]
+
+RewriteCond %{SERVER_PORT} !^80$
+RewriteRule ^(.*)$ http://peopleaggregator.com/$1 [R=3D301,L]
+
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ /$1.php=20
+
+ErrorDocument 404 /error.php
+ErrorDocument 403 /error.php
Property changes on: trunk/publicroot/htaccess-dist
___________________________________________________________________
Name: svn:executable
+=20
Added: trunk/publicroot/preferences.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/preferences.php 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/publicroot/preferences.php 2004-04-08 16:19:55 UTC (rev 66)
@@ -0,0 +1,27 @@
+<?php
+
+require_once("../lib/main.php");
+must_be_logged_in();
+
+if(isset($_REQUEST["submit"])) {
+ $paUserInfo->setPref("private_showpendinggroups",$_REQUEST["showpendi=
nggroups"]);
+ $paUserInfo->setPref("private_showgroups",$_REQUEST["showgroups"]);
+ $paUserInfo->setPref("private_showpendingrels",$_REQUEST["showpending=
rels"]);
+ $paUserInfo->setPref("private_showrels",$_REQUEST["showrels"]);
+ $paUserInfo->setPref("breadcrumbs",$_REQUEST["breadcrumbs"]);
+ pa_add_sysnote("The changes to your preferences have been saved.");
+ redirect("private");
+}
+
+$crumbs =3D array("1","2","3","4","5","6","7","10","15","20","50");
+
+$template->assign("preferences_showpendinggroups", $paUserInfo->getPref(=
"private_showpendinggroups"));
+$template->assign("preferences_showgroups", $paUserInfo->getPref("privat=
e_showgroups"));
+$template->assign("preferences_showpendingrels", $paUserInfo->getPref("p=
rivate_showpendingrels"));
+$template->assign("preferences_showrels", $paUserInfo->getPref("private_=
showrels"));
+$template->assign("preferences_breadcrumbs", $paUserInfo->getPref("bread=
crumbs"));
+$template->assign("crumbs", $crumbs);
+
+$template->display("preferences.tpl");
+
+?>
Modified: trunk/publicroot/private.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/private.php 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/publicroot/private.php 2004-04-08 16:19:55 UTC (rev 66)
@@ -36,6 +36,12 @@
if(isset($consumed["friends"]))
$template->assign('profile_friends',$consumed["friends"]);
=20
+ $template->assign("preferences_showpendinggroups", $paUserInfo->ge=
tPref("private_showpendinggroups"));
+ $template->assign("preferences_showgroups", $paUserInfo->getPref("=
private_showgroups"));
+ $template->assign("preferences_showpendingrels", $paUserInfo->getP=
ref("private_showpendingrels"));
+ $template->assign("preferences_showrels", $paUserInfo->getPref("pr=
ivate_showrels"));
+ $template->assign("preferences_breadcrumbs", $paUserInfo->getPref(=
"breadcrumbs"));
+
$template->display('private.tpl');
} else {
error_page("Unable to retrieve profile!","Sorry, but I was unable =
to retrieve your user profile. Something's not right.");
Modified: trunk/publicroot/thumbnail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/thumbnail.php 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/publicroot/thumbnail.php 2004-04-08 16:19:55 UTC (rev 66)
@@ -1,81 +1,61 @@
<?php
=20
require_once("../lib/main.php");
+require_once("../lib/image_size.func.php");
=20
-if(file_exists($pa_file_location."/thumbs/".md5($_REQUEST["url"])."-thum=
b")) {
- @clearstatcache();
- $requested_time =3D strtotime($_SERVER['HTTP_IF_modified_SINCE']);
- $file_time =3D filemtime($pa_file_location."/thumbs/".md5($_REQUEST["=
url"])."-thumb");
- header("Last-modified: " . gmdate("D, d M Y H:i:s",$file_time) . " GM=
T");
+if($_REQUEST["url"]) {
+ $url =3D $database->qstr($_REQUEST["url"]);
+ $sha1url =3D sha1($url);
=20
- if( $file_time=3D=3D$requested_time ) {
- header("{$_SERVER['SERVER_PROTOCOL']} 304 not modified");
- exit();
- } else {=20
- $image_path =3D $pa_file_location."/thumbs/pa-base-file-".md5($_REQUE=
ST["url"]);
- $ch =3D curl_init(ereg_replace("%20","",$_REQUEST["url"]));
- $fp =3D fopen($image_path,"w");
+ $sql =3D "SELECT * FROM thumbcache WHERE url=3D'$sha1url'";
+ $result =3D $database->Execute($sql);
=20
- curl_setopt($ch,CURLOPT_FILE,$fp);
- curl_setopt($ch,CURLOPT_HEADER,0);
- curl_exec($ch);
- curl_close($ch);
- fclose($fp);
+ if($result->RecordCount()) {
+ $row =3D $result->FetchRow();
+ $data =3D $row["data"];
+ $image =3D base64_decode($data);
+ header("Content-type: ".$row["type"]);
+ echo $image;
+ } else {
+ //Fetch image.
+ $image_path =3D $pa_tmp_location."/tnail-$sha1url";
+ $ch =3D curl_init($_REQUEST["url"]);
+ $file =3D fopen($image_path,"w");
=20
- $current_file =3D $image_path;
- $max_width =3D "64";
+ curl_setopt($ch,CURLOPT_FILE,$file);
+ curl_setopt($ch,CURLOPT_HEADER,0);
+ curl_exec($ch);
+ curl_close($ch);
+ fclose($file);
=20
- $current_size =3D getimagesize($current_file);
- $current_img_width =3D $current_size[0];
- $current_img_height =3D $current_size[1];
+ //Shrink image.
+ $image_size =3D image_size($image_path, 64, 64);
=20
- $new_file =3D $pa_file_location."/thumbs/".md5($_REQUEST["url"])."-th=
umb";
+ $new_image_path =3D $pa_tmp_location."/tnail-tmp-$sha1url";
+ $new_img_width =3D $image_size["width"];
+ $new_img_height =3D $image_size["height"];
=20
- $too_big_diff_ratio =3D $current_img_width/$max_width;
- $new_img_width =3D $max_width;
- $new_img_height =3D round($current_img_height/$too_big_diff_ratio);
+ $make_magick =3D system("convert -geometry $new_img_width x $new_i=
mg_height $image_path $new_image_path", $retval);
=20
- $make_magick =3D system("convert -geometry $new_img_width x $new_img_=
height $current_file $new_file", $retval);
+ //Grok image.
+ $type =3D image_type_to_mime_type(exif_imagetype($new_image_path))=
;
=20
- $handle =3D fopen ($new_file, "r");
- $contents =3D fread ($handle, filesize ($new_file));
- fclose ($handle);
- header("Content-type: image/jpeg");
- echo $contents;
- unlink($current_file);
- }
-} else {
- $image_path =3D $pa_file_location."/thumbs/pa-base-file-".md5($_REQUE=
ST["url"]);
- $ch =3D curl_init(ereg_replace("%20","",$_REQUEST["url"]));
- $fp =3D fopen($image_path,"w");
+ $data =3D base64_encode(file_get_contents($new_image_path));
+ if(!$data)
+ exit(); //FIXME: Could probably do something better here.
=20
- curl_setopt($ch,CURLOPT_FILE,$fp);
- curl_setopt($ch,CURLOPT_HEADER,0);
- curl_exec($ch);
- curl_close($ch);
- fclose($fp);
+ //Store image.
+ $sql =3D "INSERT INTO thumbcache (url, data, type) VALUES ('$sha1u=
rl','$data','$type')";
+ $database->Execute($sql);
=20
- $current_file =3D $image_path;
- $max_width =3D "64";
+ //Get rid of temp files.
+ unset($new_image_path);
+ unset($image_path);
=20
- $current_size =3D getimagesize($current_file);
- $current_img_width =3D $current_size[0];
- $current_img_height =3D $current_size[1];
-
- $new_file =3D $pa_file_location."/thumbs/".md5($_REQUEST["url"])."-th=
umb";
-
- $too_big_diff_ratio =3D $current_img_width/$max_width;
- $new_img_width =3D $max_width;
- $new_img_height =3D round($current_img_height/$too_big_diff_ratio);
-
- $make_magick =3D system("convert -geometry $new_img_width x $new_img_=
height $current_file $new_file", $retval);
-
- $handle =3D fopen ($new_file, "r");
- $contents =3D fread ($handle, filesize ($new_file));
- fclose ($handle);
- header("Content-type: image/jpeg");
- echo $contents;
- unlink($current_file);
+ //Show image.
+ header("Content-type: $type");
+ echo base64_decode($data);
+ }
}
=20
?>
Modified: trunk/publicroot/view.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/view.php 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/publicroot/view.php 2004-04-08 16:19:55 UTC (rev 66)
@@ -20,7 +20,7 @@
=20
//Figure out if this profile is owned by the viewer.
foreach($paUserInfo->getAllProfileIDs() as $user_profile) {
- $profile_url =3D "$pa_sever_url/profile?id=3D".$user_profile[0];
+ $profile_url =3D "$pa_server_url/profile?id=3D".$user_profile[0];
if($profile_url =3D=3D $url) {
$lookingatself =3D true;
$template->assign('lookingatself',$lookingatself);
Modified: trunk/schema/database.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/schema/database.sql 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/schema/database.sql 2004-04-08 16:19:55 UTC (rev 66)
@@ -1,3 +1,24 @@
+### two tables added by esigler 4/8/04 --- for thumbnail caching and use=
r-level preferences
+
+CREATE TABLE user_preferences (
+ id int(10) NOT NULL AUTO_INCREMENT,
+ user_id int(10) NOT NULL,
+ pref_name varchar(255) NOT NULL,
+ pref_value text,
+ PRIMARY KEY (id),
+ UNIQUE ID (id)
+);
+
+CREATE TABLE thumbcache (
+ id int(10) NOT NULL AUTO_INCREMENT,
+ url varchar(255),
+ data text,
+ type varchar(255),
+ timestamp timestamp,
+ PRIMARY KEY (id),
+ UNIQUE ID (id)
+);
+
## three tables added by Liz, first week of April, 2004 -- necessary for=
the message boards
=20
=20
Added: trunk/templates/html/preferences.tpl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/templates/html/preferences.tpl 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/templates/html/preferences.tpl 2004-04-08 16:19:55 UTC (rev 66)
@@ -0,0 +1,22 @@
+{include file=3D"header.tpl" title=3D"PeopleAggregator"}
+{include file=3D"body_top.tpl"}
+ <div id=3D"pageContent">
+ <div id=3D"fullPage">
+ <h1>{localize tag=3D"prefs-title"}:</h1>
+ <form method=3D"post" action=3D"preferences">
+ <h2>{localize tag=3D"prefs-private-title"}:</h2>
+ {localize tag=3D"prefs-private-showpendinggroups"}: <input t=
ype=3D"checkbox" name=3D"showpendinggroups" value=3D"1" {if $preferences_=
showpendinggroups}checked{/if} /><br />
+ {localize tag=3D"prefs-private-showgroups"}: <input type=3D"=
checkbox" name=3D"showgroups" value=3D"1" {if $preferences_showgroups}che=
cked{/if} /><br />
+ {localize tag=3D"prefs-private-showpendingrels"}: <input typ=
e=3D"checkbox" name=3D"showpendingrels" value=3D"1" {if $preferences_show=
pendingrels}checked{/if} /><br />
+ {localize tag=3D"prefs-private-showrels"}: <input type=3D"ch=
eckbox" name=3D"showrels" value=3D"1" {if $preferences_showrels}checked{/=
if} /><br />
+ <hr />
+ <h2>{localize tag=3D"prefs-nav-title"}</h2>
+ {localize tag=3D"prefs-nav-crumbs"}: <select name=3D"breadcr=
umbs">
+ {html_options values=3D$crumbs selected=3D$preferences_bread=
crumbs output=3D$crumbs}
+ </select>
+ <hr />
+ <input type=3D"submit" name=3D"submit" value=3D"{localize ta=
g=3D"prefs-submit"}" />
+ </form>
+ </div>
+ </div>
+{include file=3D"body_bottom.tpl"}
Property changes on: trunk/templates/html/preferences.tpl
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/templates/html/private.tpl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/templates/html/private.tpl 2004-04-08 06:08:25 UTC (rev 65)
+++ trunk/templates/html/private.tpl 2004-04-08 16:19:55 UTC (rev 66)
@@ -20,13 +20,14 @@
<a href=3D"create">{localize tag=3D"personal-createnewpersonali=
ty"}</a> -
<a href=3D"delete?id=3D{$profile_id}">{localize tag=3D"personal=
-deleteprofile"}</a> -=20
<a href=3D"{$profile_url}">{localize tag=3D"personal-viewrdf"}<=
/a> <br />
- <strong>Community:</strong>
- Create a new Community -
+ <strong>Group:</strong>
+ <a href=3D"all_groups">List all groups</a> -
+ <a href=3D"creategroup">Create a group</a>
</p>
=20
<!-- FIXME: Show pending memberships here -->
=20
- {if $prefs.showgroupmemberships and $memberships}=20
+ {if $preferences_showmemberships and $memberships}=20
<h3>Group memberships:</h3>
<p class=3D"p1">
{section name=3Dinc loop=3D$memberships}
@@ -35,7 +36,7 @@
</p>
{/if}
=20
- {if $prefs.showpendingrelationships and $waiting_relationships}
+ {if $preferences_showpendingrels and $waiting_relationships}
<h3>{localize tag=3D"personal-waitingrels"}:</h3>
<table align=3D"center">
{section name=3Dwaiting loop=3D$waiting_relationships}
@@ -62,7 +63,7 @@
</table>
{/if}
=20
- {if $prefs.showrelationships and $profile_friends}
+ {if $preferences_showrels and $profile_friends}
<h3>{localize tag=3D"personal-rels"}:</h3>
<table align=3D"center">
{section name=3Dfriend loop=3D$profile_friends}
|
|
From: <sv...@2n...> - 2004-04-08 06:09:31
|
Author: crschmidt
Date: 2004-04-07 23:08:25 -0700 (Wed, 07 Apr 2004)
New Revision: 65
Modified:
trunk/publicroot/view.php
trunk/templates/html/view.tpl
Log:
Technorati "tracker" image and so on still displayed when=20
technorati_lookup_bloginfo was set to fales. Fix this behavior: if we're=20
not loading technorati stuff, we dont' need to display a technorati=20
image.
One line addition to view.php + if loop around the technorati div in=20
view.tpl.
Modified: trunk/publicroot/view.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/view.php 2004-04-08 02:59:48 UTC (rev 64)
+++ trunk/publicroot/view.php 2004-04-08 06:08:25 UTC (rev 65)
@@ -61,7 +61,7 @@
=20
if(isset($consumed["friends"]))
$template->assign('profile_friends',$consumed["friends"]);
-
+ $template->assign('technorati_lookup_bloginfo', $technorati_lookup_bl=
oginfo);
if(isset($consumed["weblogs"])) {
$blogs =3D array();
foreach($consumed["weblogs"] as $weblog) {
Modified: trunk/templates/html/view.tpl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/templates/html/view.tpl 2004-04-08 02:59:48 UTC (rev 64)
+++ trunk/templates/html/view.tpl 2004-04-08 06:08:25 UTC (rev 65)
@@ -114,12 +114,14 @@
<p class=3D"p1">
{section name=3Dinc loop=3D$view_consumedmodel.weblogs}
{localize tag=3D"profile_weblog"}: <a href=3D"{$view_consumedmo=
del.weblogs[inc]}">{$view_consumedmodel.weblogs[inc]}</a><br />
- <div class=3D"technorati">
- <a href=3D"http://technorati.com/"><img src=3D"style/technor=
ati-logo.jpg" alt=3D"Technorati" /></a><br />
- Incoming Links: {$technorati_bloginfo[inc].inboundlinks}<br =
/>
- Incoming Blogs: {$technorati_bloginfo[inc].inboundblogs}<br =
/>
- <a href=3D"http://www.technorati.com/cosmos/search.html?rank=
=3D&url=3D{$view_consumedmodel.weblogs[inc]|escape:"url"}">View Cosmos</a=
>
- </div>
+ {if $technorati_lookup_bloginfo}
+ <div class=3D"technorati">
+ <a href=3D"http://technorati.com/"><img src=3D"style/techn=
orati-logo.jpg" alt=3D"Technorati" /></a><br />
+ Incoming Links: {$technorati_bloginfo[inc].inboundlinks}<b=
r />
+ Incoming Blogs: {$technorati_bloginfo[inc].inboundblogs}<b=
r />
+ <a href=3D"http://www.technorati.com/cosmos/search.html?ra=
nk=3D&url=3D{$view_consumedmodel.weblogs[inc]|escape:"url"}">View Cosmos<=
/a>
+ </div>
+ {/if}
{/section}
</p>
{/if}
|
|
From: <sv...@2n...> - 2004-04-08 03:00:28
|
Author: crschmidt
Date: 2004-04-07 19:59:48 -0700 (Wed, 07 Apr 2004)
New Revision: 64
Modified:
trunk/docs/INSTALL
trunk/publicroot/.htaccess
Log:
Adding magic_quotes_gpc 0 to .htaccess. On the production server, we=20
were getting double escaped information in the database. This will=20
ensure that other people don't have the same problem.
Modified: trunk/docs/INSTALL
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/INSTALL 2004-04-07 05:32:28 UTC (rev 63)
+++ trunk/docs/INSTALL 2004-04-08 02:59:48 UTC (rev 64)
@@ -17,6 +17,8 @@
=20
This also allows the .htaccess to turn on allow_furl_open. This is neede=
d in=20
order to fetch images in some case - for example, in the getimagesize fu=
nction.
+It also sets magic_quotes_gpc to 0, or off. Since PeopleAggregator escap=
es all
+its own quotes, if this variable is on, you get doubly escaped data.
=20
You should modify the .htaccess file to reflect the location of your ins=
tall in
the RewriteRules in that file.
Modified: trunk/publicroot/.htaccess
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/.htaccess 2004-04-07 05:32:28 UTC (rev 63)
+++ trunk/publicroot/.htaccess 2004-04-08 02:59:48 UTC (rev 64)
@@ -1,4 +1,5 @@
php_flag allow_url_fopen 1
+php_flag magic_quotes_gpc 0=20
=20
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.peopleaggregator\.com$ [NC]
|
|
From: <sv...@2n...> - 2004-04-07 05:33:16
|
Author: crschmidt Date: 2004-04-06 22:32:28 -0700 (Tue, 06 Apr 2004) New Revision: 63 Modified: trunk/classes/paGroup.php trunk/classes/paProfile.php trunk/docs/INSTALL trunk/lib/cache.php trunk/lib/config.php-dist trunk/lib/rdf.php trunk/lib/rdfapi/syntax/RdfSerializer.php trunk/publicroot/addselftogroup.php trunk/publicroot/create.php trunk/publicroot/edit.php trunk/publicroot/forgotpw.php trunk/publicroot/register.php trunk/publicroot/relationship.php trunk/publicroot/upload-image.php trunk/publicroot/userverification.php trunk/publicroot/view.php trunk/templates/html/privacy.tpl Log: Changing pretty much ever instance of http://peopleaggregator.com into an instance of $pa_server_url . Also modifying peopleaggregator.com emails t= o be editable in configuration. Following new config variables: $pa_email_contact. Previously co...@pe... $pa_email_bugs. Previously bug...@pe... Also adding documentation to mention that the .htaccess file has PAcom sp= ecifc information that should be modified by other sites. Modified: trunk/classes/paGroup.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/classes/paGroup.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/classes/paGroup.php 2004-04-07 05:32:28 UTC (rev 63) @@ -64,7 +64,7 @@ $statement =3D new Statement($groupnode, $RDF_type, $FOAF_Group= ); $this->_groupModel->add($statement); $this->_groupName =3D null; - $this->_groupURL =3D "http://peopleaggregator.com/profile?id=3D= g".$this->_groupID; + $this->_groupURL =3D "$pa_server_url/profile?id=3Dg".$this->_gr= oupID; return; } =20 @@ -85,7 +85,7 @@ $this->_groupModel =3D $db_store->getModel("g".$id); $this->_groupJoinability =3D $row[2]; $this->_groupVisibility =3D $row[3]; - $this->_groupURL =3D "http://peopleaggregator.com/profile= ?id=3Dg".$id; + $this->_groupURL =3D "$pa_server_url/profile?id=3Dg".$id; } else { $this =3D null; } @@ -243,7 +243,7 @@ // some more deeply unsustainable proof-of-concept code, for the moment= . -Liz (FIXME!!) $uid =3D $this->getGroupID(); $uid =3D mysql_escape_string(preg_replace("/^.*[^0-9]([0-9]+)\$/","\$1"= ,$uid)); - $safe_url =3D mysql_escape_string("http://peopleaggregator.com/profile?= id=3Dg" . $uid); + $safe_url =3D mysql_escape_string("$pa_server_url/profile?id=3Dg" . $ui= d); $usql =3D "select concat(firstname,' ',lastname) as name, u.id from use= rs u, temp_profile_membership p where u.id =3D p.profile_id and p.group_url =3D '$safe_url' "; $uresult =3D $database->GetAll($usql); Modified: trunk/classes/paProfile.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/classes/paProfile.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/classes/paProfile.php 2004-04-07 05:32:28 UTC (rev 63) @@ -319,7 +319,7 @@ if($target_consumed["info"]["mbox"]) { $target_email =3D $target_consumed["info"]["mbox"]; } else { - if(ereg("peopleaggregator.com/profile",$url)) { + if(ereg("$pa_server_url/profile",$url)) { $exp =3D explode("=3D", $url); $profileID =3D $exp[1]; $targetProfile =3D new paProfile($profileID); //FIXME: I= s this right? @@ -367,7 +367,7 @@ $message->assign("rel",$type); $message->assign("pa_server_url",$pa_server_url); $message->assign("code",$code); - mail($target_email, "PeopleAggregator relationship request", $m= essage->fetch("relationship_request.tpl"), "From: contact@peopleaggregato= r.com"); + mail($target_email, "PeopleAggregator relationship request", $m= essage->fetch("relationship_request.tpl"), "From: $pa_email_contact"); } } =20 Modified: trunk/docs/INSTALL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/INSTALL 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/docs/INSTALL 2004-04-07 05:32:28 UTC (rev 63) @@ -18,6 +18,9 @@ This also allows the .htaccess to turn on allow_furl_open. This is neede= d in=20 order to fetch images in some case - for example, in the getimagesize fu= nction. =20 +You should modify the .htaccess file to reflect the location of your ins= tall in +the RewriteRules in that file. + This section is most likely incomplete. =20 PeopleAggregator Installation: Modified: trunk/lib/cache.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/lib/cache.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/lib/cache.php 2004-04-07 05:32:28 UTC (rev 63) @@ -27,7 +27,7 @@ $current_time =3D time(); $cache_time =3D $row[2]; //FIXME: This catches ONLY local RDF. Anything else still gets ca= ched. - $is_local =3D ereg("peopleaggregator.com/profile",$url); + $is_local =3D ereg("$pa_server_url/profile",$url); if(($current_time>=3D(strtotime($cache_time)+300)) || ($is_local))= { // echo "retrieving due to age/locality"; $data =3D retrieve($url); Modified: trunk/lib/config.php-dist =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/lib/config.php-dist 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/lib/config.php-dist 2004-04-07 05:32:28 UTC (rev 63) @@ -20,6 +20,8 @@ $pa_file_location =3D "/home/pa"; $pa_tmp_location =3D "/tmp/pa"; =20 +$pa_email_contact =3D "contact@localhost"; +$pa_email_bugs =3D "bugreports@localhost"; $pa_debug_mode =3D false; =20 // Technorati Integration. See http://www.technorati.com/developers/ fo= r details. Modified: trunk/lib/rdf.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/lib/rdf.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/lib/rdf.php 2004-04-07 05:32:28 UTC (rev 63) @@ -130,7 +130,7 @@ $parser =3D new RdfParser(); =20 //This little ereg saves us the task of having to go "http" fetch a p= rofile if we know it's local. - if(ereg("peopleaggregator.com/profile",$url)) { + if(ereg("$pa_server_url/profile",$url)) { //Find the profile ID. $exp =3D explode("=3D", $url); $profile_id =3D $exp[1]; Modified: trunk/lib/rdfapi/syntax/RdfSerializer.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/lib/rdfapi/syntax/RdfSerializer.php 2004-04-06 20:35:28 UTC (re= v 62) +++ trunk/lib/rdfapi/syntax/RdfSerializer.php 2004-04-07 05:32:28 UTC (re= v 63) @@ -217,7 +217,7 @@ if (!HIDE_ADVERTISE) { // $this->m_out.=3D"<!-- Generated by RdfSerializer.php f= rom RDF RAP.".LINEFEED."# http://www.wiwiss.fu-berlin.de/suhl/bizer/rdfap= i/index.html !-->".LINEFEED.LINEFEED ; $this->m_out.=3D"<!-- Generated by PeopleAggregator usin= g RdfSerializer.php from RDF RAP v0.7 -->".LINEFEED; - $this->m_out.=3D"<!-- PeopleAggregator information: http= ://peopleaggregator.com/ -->".LINEFEED; + $this->m_out.=3D"<!-- PeopleAggregator information: $pa_= server_url/ -->".LINEFEED; $this->m_out.=3D"<!-- RDF RAP information: http://www.wi= wiss.fu-berlin.de/suhl/bizer/rdfapi/ -->".LINEFEED.LINEFEED; } =20 Modified: trunk/publicroot/addselftogroup.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/addselftogroup.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/addselftogroup.php 2004-04-07 05:32:28 UTC (rev 63) @@ -7,7 +7,7 @@ =20 $currentProfile =3D new paProfile($paUserInfo->getCurrentProfileID()); =20 -$currentProfile->addMembership("http://peopleaggregator.com/profile?id=3D= " . $gid); +$currentProfile->addMembership("$pa_server_url/profile?id=3D" . $gid); =20 $template->assign('gid',$gid); $template->display('group_added.tpl'); Modified: trunk/publicroot/create.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/create.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/create.php 2004-04-07 05:32:28 UTC (rev 63) @@ -17,7 +17,7 @@ case "plain": $newProfile =3D new paProfile(); $newProfile->setOwnerID($paUserInfo->getUserID()); - $newProfile->setProfileURL("http://peopleaggregator.com/profile?id= =3D".$newProfile->getProfileID()); + $newProfile->setProfileURL("$pa_server_url/profile?id=3D".$newProf= ile->getProfileID()); $paUserInfo->setCurrentProfileID($newProfile->getProfileID()); $_SESSION["current_profile_id"] =3D $newProfile->getProfileID(); $template->assign('profile_id',$newProfile->getProfileID()); @@ -42,7 +42,7 @@ $subject =3D $statement2->getObject(); $currentProfile =3D new paProfile(); $currentProfile->setOwnerID($paUserInfo->getUserID()); - $currentProfile->setProfileURL("http://peopleaggregator.c= om/profile?id=3D".$currentProfile->getProfileID()); + $currentProfile->setProfileURL("$pa_server_url/profile?id= =3D".$currentProfile->getProfileID()); $iterator =3D new StatementIterator($currentProfile->db_p= rofile); while($iterator->hasNext()) { $statement =3D $iterator->next(); @@ -99,7 +99,7 @@ if($remote_model) { $currentProfile =3D new paProfile(); $currentProfile->setOwnerID($paUserInfo->getUserID()); - $currentProfile->setProfileURL("http://peopleaggregator.com/pro= file?id=3D".$currentProfile->getProfileID()); + $currentProfile->setProfileURL("$pa_server_url/profile?id=3D".$= currentProfile->getProfileID()); =20 $iterator =3D new StatementIterator($currentProfile->db_profile= ); while($iterator->hasNext()) { Modified: trunk/publicroot/edit.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/edit.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/edit.php 2004-04-07 05:32:28 UTC (rev 63) @@ -81,7 +81,7 @@ $sql =3D "INSERT INTO imagecache (data, type) VALUES ('$data= ','$type')"; $database->Execute($sql); $id =3D $database->Insert_ID(); - $pictureurl =3D "http://peopleaggregator.com/image?id=3D".$i= d; + $pictureurl =3D "$pa_server_url/image?id=3D".$id; pa_update_model_from_string($consumed_model["description"]["= pictureurl"], $pictureurl, $db_model, $currentProfile->getProfileOwner(),= $FOAF_depiction, "resource"); } } Modified: trunk/publicroot/forgotpw.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/forgotpw.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/forgotpw.php 2004-04-07 05:32:28 UTC (rev 63) @@ -20,7 +20,7 @@ $message->assign("pa_server_url",$pa_server_url); $message->assign("code",$code); =20 - mail($email,"PeopleAggregator Password Reset Request",$message->fetch= ('forgot_password.tpl'), "From: co...@pe..."); + mail($email,"PeopleAggregator Password Reset Request",$message->fetch= ('forgot_password.tpl'), "From: $pa_email_contact"); print_msg("E-mail has been sent","An e-mail has been sent to that add= ress with instructions on how to recover your password."); } elseif($_REQUEST["verify_code"]) { if(($_REQUEST["password1"]) && ($_REQUEST["password2"])) { Modified: trunk/publicroot/register.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/register.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/register.php 2004-04-07 05:32:28 UTC (rev 63) @@ -48,7 +48,7 @@ $sql =3D "INSERT INTO temp_user_verifications (code, u= serid, timestamp) VALUES ('$code','$id',NOW())"; $database->Execute($sql); mail($email,"PeopleAggregator User Verification","Hell= o! To finish verifying your PeopleAggregator account, ". - "go to $pa_server_url/userverification?action=3Df= inish&code=3D$code", "From: co...@pe..."); + "go to $pa_server_url/userverification?action=3Df= inish&code=3D$code", "From: $pa_email_contact"); } =20 redirect("create"); Modified: trunk/publicroot/relationship.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/relationship.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/relationship.php 2004-04-07 05:32:28 UTC (rev 63) @@ -34,7 +34,7 @@ $currentProfile =3D new paProfile($paUserInfo->getCurrentProfil= eID()); =20 if(!$currentProfile) - error_page("No profile available!","Sorry, but it appears yo= u have not set up a profile. Try http://peopleaggregator.com/create"); + error_page("No profile available!","Sorry, but it appears yo= u have not set up a profile. Try $pa_server_url/create"); =20 $def_name =3D qName($currentProfile->getModel()); =20 @@ -105,7 +105,7 @@ $message->template_dir =3D $pa_file_location."/templates/mai= l"; $message->assign("rel_type",$row[2]); $message->assign("from_person",$row[5]); - mail($mbox,"PeopleAggregator Relationship Denied",$message->= fetch("relationship_denied.tpl"), "From: co...@pe..."); + mail($mbox,"PeopleAggregator Relationship Denied",$message->= fetch("relationship_denied.tpl"), "From: $pa_email_contact"); //FIXME: Decode $row[5] and get a proper name if possible at= some point. } else { error_page("Invalid code.","Sorry, but that verification cod= e no longer works. This could be because it has expired, invalid, or the= person extending the relationship request had recinded it."); @@ -140,7 +140,7 @@ } =20 $mbox =3D $row[4]; - mail($mbox,"PeopleAggregator Relationship Acknowledged","$na= me ($url) has confirmed your relationship request.", "From: contact@peopl= eaggregator.com"); + mail($mbox,"PeopleAggregator Relationship Acknowledged","$na= me ($url) has confirmed your relationship request.", "From: $pa_email_con= tact"); =20 $othername =3D qName($db_model); $template->assign("rel",$rel);=20 Modified: trunk/publicroot/upload-image.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/upload-image.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/upload-image.php 2004-04-07 05:32:28 UTC (rev 63) @@ -6,7 +6,7 @@ if($_REQUEST["submit"]) { if ($_FILES['imagefile']) { copy ($_FILES['imagefile']['tmp_name'],"userfiles/".$_FILES['image= file']['name']) - or error_page("Unable to copy","For some reason, PA was unable = to copy this file into place. Try again, and if the problem persists, pl= ease e-mail bug...@pe..."); + or error_page("Unable to copy","For some reason, PA was unable = to copy this file into place. Try again, and if the problem persists, pl= ease e-mail $pa_email_bugs"); =20 //FIXME: Warning: This does not obfuscate the damn name //Then we add this image to the person's FOAF Modified: trunk/publicroot/userverification.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/userverification.php 2004-04-06 20:35:28 UTC (rev 62= ) +++ trunk/publicroot/userverification.php 2004-04-07 05:32:28 UTC (rev 63= ) @@ -22,7 +22,7 @@ $sql =3D "INSERT INTO temp_user_verifications (code, userid, ti= mestamp) VALUES ('$code','".$paUserInfo->getUserID()."',NOW())"; $database->Execute($sql); mail($email,"PeopleAggregator User Verification","Hello! To fi= nish verifying your PeopleAggregator account, ". - "go to $pa_server_url/userverification?action=3Dfinish&cod= e=3D$code", "From: co...@pe...");=20 + "go to $pa_server_url/userverification?action=3Dfinish&cod= e=3D$code", "From: $pa_email_contact");=20 pa_add_sysnote("An e-mail has been sent to your registered addr= ess with the verification code."); redirect("private"); break; Modified: trunk/publicroot/view.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/publicroot/view.php 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/publicroot/view.php 2004-04-07 05:32:28 UTC (rev 63) @@ -9,7 +9,7 @@ }=20 =20 if(isset($_REQUEST["id"])) { - $url =3D "http://peopleaggregator.com/profile?id=3D".mysql_escape_str= ing($_REQUEST["id"]); + $url =3D "$pa_server_url/profile?id=3D".mysql_escape_string($_REQUEST= ["id"]); } else { $url =3D mysql_escape_string($_REQUEST["url"]); } @@ -20,7 +20,7 @@ =20 //Figure out if this profile is owned by the viewer. foreach($paUserInfo->getAllProfileIDs() as $user_profile) { - $profile_url =3D "http://peopleaggregator.com/profile?id=3D".$user= _profile[0]; + $profile_url =3D "$pa_sever_url/profile?id=3D".$user_profile[0]; if($profile_url =3D=3D $url) { $lookingatself =3D true; $template->assign('lookingatself',$lookingatself); Modified: trunk/templates/html/privacy.tpl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/templates/html/privacy.tpl 2004-04-06 20:35:28 UTC (rev 62) +++ trunk/templates/html/privacy.tpl 2004-04-07 05:32:28 UTC (rev 63) @@ -5,7 +5,7 @@ <h1>PeopleAggregator Privacy Policy</h1> <p class=3D"p1">Since I don't have any money to pay lawyers to = make some indecipherable privacy policy, I'm going to just say what I pla= n to do. If you have questions, comments, or feel this policy has been = broken, e-mail es...@pe....</p> <p class=3D"p1">Your registration info will be kept confidentia= l. The e-mail address you use to register will not be sold to third part= ies, only used by PeopleAggregator to contact you if there is no other wa= y. Period. I hate spam as much as everyone else.</p> - <p class=3D"p1">This is site is "social software", that is, it'= s something designed to help people connect to other people. So in order= for it to work there will always be some amount of information made publ= ic to allow people to find one another. This is anything in your "Profil= e" (the FOAF data). Over time, features will be introduced to allow you = to limit your personal information to specific groups, but right now anyt= hing in your FOAF (the data you get from http://peopleaggregator.com/prof= ile?id=3D#) is public.</p> + <p class=3D"p1">This is site is "social software", that is, it'= s something designed to help people connect to other people. So in order= for it to work there will always be some amount of information made publ= ic to allow people to find one another. This is anything in your "Profil= e" (the FOAF data). Over time, features will be introduced to allow you = to limit your personal information to specific groups, but right now anyt= hing in your FOAF (the data you get from {$pa_server_url}/profile?id=3D#)= is public.</p> <p class=3D"p1">Finally, I have put in place safeguards to try = to prevent strip-mining of your FOAF profile data by people known to have= no scruples, but these measures may not work.</p> <p class=3D"p1">Oh, and should this privacy policy ever change,= every user of PeopleAggregator will be notified and will not have the ne= w rules applied to their account until they agree to them.</p> </div> |
|
From: <sv...@2n...> - 2004-04-06 20:36:04
|
Author: crschmidt
Date: 2004-04-06 13:35:28 -0700 (Tue, 06 Apr 2004)
New Revision: 62
Modified:
trunk/docs/INSTALL
trunk/publicroot/.htaccess
trunk/schema/rdf_database.sql
Log:
Updating .htaccess to set allow_furl_open, for getimagesize() and other=20
similar functions. Turning it on globally is considered a security risk=20
for some things, (namely because then people could do evil things with=20
your machine) but we know the code we're doing will be good and not=20
evil.
Modified: trunk/docs/INSTALL
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/INSTALL 2004-04-06 16:08:54 UTC (rev 61)
+++ trunk/docs/INSTALL 2004-04-06 20:35:28 UTC (rev 62)
@@ -15,6 +15,9 @@
This allows PA to use its .htaccess file to rewrite URLs, as well as ena=
bling=20
blocking of a variety of rude or broken spiders.
=20
+This also allows the .htaccess to turn on allow_furl_open. This is neede=
d in=20
+order to fetch images in some case - for example, in the getimagesize fu=
nction.
+
This section is most likely incomplete.
=20
PeopleAggregator Installation:
Modified: trunk/publicroot/.htaccess
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/publicroot/.htaccess 2004-04-06 16:08:54 UTC (rev 61)
+++ trunk/publicroot/.htaccess 2004-04-06 20:35:28 UTC (rev 62)
@@ -1,3 +1,5 @@
+php_flag allow_url_fopen 1
+
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.peopleaggregator\.com$ [NC]
RewriteRule ^(.*)$ http://peopleaggregator.com/$1 [R=3D301,L]
Modified: trunk/schema/rdf_database.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/schema/rdf_database.sql 2004-04-06 16:08:54 UTC (rev 61)
+++ trunk/schema/rdf_database.sql 2004-04-06 20:35:28 UTC (rev 62)
@@ -4,9 +4,8 @@
baseURI varchar(255) DEFAULT '',
primary key (modelID)
);
- =20
CREATE UNIQUE INDEX m_modURI_idx ON models (modelURI);
- =20
+
CREATE TABLE statements (
modelID bigint NOT NULL,
subject varchar(255) NOT NULL,
@@ -18,7 +17,7 @@
object_is varchar(1) NOT NULL,
FULLTEXT(object)
);
- =20
+
CREATE INDEX s_mod_idx ON statements (modelID);
CREATE INDEX s_sub_pred_idx ON statements (subject(200),predicate(200));
CREATE INDEX s_obj_idx ON statements (object(250));
@@ -33,6 +32,6 @@
);
=20
CREATE TABLE ban_regex (
- id bigint NOT NULL AUTO_INCREMENT,
+ id bigint NOT NULL AUTO_INCREMENT PRIMARY KEY,
regex text NOT NULL
);
|
|
From: <sv...@2n...> - 2004-04-06 16:09:54
|
Author: crschmidt Date: 2004-04-06 09:08:54 -0700 (Tue, 06 Apr 2004) New Revision: 61 Modified: trunk/docs/INSTALL Log: Adding information about AllowOverride All, which is required for PA to=20 run properly. Modified: trunk/docs/INSTALL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/INSTALL 2004-04-06 16:01:30 UTC (rev 60) +++ trunk/docs/INSTALL 2004-04-06 16:08:54 UTC (rev 61) @@ -8,6 +8,13 @@ PeopleAggregator requires a MySQL database backend, as the RDF Parser be= ing used only supports MySQL. =20 +You will need to have the following option set in the Apache configurati= on for=20 +the directory where PA is installed: + AllowOverride All + +This allows PA to use its .htaccess file to rewrite URLs, as well as ena= bling=20 +blocking of a variety of rude or broken spiders. + This section is most likely incomplete. =20 PeopleAggregator Installation: |
|
From: <sv...@2n...> - 2004-04-06 16:01:55
|
Author: crschmidt Date: 2004-04-06 09:01:30 -0700 (Tue, 06 Apr 2004) New Revision: 60 Modified: trunk/docs/INSTALL Log: Updating install docs to include a bit of information about what you=20 need. Most important to me is the fact that PHP must be installed with=20 curl enabled, because otherwise you get an error message when it tries=20 to fetch your files. Also including a bit about the environment we use=20 it under, for the time being. Modified: trunk/docs/INSTALL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/INSTALL 2004-04-05 21:16:05 UTC (rev 59) +++ trunk/docs/INSTALL 2004-04-06 16:01:30 UTC (rev 60) @@ -1,3 +1,15 @@ +PeopleAggregator Requirements: + +You will need to have an Apache server, running PHP. PHP must be compile= d with +both curl and XML parsing enabled. Currently, PA has only been tested to= run +on Apache 1 servers, not Apache 2. The same is true for PHP4 - no tests = on this +code have been made under PHP5. + +PeopleAggregator requires a MySQL database backend, as the RDF Parser be= ing used +only supports MySQL. + +This section is most likely incomplete. + PeopleAggregator Installation: =20 1) Load schema/database.sql into the MySQL database of your choice @@ -10,6 +22,3 @@ Therefore, it will most likely change often, and not be correct most of = the time until things stabilize. Contact es...@2n... if/when you run into pr= oblems. =20 - -ignoremeandagainandagain -andifthisisitImgoingtokillsomeone |
|
From: <ch...@us...> - 2003-12-15 06:38:16
|
Update of /cvsroot/peepagg//LAMP/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv19231/scripts Added Files: copyLibs.sh Log Message: Copy Libs --- NEW FILE: copyLibs.sh --- #!/bin/bash # $Header: /cvsroot/peepagg//LAMP/scripts/copyLibs.sh,v 1.1 2003/12/15 06:38:13 chalko Exp $ dest=$1 source=../sso cp $source/sourceid-sso.jar $dest/web/WEB-INF/lib cp $source/webapp/WEB-INF/lib/* $dest/web/WEB-INF/lib |
|
From: <ch...@us...> - 2003-12-15 06:35:25
|
Update of /cvsroot/peepagg//IDP/web/WEB-INF/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18822/web/WEB-INF/lib Added Files: readme.txt Log Message: Notes on jars. |
|
From: <ch...@us...> - 2003-12-15 06:35:00
|
Update of /cvsroot/peepagg//IDP/web/WEB-INF/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18727/web/WEB-INF/lib Added Files: .cvsignore Log Message: Don't check in jars. --- NEW FILE: .cvsignore --- *.jar |
Update of /cvsroot/peepagg//IDP/web/WEB-INF/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18437/web/WEB-INF/lib Removed Files: mysql-connector-java-3.0.9-stable-bin.jar xml-apis.jar readme.txt saaj.jar commons-httpclient.jar xmlsec.jar jaxrpc.jar castor-0.9.4.2-xml.jar commons-discovery.jar commons-logging.jar xercesImpl.jar axis-ant.jar sourceid-sso.jar xmlParserAPIs.jar xalan.jar log4j-1.2.7.jar wsdl4j.jar axis.jar Log Message: Don't check in jars. --- mysql-connector-java-3.0.9-stable-bin.jar DELETED --- --- xml-apis.jar DELETED --- --- readme.txt DELETED --- --- saaj.jar DELETED --- --- commons-httpclient.jar DELETED --- --- xmlsec.jar DELETED --- --- jaxrpc.jar DELETED --- --- castor-0.9.4.2-xml.jar DELETED --- --- commons-discovery.jar DELETED --- --- commons-logging.jar DELETED --- --- xercesImpl.jar DELETED --- --- axis-ant.jar DELETED --- --- sourceid-sso.jar DELETED --- --- xmlParserAPIs.jar DELETED --- --- xalan.jar DELETED --- --- log4j-1.2.7.jar DELETED --- --- wsdl4j.jar DELETED --- --- axis.jar DELETED --- |
|
From: <ch...@us...> - 2003-12-15 06:17:22
|
Update of /cvsroot/peepagg//LAMP/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv16428/scripts Modified Files: create.sql Log Message: Fixed header Index: create.sql =================================================================== RCS file: /cvsroot/peepagg//LAMP/scripts/create.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** create.sql 15 Dec 2003 06:15:26 -0000 1.1 --- create.sql 15 Dec 2003 06:17:13 -0000 1.2 *************** *** 1,3 **** ! #$Header : $ drop TABLE fsn_account_federations; CREATE TABLE fsn_account_federations --- 1,3 ---- ! #$Header$ drop TABLE fsn_account_federations; CREATE TABLE fsn_account_federations |
|
From: <ch...@us...> - 2003-12-15 06:15:29
|
Update of /cvsroot/peepagg//LAMP/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv16109/scripts
Added Files:
create.sql
Log Message:
Moved scrripte to common folder
--- NEW FILE: create.sql ---
#$Header : $
drop TABLE fsn_account_federations;
CREATE TABLE fsn_account_federations
(userID varchar(64) ,
providerID varchar(64) ,
localName varchar(64),
remoteName varchar(64),
primary key (userID, providerID )
};
drop TABLE fsn_session;
CREATE TABLE fsn_session
(userID varchar(64) ,
sessionID varchar(64) ,
primary key (userID, sessionID )
};
|
|
From: <ch...@us...> - 2003-12-15 06:13:56
|
Update of /cvsroot/peepagg//SP/web In directory sc8-pr-cvs1:/tmp/cvs-serv15897/web Added Files: defaultExceptionHandler.jsp Log Message: Added exception Handler --- NEW FILE: defaultExceptionHandler.jsp --- <%@ page language="java" %> <%@ page isErrorPage="true" %> <%@ page import="org.sourceid.sso.util.ExceptionUtils" %><% // Recommend setting a different status code, anything but the default of 200 (HTTP_OK) response.setStatus(500); %> <html> <head> <title>SourceID-SSO Sample Error Page</title> </head> <body> An error occured. Replace this page (or the pointer in sourceid-sso.xml) with a "real" error page. <br> <pre> <%=ExceptionUtils.dissect(exception, request)%> </pre> </body> </html> <%-- * * License * * The contents of this file are subject to the Public Source * License-SourceID SSO v1.0. You may not copy or use this file, in either * source code or executable form, except in compliance with the Public * Source License-SourceID SSO v1.0. You may obtain a copy of the license * at http://www.pingidentity.com or * http://www.sourceid.org/docs/PSL-SSO10.htm * * Software distributed under the Public Source License-SourceID SSO v1.0 * is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either * express or implied. See the Public Source License-SourceID SSO v1.0 for * the specific language regarding rights and limitations. * * Copyrights * Copyright (c) 2002-2003 Ping Identity Corporation. All Rights Reserved. * Contact information for Ping Identity Corporation is available at * http://www.pingidentity.com/. * --%> |
|
From: <ch...@us...> - 2003-12-15 05:12:16
|
Update of /cvsroot/peepagg//fake/WEB-INF/src/fake
In directory sc8-pr-cvs1:/tmp/cvs-serv7876/WEB-INF/src/fake
Modified Files:
LoginServlet.java
Log Message:
Added the rest of the SP stuff but it is not working yet.
Index: LoginServlet.java
===================================================================
RCS file: /cvsroot/peepagg//fake/WEB-INF/src/fake/LoginServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LoginServlet.java 15 Dec 2003 01:47:41 -0000 1.2
--- LoginServlet.java 15 Dec 2003 05:12:13 -0000 1.3
***************
*** 9,12 ****
--- 9,13 ----
import java.io.IOException;
import java.sql.Connection;
+ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
***************
*** 47,52 ****
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
! // TODO Auto-generated method stub
! super.doGet(arg0, arg1);
}
--- 48,53 ----
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
!
! doPost(arg0, arg1);
}
***************
*** 61,70 ****
HttpServletResponse response)
throws ServletException, IOException {
! HttpSession session = request.getSession();
! String userName = request.getParameter("userID");
! if (userName == null || userName.trim().length() == 0) {
! response.sendError(400, "User name must be set");
! return;
}
Connection conn = null;
try {
--- 62,144 ----
HttpServletResponse response)
throws ServletException, IOException {
! try {
! HttpSession session = request.getSession();
! String userName = request.getParameter("userID");
! String providerID = request.getParameter("ProviderID");
! String sessionID = request.getParameter("sessionID");
! if (sessionID != null) {
! validateSession(
! request,
! response,
! session,
! userName,
! sessionID);
! }
! if (providerID != null) {
! useSP(request, response, session, providerID);
! } else if (userName != null && userName.trim().length() > 0) {
! useIDP(request, response, session, userName);
! } else {
! response.sendError(
! 400,
! "UserId, SessionID or ProviderID must be set");
!
! }
! } catch (ServletException e) {
! throw e;
! } catch (Exception e) {
! throw new ServletException("error", e);
}
+ }
+
+ /**
+ * @param request
+ * @param response
+ * @param session
+ * @param sessionID
+ */
+ private void validateSession(
+ HttpServletRequest request,
+ HttpServletResponse response,
+ HttpSession session,
+ String sessionID,
+ String userid)
+ throws NamingException, SQLException, IOException {
+ if (isSessionIDValid(userid, sessionID)) {
+ saveFakeUserName(session, userid);
+ response.sendRedirect(getBaseURL(request) + "/success.jsp");
+ } else {
+ response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+ }
+
+ }
+
+ /**
+ * @param request
+ * @param response
+ * @param session
+ * @param providerID
+ */
+ private void useSP(
+ HttpServletRequest request,
+ HttpServletResponse response,
+ HttpSession session,
+ String providerID)
+ throws IOException {
+ response.sendRedirect(
+ "http://localhost:8080/SP/lamp/sp?"
+ + "ProviderID="
+ + providerID
+ + "&successURL="
+ + getBaseURL(request)
+ + "/success.jsp");
+ }
+
+ private void useIDP(
+ HttpServletRequest request,
+ HttpServletResponse response,
+ HttpSession session,
+ String userName)
+ throws IOException, ServletException {
Connection conn = null;
try {
***************
*** 73,90 ****
Random r = new Random();
String sessionID = Integer.toHexString(r.nextInt());
! // Note: Use an
! // ABSOLUTE URL
! // here, not
! // relative,
! // because it
! // will be used to redirect the user
! // across host domains.
!
! String thisPage = request.getRequestURL().toString();
! thisPage =
! thisPage.substring(
! 0,
! thisPage.indexOf(request.getContextPath())
! + request.getContextPath().length());
boolean success =
statement.execute(
--- 147,151 ----
Random r = new Random();
String sessionID = Integer.toHexString(r.nextInt());
! String thisPage = getBaseURL(request);
boolean success =
statement.execute(
***************
*** 94,98 ****
+ sessionID
+ "')");
! session.setAttribute("fake_userId", userName);
response.sendRedirect(
--- 155,159 ----
+ sessionID
+ "')");
! saveFakeUserName(session, userName);
response.sendRedirect(
***************
*** 109,125 ****
} catch (Exception e) {
! response.sendError(500, e.getMessage());
! e.printStackTrace();
! return;
} finally {
! if (conn != null) {
! try {
! conn.close();
! } catch (SQLException e1) {
! e1.printStackTrace();
! }
! }
}
}
--- 170,220 ----
} catch (Exception e) {
! throw new ServletException("Error in IDP for " + userName, e);
} finally {
! close(conn);
}
+ }
+
+ /**
+ * Get the base url for this Page
+ *
+ * @param request
+ * @return
+ */
+ private String getBaseURL(HttpServletRequest request) {
+ // Note: Use an
+ // ABSOLUTE URL
+ // here, not
+ // relative,
+ // because it
+ // will be used to redirect the user
+ // across host domains.
+ String thisPage = request.getRequestURL().toString();
+ thisPage =
+ thisPage.substring(
+ 0,
+ thisPage.indexOf(request.getContextPath())
+ + request.getContextPath().length());
+ return thisPage;
+ }
+
+ private void saveFakeUserName(HttpSession session, String userName) {
+ session.setAttribute("fake_userId", userName);
+ }
+
+ /**
+ * Safely and quitly close a connection
+ *
+ * @param conn
+ */
+ private void close(Connection conn) {
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (SQLException e1) {
+ e1.printStackTrace();
+ }
+ }
}
***************
*** 132,135 ****
--- 227,248 ----
Connection conn = ds.getConnection();
return conn;
+ }
+ protected boolean isSessionIDValid(String userID, String sessionID)
+ throws NamingException, SQLException {
+ Connection conn = null;
+ try {
+ conn = getConnection();
+ Statement statement = conn.createStatement();
+ ResultSet rs =
+ statement.executeQuery(
+ "select count(*) from fsn_session where userID='"
+ + userID
+ + "' and sessionID ='"
+ + sessionID
+ + "'");
+ return rs.next() && rs.getInt(1) >= 1;
+ } finally {
+ close(conn);
+ }
}
|
|
From: <ch...@us...> - 2003-12-15 05:12:16
|
Update of /cvsroot/peepagg//fake In directory sc8-pr-cvs1:/tmp/cvs-serv7876 Modified Files: index.jsp Removed Files: login-post.jsp Log Message: Added the rest of the SP stuff but it is not working yet. Index: index.jsp =================================================================== RCS file: /cvsroot/peepagg//fake/index.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.jsp 14 Dec 2003 02:13:30 -0000 1.1 --- index.jsp 15 Dec 2003 05:12:13 -0000 1.2 *************** *** 16,19 **** --- 16,21 ---- </tr> </table> + + <a href="<%=request.getContextPath()%>/login?ProviderID=Chalko-IDP">Use the SP </a> </form> </body> --- login-post.jsp DELETED --- |
|
From: <ch...@us...> - 2003-12-15 02:18:59
|
Update of /cvsroot/peepagg//LAMP/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv13265/scripts Log Message: Directory /cvsroot/peepagg//LAMP/scripts added to the repository |
|
From: <ch...@us...> - 2003-12-15 01:47:44
|
Update of /cvsroot/peepagg//fake/WEB-INF/src/fake
In directory sc8-pr-cvs1:/tmp/cvs-serv8169/WEB-INF/src/fake
Modified Files:
LoginServlet.java
Log Message:
Added the success and fail url
Index: LoginServlet.java
===================================================================
RCS file: /cvsroot/peepagg//fake/WEB-INF/src/fake/LoginServlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LoginServlet.java 14 Dec 2003 02:13:30 -0000 1.1
--- LoginServlet.java 15 Dec 2003 01:47:41 -0000 1.2
***************
*** 36,40 ****
public LoginServlet() {
super();
! // TODO Auto-generated constructor stub
}
--- 36,40 ----
public LoginServlet() {
super();
!
}
***************
*** 64,68 ****
String userName = request.getParameter("userID");
if (userName == null || userName.trim().length() == 0) {
! response.setStatus(400, "User name must be set");
return;
}
--- 64,68 ----
String userName = request.getParameter("userID");
if (userName == null || userName.trim().length() == 0) {
! response.sendError(400, "User name must be set");
return;
}
***************
*** 73,76 ****
--- 73,90 ----
Random r = new Random();
String sessionID = Integer.toHexString(r.nextInt());
+ // Note: Use an
+ // ABSOLUTE URL
+ // here, not
+ // relative,
+ // because it
+ // will be used to redirect the user
+ // across host domains.
+
+ String thisPage = request.getRequestURL().toString();
+ thisPage =
+ thisPage.substring(
+ 0,
+ thisPage.indexOf(request.getContextPath())
+ + request.getContextPath().length());
boolean success =
statement.execute(
***************
*** 81,93 ****
+ "')");
session.setAttribute("fake_userId", userName);
!
response.sendRedirect(
"http://localhost:8080/IDP/lamp/idp?userID="
+ userName
+ "&sessionId="
! + sessionID);
} catch (Exception e) {
! response.setStatus(500, e.getMessage());
e.printStackTrace();
return;
--- 95,113 ----
+ "')");
session.setAttribute("fake_userId", userName);
!
response.sendRedirect(
"http://localhost:8080/IDP/lamp/idp?userID="
+ userName
+ "&sessionId="
! + sessionID
! + "&successURL="
! + thisPage
! + "/success.jsp"
! + "&errorURL="
! + thisPage
! + "/fail.jsp");
} catch (Exception e) {
! response.sendError(500, e.getMessage());
e.printStackTrace();
return;
|
|
From: <ch...@us...> - 2003-12-15 01:47:13
|
Update of /cvsroot/peepagg//LAMP/src/java/com/peopleaggregator/sso/lamp
In directory sc8-pr-cvs1:/tmp/cvs-serv8060/src/java/com/peopleaggregator/sso/lamp
Modified Files:
Lamp.java LampIDP.java
Log Message:
Pulled up the getParamOrAttribute.
Added the ability to save the attibute in the session.
Index: Lamp.java
===================================================================
RCS file: /cvsroot/peepagg//LAMP/src/java/com/peopleaggregator/sso/lamp/Lamp.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Lamp.java 11 Dec 2003 07:43:21 -0000 1.4
--- Lamp.java 15 Dec 2003 01:47:10 -0000 1.5
***************
*** 17,20 ****
--- 17,22 ----
import javax.naming.NamingException;
import javax.servlet.http.HttpServlet;
+ import javax.servlet.http.HttpServletRequest;
+ import javax.servlet.http.HttpSession;
import javax.sql.DataSource;
***************
*** 150,153 ****
--- 152,185 ----
}
}
+ }
+
+ public static final String ERRORURL = "errorURL";
+ public static final String SUCCESSURL = "successURL";
+
+ /**
+ * @param request
+ * @param session
+ * @param sessionid
+ * @return
+ */
+ protected String getParameterOrAttribute(HttpServletRequest request, HttpSession session, String parameter, boolean save) {
+ return getParameterOrAttribute(
+ request,
+ session,
+ parameter,
+ parameter,
+ save);
+ }
+
+ protected String getParameterOrAttribute(HttpServletRequest request, HttpSession session, String parameter, String attribute, boolean save) {
+ String value = request.getParameter(parameter);
+ if (value != null) {
+ if (save) {
+ session.setAttribute(attribute, value);
+ }
+ } else {
+ value = (String) session.getAttribute(attribute);
+ }
+ return value;
}
Index: LampIDP.java
===================================================================
RCS file: /cvsroot/peepagg//LAMP/src/java/com/peopleaggregator/sso/lamp/LampIDP.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** LampIDP.java 14 Dec 2003 03:46:21 -0000 1.7
--- LampIDP.java 15 Dec 2003 01:47:10 -0000 1.8
***************
*** 44,52 ****
HttpSession session = request.getSession();
String userID;
! userID = getParameterOrAttribute(request, session, USERID, LAMP_USERID);
! String sessionID = getParameterOrAttribute(request, session, SESSIONID);
! String providerID = getParameterOrAttribute(request, session,PROVIDERID);
! String successURL = getParameterOrAttribute(request, session,SUCCESSURL);
! String errorURL = getParameterOrAttribute(request, session,ERRORURL);
try {
--- 44,62 ----
HttpSession session = request.getSession();
String userID;
! userID =
! getParameterOrAttribute(
! request,
! session,
! USERID,
! LAMP_USERID,
! true);
! String sessionID =
! getParameterOrAttribute(request, session, SESSIONID, true);
! String providerID =
! getParameterOrAttribute(request, session, PROVIDERID, true);
! String successURL =
! getParameterOrAttribute(request, session, SUCCESSURL, true);
! String errorURL =
! getParameterOrAttribute(request, session, ERRORURL, true);
try {
***************
*** 62,67 ****
response.sendRedirect(successURL); // TODO: fix
} else {
! response.sendRedirect(
! "http://localhost:8080/fake/fail.jsp");
// TODO: ise param
}
--- 72,76 ----
response.sendRedirect(successURL); // TODO: fix
} else {
! response.sendRedirect(errorURL);
// TODO: ise param
}
***************
*** 76,106 ****
}
}
- /**
- * @param request
- * @param session
- * @param sessionid
- * @return
- */
- private String getParameterOrAttribute(
- HttpServletRequest request,
- HttpSession session,
- String parameter) {
- return getParameterOrAttribute(request, session, parameter, parameter);
- }
-
- private String getParameterOrAttribute(
- HttpServletRequest request,
- HttpSession session,
- String parameter,
- String attribute) {
- String value;
- if (request.getParameter(parameter) != null) {
- value = request.getParameter(parameter);
- } else {
- value = (String) session.getAttribute(attribute);
- }
- return value;
- }
-
private boolean idpi(
HttpServletRequest request,
--- 85,88 ----
|
|
From: <ch...@us...> - 2003-12-14 09:45:33
|
Update of /cvsroot/peepagg/fake In directory sc8-pr-cvs1:/tmp/cvs-serv15058/fake Log Message: Directory /cvsroot/peepagg/fake added to the repository |
|
From: <ch...@us...> - 2003-12-14 08:49:22
|
Update of /cvsroot/peepagg//LAMP/src/java/com/peopleaggregator/sso/lamp In directory sc8-pr-cvs1:/tmp/cvs-serv31090/src/java/com/peopleaggregator/sso/lamp Modified Files: LampIDP.java Log Message: added getParameterOrAttribute Index: LampIDP.java =================================================================== RCS file: /cvsroot/peepagg//LAMP/src/java/com/peopleaggregator/sso/lamp/LampIDP.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LampIDP.java 11 Dec 2003 07:53:00 -0000 1.6 --- LampIDP.java 14 Dec 2003 03:46:21 -0000 1.7 *************** *** 18,22 **** import org.sourceid.sso.util.ServletUtils; - /** * @author <a href="http://nick.chalko.com/">Nick Chalko</a> --- 18,21 ---- *************** *** 24,27 **** --- 23,27 ---- public class LampIDP extends Lamp { + public static final String PROVIDERID = "ProviderID"; /** * *************** *** 44,54 **** HttpSession session = request.getSession(); String userID; ! if (request.getParameter(USERID) != null) { ! userID = request.getParameter(USERID); ! } else { ! userID = (String) session.getAttribute(LAMP_USERID); ! } ! String sessionID = request.getParameter(SESSIONID); ! String providerID = request.getParameter("ProviderID"); try { --- 44,52 ---- HttpSession session = request.getSession(); String userID; ! userID = getParameterOrAttribute(request, session, USERID, LAMP_USERID); ! String sessionID = getParameterOrAttribute(request, session, SESSIONID); ! String providerID = getParameterOrAttribute(request, session,PROVIDERID); ! String successURL = getParameterOrAttribute(request, session,SUCCESSURL); ! String errorURL = getParameterOrAttribute(request, session,ERRORURL); try { *************** *** 62,78 **** } initIdpSession(session, userID); ! ! response.sendRedirect( ! "http://localhost:8080/fake/success.jsp"); // TODO: fix ! } else { response.sendRedirect( ! "http://localhost:8080/fake/fail.jsp"); // TODO: ise param } } else { ! response.sendError( ! 400, ! "Must set either userid/sessionID"); ! } } catch (Exception e) { --- 60,71 ---- } initIdpSession(session, userID); ! response.sendRedirect(successURL); // TODO: fix } else { response.sendRedirect( ! "http://localhost:8080/fake/fail.jsp"); ! // TODO: ise param } } else { ! response.sendError(400, "Must set either userid/sessionID"); } } catch (Exception e) { *************** *** 83,86 **** --- 76,106 ---- } } + /** + * @param request + * @param session + * @param sessionid + * @return + */ + private String getParameterOrAttribute( + HttpServletRequest request, + HttpSession session, + String parameter) { + return getParameterOrAttribute(request, session, parameter, parameter); + } + + private String getParameterOrAttribute( + HttpServletRequest request, + HttpSession session, + String parameter, + String attribute) { + String value; + if (request.getParameter(parameter) != null) { + value = request.getParameter(parameter); + } else { + value = (String) session.getAttribute(attribute); + } + return value; + } + private boolean idpi( HttpServletRequest request, |
|
From: <ch...@us...> - 2003-12-14 08:47:53
|
Update of /cvsroot/peepagg//fake/WEB-INF/src/fake In directory sc8-pr-cvs1:/tmp/cvs-serv17147/WEB-INF/src/fake Log Message: Directory /cvsroot/peepagg//fake/WEB-INF/src/fake added to the repository |
|
From: <ch...@us...> - 2003-12-14 08:47:52
|
Update of /cvsroot/peepagg//fake/WEB-INF In directory sc8-pr-cvs1:/tmp/cvs-serv17147/WEB-INF Log Message: Directory /cvsroot/peepagg//fake/WEB-INF added to the repository |
|
From: <ch...@us...> - 2003-12-14 08:47:52
|
Update of /cvsroot/peepagg//fake/WEB-INF/src/fake
In directory sc8-pr-cvs1:/tmp/cvs-serv17268/WEB-INF/src/fake
Added Files:
LoginServlet.java
Log Message:
This is for testing LampIDP
--- NEW FILE: LoginServlet.java ---
/*
* Created on Nov 23, 2003
*
* To change the template for this generated file go to Window - Preferences -
* Java - Code Generation - Code and Comments
*/
package fake;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Random;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.sql.DataSource;
/**
* @author nick
*
* To change the template for this generated type comment go to Window -
* Preferences - Java - Code Generation - Code and Comments
*/
public class LoginServlet extends HttpServlet {
/**
*
*/
public LoginServlet() {
super();
// TODO Auto-generated constructor stub
}
/*
* (non-Javadoc)
*
* @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
// TODO Auto-generated method stub
super.doGet(arg0, arg1);
}
/*
* (non-Javadoc)
*
* @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
protected void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
HttpSession session = request.getSession();
String userName = request.getParameter("userID");
if (userName == null || userName.trim().length() == 0) {
response.setStatus(400, "User name must be set");
return;
}
Connection conn = null;
try {
conn = getConnection();
Statement statement = conn.createStatement();
Random r = new Random();
String sessionID = Integer.toHexString(r.nextInt());
boolean success =
statement.execute(
"insert into fsn_session (userID, sessionID) values ('"
+ userName
+ "','"
+ sessionID
+ "')");
session.setAttribute("fake_userId", userName);
response.sendRedirect(
"http://localhost:8080/IDP/lamp/idp?userID="
+ userName
+ "&sessionId="
+ sessionID);
} catch (Exception e) {
response.setStatus(500, e.getMessage());
e.printStackTrace();
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
}
}
}
private Connection getConnection() throws NamingException, SQLException {
Context initCtx = new InitialContext();
Context environmentContext = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) environmentContext.lookup("jdbc/fake");
Connection conn = ds.getConnection();
return conn;
}
}
|
|
From: <ch...@us...> - 2003-12-14 08:35:48
|
Update of /cvsroot/peepagg//fake/WEB-INF/lib In directory sc8-pr-cvs1:/tmp/cvs-serv17147/WEB-INF/lib Log Message: Directory /cvsroot/peepagg//fake/WEB-INF/lib added to the repository |