summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-17 16:21:32 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-17 16:21:32 -0400
commit1950efda80012ebeded8e7da71c7293b7ee86c08 (patch)
treee9b7bea308f7f6e33310c3c88635b648a9c47c39
parent7ee294de755a919237f9e58032c27be9492391a2 (diff)
save profile url
darcs-hash:20080517202132-84dde-78c7fe9f22aa28f33e9e00432f5cf6436b64e6b5.gz
-rw-r--r--actions/profilesettings.php3
-rw-r--r--actions/register.php1
-rw-r--r--doc/TODO4
-rw-r--r--lib/common.php4
4 files changed, 10 insertions, 2 deletions
diff --git a/actions/profilesettings.php b/actions/profilesettings.php
index 7779379b1..fff6e3bd9 100644
--- a/actions/profilesettings.php
+++ b/actions/profilesettings.php
@@ -78,7 +78,8 @@ class ProfilesettingsAction extends SettingsAction {
$profile->homepage = $this->arg('homepage');
$profile->bio = $this->arg('bio');
$profile->location = $this->arg('location');
-
+ $profile->profileurl = common_profile_url($nickname);
+
if (!$profile->update()) {
common_server_error(_t('Couldnt save profile.'));
return;
diff --git a/actions/register.php b/actions/register.php
index 5c30fa1b3..fcf371d3a 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -81,6 +81,7 @@ class RegisterAction extends Action {
# TODO: wrap this in a transaction!
$profile = new Profile();
$profile->nickname = $nickname;
+ $profile->profileurl = common_profile_url($nickname);
$profile->created = DB_DataObject_Cast::dateTime(); # current time
$id = $profile->insert();
if (!$id) {
diff --git a/doc/TODO b/doc/TODO
index ea703c3fe..13186779f 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -23,6 +23,7 @@
+ new notice redirects to notice page
+ date in shown notice links to notice page
+ common_redirect()
++ configuration system ($config)
+ release 0.1
- doc action
- default to doc, title = main
@@ -30,11 +31,12 @@
- default HTML type
- set Content-Type
- show current values in profile settings
+- save profile URL in profilesettings
+- save profile URL on registration
- require valid nicknames
- store canonical username for comparison and fetch
- use only canonical usernames
- use only canonical email addresses
-- configuration system ($config)
- RSS 1.0 feeds of a user's notices
- RSS 1.0 dump of a user's notices
- RSS 1.0 feed of all public notices
diff --git a/lib/common.php b/lib/common.php
index 85654d306..e8a7ac6ae 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -317,6 +317,10 @@ function common_broadcast_notices($id) {
return true;
}
+function common_profile_url($nickname) {
+ return common_local_url('showstream', array('nickname' => $nickname));
+}
+
// XXX: set up gettext
function _t($str) {