summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/newnotice.php19
-rw-r--r--actions/register.php3
2 files changed, 16 insertions, 6 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 535b1a512..b2c513733 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -55,13 +55,22 @@ class NewnoticeAction extends Action {
$id = $notice->insert();
- if ($id) {
- common_broadcast_notices($id);
- common_redirect(common_local_url('shownotice',
- array('notice' => $id)), 303);
- } else {
+ if (!$id) {
+ common_server_error(_t('Problem saving notice.'));
+ return;
+ }
+
+ $orig = clone($notice);
+ $notice->uri = common_mint_tag('notice:' . $id);
+
+ if (!$notice->update($orig)) {
common_server_error(_t('Problem saving notice.'));
+ return;
}
+
+ common_broadcast_notice($notice);
+ common_redirect(common_local_url('shownotice',
+ array('notice' => $id)), 303);
}
function show_form($msg=NULL) {
diff --git a/actions/register.php b/actions/register.php
index c67235f9d..fc729a29b 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -103,7 +103,8 @@ class RegisterAction extends Action {
$user->password = common_munge_password($password, $id);
$user->email = $email;
$user->created = DB_DataObject_Cast::dateTime(); # current time
-
+ $user->uri = common_mint_tag('user:'.$id);
+
$result = $user->insert();
if (!$result) {
# Try to clean up...