diff options
author | Guy Brand <gb@isis.u-strasbg.fr> | 2008-03-18 23:16:59 +0100 |
---|---|---|
committer | Guy Brand <gb@isis.u-strasbg.fr> | 2008-03-18 23:16:59 +0100 |
commit | 613964ece4a601dcc0fcc5888abb2c052c636689 (patch) | |
tree | 858e507967d819c78f719437b26658427ac0d550 | |
parent | d288e1977673609c78ece109e5f2231093fef75d (diff) | |
download | rpg-613964ece4a601dcc0fcc5888abb2c052c636689.tar.gz rpg-613964ece4a601dcc0fcc5888abb2c052c636689.tar.bz2 |
Fix message displayed after (un)subscribens action
darcs-hash:20080318221659-19e2d-bf5088e16c3a9c65bb70dd58fff4e385b5851204.gz
-rw-r--r-- | inc/actions.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/inc/actions.php b/inc/actions.php index 2ae366ce0..c0f85c97a 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -466,17 +466,22 @@ function act_subscriptionns($act){ if(!getNS($ID)) { $file = metaFN(getNS($ID),'.mlist'); + $ns = "root"; } else { $file = metaFN(getNS($ID),'/.mlist'); + $ns = getNS($ID); } + // reuse strings used to display the status of the subscribe action + $act_msg = rtrim($act, 'ns'); + if ($act=='subscribens' && !$INFO['subscribedns']){ if ($INFO['userinfo']['mail']){ if (io_saveFile($file,$_SERVER['REMOTE_USER']."\n",true)) { $INFO['subscribedns'] = true; - msg(sprintf($lang[$act.'_success'], $INFO['userinfo']['name'], $ID),1); + msg(sprintf($lang[$act_msg.'_success'], $INFO['userinfo']['name'], $ns),1); } else { - msg(sprintf($lang[$act.'_error'], $INFO['userinfo']['name'], $ID),1); + msg(sprintf($lang[$act_msg.'_error'], $INFO['userinfo']['name'], $ns),1); } } else { msg($lang['subscribe_noaddress']); @@ -484,9 +489,9 @@ function act_subscriptionns($act){ } elseif ($act=='unsubscribens' && $INFO['subscribedns']){ if (io_deleteFromFile($file,$_SERVER['REMOTE_USER']."\n")) { $INFO['subscribedns'] = false; - msg(sprintf($lang[$act.'_success'], $INFO['userinfo']['name'], $ID),1); + msg(sprintf($lang[$act_msg.'_success'], $INFO['userinfo']['name'], $ns),1); } else { - msg(sprintf($lang[$act.'_error'], $INFO['userinfo']['name'], $ID),1); + msg(sprintf($lang[$act_msg.'_error'], $INFO['userinfo']['name'], $ns),1); } } |