summaryrefslogtreecommitdiff
path: root/_test/cases
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2010-12-08 23:41:59 +0100
committerAndreas Gohr <andi@splitbrain.org>2010-12-08 23:41:59 +0100
commitd6dc956f8c13064c5e638d5ba817123f66261cfe (patch)
tree137e886f44655fae8c52878f64d9617917fcf63f /_test/cases
parent5b72404c10cb148753118be9ff987ab339b2db06 (diff)
downloadrpg-d6dc956f8c13064c5e638d5ba817123f66261cfe.tar.gz
rpg-d6dc956f8c13064c5e638d5ba817123f66261cfe.tar.bz2
added auth_isMember()
This function abstracts checking a given user and her groups against a given member list (as used in the superuser and manager options). It is also used in auth_isManager() and auth_isAdmin(), unlike the previous function, this one skips the nameencode step as it should be unnessary here (all input is given decoded). The test cases where extended by some non-ID user and group names. People with non-plain auth backends should check that their administrator and manager setups still work as expected
Diffstat (limited to '_test/cases')
-rw-r--r--_test/cases/inc/auth_admincheck.test.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/_test/cases/inc/auth_admincheck.test.php b/_test/cases/inc/auth_admincheck.test.php
index b21c2fe27..01dd38df7 100644
--- a/_test/cases/inc/auth_admincheck.test.php
+++ b/_test/cases/inc/auth_admincheck.test.php
@@ -15,8 +15,8 @@ class auth_admin_test extends UnitTestCase {
function test_ismanager(){
global $conf;
- $conf['superuser'] = 'john,@admin';
- $conf['manager'] = 'john,@managers,doe';
+ $conf['superuser'] = 'john,@admin,@Mötly Görls, Dörte';
+ $conf['manager'] = 'john,@managers,doe, @Mötly Böys, Dänny';
// anonymous user
$this->assertEqual(auth_ismanager('jill', null,false), false);
@@ -25,9 +25,15 @@ class auth_admin_test extends UnitTestCase {
$this->assertEqual(auth_ismanager('john', null,false), true);
$this->assertEqual(auth_ismanager('doe', null,false), true);
+ $this->assertEqual(auth_ismanager('dörte', null,false), true);
+ $this->assertEqual(auth_ismanager('dänny', null,false), true);
+
// admin or manager groups
$this->assertEqual(auth_ismanager('jill', array('admin'),false), true);
$this->assertEqual(auth_ismanager('jill', array('managers'),false), true);
+
+ $this->assertEqual(auth_ismanager('jill', array('mötly görls'),false), true);
+ $this->assertEqual(auth_ismanager('jill', array('mötly böys'),false), true);
}
function test_isadmin(){