-
Notifications
You must be signed in to change notification settings - Fork 10
/
plaincas.settings.php
58 lines (49 loc) · 1.44 KB
/
plaincas.settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
* The function plaincas_group_patterns has to return an array
* with the groups as keys and the corresponding regular expressions as values.
* Other groups can be assigned with the custom groups.
*/
function plaincas_group_patterns() {
$groups = array(
'group1' => '/^(some-attribute)$/',
);
return $groups;
}
/*
* The function plaincas_pattern_attributes has to return an array
* with the CAS attributes which will be matched against the regular expressions
* $attributes = phpCAS::getAttributes();
*/
function plaincas_pattern_attributes( $attributes ){
if (is_array($attributes['roles'])) {
return $attributes['roles'];
}
else {
return array($attributes['roles']);
}
}
/*
* The function plaincas_user_attributes has to return an array
* with keys 'name' and 'mail' representing the user.
* $attributes = phpCAS::getAttributes();
*/
function plaincas_user_attributes( $attributes ){
return array(
'name' => $attributes['first'] . ' ' . $attributes['last'],
'mail' => $attributes['mail'],
);
}
/*
* The function plaincas_custom_groups has to return an array
* with groupnames as keys and an array or usernames.
*
* Custom groups are independent of CAS attributes or groups but the group names can be the same.
*/
function plaincas_custom_groups(){
$groups = array(
'group1' => array('username1', 'userame2'),
'group2' => array('username3', 'userame4'),
);
return $groups;
}