aboutsummaryrefslogtreecommitdiffstats
path: root/mod/notifications.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-15 21:49:29 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-15 21:49:29 -0700
commit35e29e10e69dfb086e990d852aa6b5006ce31d1b (patch)
tree75ba2b51a5171b90a40a8af33b11a38835cc9e21 /mod/notifications.php
parent7294a3aab110b6e740c70dc3ea086c7aa4d4dd13 (diff)
downloadvolse-hubzilla-35e29e10e69dfb086e990d852aa6b5006ce31d1b.tar.gz
volse-hubzilla-35e29e10e69dfb086e990d852aa6b5006ce31d1b.tar.bz2
volse-hubzilla-35e29e10e69dfb086e990d852aa6b5006ce31d1b.zip
installer changes, pe sync
Diffstat (limited to 'mod/notifications.php')
-rw-r--r--mod/notifications.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/mod/notifications.php b/mod/notifications.php
index f5bbe9a16..7d465e1c0 100644
--- a/mod/notifications.php
+++ b/mod/notifications.php
@@ -2,11 +2,11 @@
function notifications_post(&$a) {
- if((! x($_SESSION,'authenticated')) || (! (x($_SESSION,'uid')))) {
+ if(! local_user()) {
goaway($a->get_baseurl());
}
- $request_id = (($a->argc > 1) ? $a->argv[0] : 0);
+ $request_id = (($a->argc > 1) ? $a->argv[1] : 0);
if($request_id == "all")
return;
@@ -24,17 +24,17 @@ function notifications_post(&$a) {
$intro_id = $r[0]['id'];
}
else {
- $_SESSION['sysmsg'] .= "Invalid request identifier." . EOL;
+ notice( t('Invalid request identifier.') . EOL);
return;
}
- if($_POST['submit'] == 'Discard') {
+ if($_POST['submit'] == t('Discard'() {
$r = q("DELETE FROM `intro` WHERE `id` = %d LIMIT 1", intval($intro_id));
$r = q("DELETE `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($request_id),
intval($_SESSION['uid']));
return;
}
- if($_POST['submit'] == 'Ignore') {
+ if($_POST['submit'] == t('Ignore')) {
$r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d LIMIT 1",
intval($intro_id));
return;
@@ -48,12 +48,13 @@ function notifications_post(&$a) {
function notifications_content(&$a) {
- $o = '';
-
- if((! x($_SESSION,'authenticated')) || (! (x($_SESSION,'uid')))) {
+ if(! local_user()) {
+ notice( t('Permission denied.') . EOL);
goaway($a->get_baseurl());
}
+ $o = '';
+
if(($a->argc > 1) && ($a->argv[1] == 'all'))
$sql_extra = '';
else
@@ -63,7 +64,7 @@ function notifications_content(&$a) {
$tpl = file_get_contents('view/intros-top.tpl');
$o .= replace_macros($tpl,array(
'$hide_url' => ((strlen($sql_extra)) ? 'notifications/all' : 'notifications' ),
- '$hide_text' => ((strlen($sql_extra)) ? 'Show Ignored Requests' : 'Hide Ignored Requests')
+ '$hide_text' => ((strlen($sql_extra)) ? t('Show Ignored Requests') : t('Hide Ignored Requests'))
));
$r = q("SELECT `intro`.`id` AS `intro-id`, `intro`.*, `contact`.*
@@ -85,14 +86,14 @@ function notifications_content(&$a) {
'$contact-id' => $rr['contact-id'],
'$photo' => ((x($rr,'photo')) ? $rr['photo'] : "images/default-profile.jpg"),
'$fullname' => $rr['name'],
- '$knowyou' => (($rr['knowyou']) ? 'yes' : 'no'),
+ '$knowyou' => (($rr['knowyou']) ? t('yes') : t('no')),
'$url' => $rr['url'],
'$note' => $rr['note']
));
}
}
else
- $_SESSION['sysmsg'] .= "No notifications." . EOL;
+ notice( t('No notifications.') . EOL);
return $o;
} \ No newline at end of file