summaryrefslogtreecommitdiff
path: root/actions/newnotice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-22 14:55:00 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-22 14:55:00 -0400
commita39bb63ebdf1e1025abb5c506db2c0dd82a55773 (patch)
treecc3ce05909f0dd4a4648c7fe48d28d0f104f547c /actions/newnotice.php
parent139fd492ff636581d525d576eead1796c37da155 (diff)
add tags on creation of notices and users
darcs-hash:20080522185500-84dde-39a66d36d2c80ff57e2ab2d0274548770c4d06f7.gz
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r--actions/newnotice.php19
1 files changed, 14 insertions, 5 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) {