|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | /** |
4 | | -* Copyright 2013 François Kooman <[email protected]> |
5 | | -* |
6 | | -* Licensed under the Apache License, Version 2.0 (the "License"); |
7 | | -* you may not use this file except in compliance with the License. |
8 | | -* You may obtain a copy of the License at |
9 | | -* |
10 | | -* http://www.apache.org/licenses/LICENSE-2.0 |
11 | | -* |
12 | | -* Unless required by applicable law or agreed to in writing, software |
13 | | -* distributed under the License is distributed on an "AS IS" BASIS, |
14 | | -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 | | -* See the License for the specific language governing permissions and |
16 | | -* limitations under the License. |
17 | | -*/ |
18 | | - |
19 | | -require_once dirname(__DIR__) . '/vendor/autoload.php'; |
20 | | - |
21 | | -use fkooman\Config\Config; |
| 4 | + * Copyright 2013 François Kooman <[email protected]>. |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | +require_once dirname(__DIR__).'/vendor/autoload.php'; |
| 19 | + |
| 20 | +use fkooman\VootProvider\Config\Config; |
22 | 21 | use fkooman\VootProvider\PdoVootStorage; |
23 | 22 |
|
24 | | -$config = Config::fromIniFile(dirname(__DIR__) . '/config/voot.ini'); |
| 23 | +$config = Config::fromIniFile(dirname(__DIR__).'/config/voot.ini'); |
25 | 24 |
|
26 | 25 | $storage = new PdoVootStorage($config); |
27 | 26 |
|
28 | | -$data = file_get_contents(dirname(__DIR__) . '/schema/user_attributes.json'); |
| 27 | +$data = file_get_contents(dirname(__DIR__).'/schema/user_attributes.json'); |
29 | 28 | $d = json_decode($data, true); |
30 | 29 |
|
31 | 30 | foreach ($d as $v) { |
32 | 31 | $storage->addUser($v['id'], $v['displayName'], $v['mail']); |
33 | 32 | } |
34 | 33 |
|
35 | | -$data = file_get_contents(dirname(__DIR__) . '/schema/group_membership.json'); |
| 34 | +$data = file_get_contents(dirname(__DIR__).'/schema/group_membership.json'); |
36 | 35 | $d = json_decode($data, true); |
37 | 36 |
|
38 | 37 | foreach ($d as $v) { |
|
45 | 44 | function roleToInt($role) |
46 | 45 | { |
47 | 46 | switch ($role) { |
48 | | - case "member": |
| 47 | + case 'member': |
49 | 48 | return 10; |
50 | | - case "admin": |
| 49 | + case 'admin': |
51 | 50 | return 50; |
52 | | - case "manager": |
| 51 | + case 'manager': |
53 | 52 | return 20; |
54 | 53 | default: |
55 | | - die("invalid role"); |
| 54 | + die('invalid role'); |
56 | 55 | } |
57 | 56 | } |
0 commit comments