summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-06-15 03:26:32 +0000
committerSarven Capadisli <csarven@controlyourself.ca>2009-06-15 03:26:32 +0000
commit8dd5871d4fb15a7996388108550839315e96adad (patch)
treeeb71a1301d1073a95b169830781999db225f9b97 /lib
parent0bc9b2e730bb6368d36ba5bb3f2df1bf1432adad (diff)
parentf8da15bf41b07a46b1fbe5323e2b8136d42c5b31 (diff)
Merge branch '0.8.x' of git@gitorious.org:laconica/dev into 0.8.x
Diffstat (limited to 'lib')
-rw-r--r--lib/grouplist.php2
-rw-r--r--lib/groupnav.php6
-rw-r--r--lib/router.php13
3 files changed, 16 insertions, 5 deletions
diff --git a/lib/grouplist.php b/lib/grouplist.php
index 1b8547499..1ded5160b 100644
--- a/lib/grouplist.php
+++ b/lib/grouplist.php
@@ -166,7 +166,7 @@ class GroupList extends Widget
if ($user->isMember($this->group)) {
$lf = new LeaveForm($this->out, $this->group);
$lf->show();
- } else {
+ } else if (!Group_block::isBlocked($this->group, $user->getProfile())) {
$jf = new JoinForm($this->out, $this->group);
$jf->show();
}
diff --git a/lib/groupnav.php b/lib/groupnav.php
index 90bdc1014..194247982 100644
--- a/lib/groupnav.php
+++ b/lib/groupnav.php
@@ -95,6 +95,12 @@ class GroupNav extends Widget
$cur = common_current_user();
if ($cur && $cur->isAdmin($this->group)) {
+ $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' =>
+ $nickname)),
+ _('Blocked'),
+ sprintf(_('%s blocked users'), $nickname),
+ $action_name == 'blockedfromgroup',
+ 'nav_group_blocked');
$this->out->menuItem(common_local_url('editgroup', array('nickname' =>
$nickname)),
_('Admin'),
diff --git a/lib/router.php b/lib/router.php
index 456d1793e..e10871bc0 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -101,7 +101,8 @@ class Router
$main = array('login', 'logout', 'register', 'subscribe',
'unsubscribe', 'confirmaddress', 'recoverpassword',
'invite', 'favor', 'disfavor', 'sup',
- 'block', 'subedit');
+ 'block', 'unblock', 'subedit',
+ 'groupblock', 'groupunblock');
foreach ($main as $a) {
$m->connect('main/'.$a, array('action' => $a));
@@ -164,10 +165,10 @@ class Router
array('action' => 'newnotice'),
array('replyto' => '[A-Za-z0-9_-]+'));
- $m->connect('notice/:notice/file',
- array('action' => 'file'),
+ $m->connect('notice/:notice/file',
+ array('action' => 'file'),
array('notice' => '[0-9]+'));
-
+
$m->connect('notice/:notice',
array('action' => 'shownotice'),
array('notice' => '[0-9]+'));
@@ -228,6 +229,10 @@ class Router
array('nickname' => '[a-zA-Z0-9]+'));
}
+ $m->connect('group/:nickname/blocked',
+ array('action' => 'blockedfromgroup'),
+ array('nickname' => '[a-zA-Z0-9]+'));
+
$m->connect('group/:id/id',
array('action' => 'groupbyid'),
array('id' => '[0-9]+'));