Skip to content
Snippets Groups Projects
Commit 613964ec authored by Guy Brand's avatar Guy Brand
Browse files

Fix message displayed after (un)subscribens action

darcs-hash:20080318221659-19e2d-bf5088e16c3a9c65bb70dd58fff4e385b5851204.gz
parent d288e197
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment