-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathget_groups.php
More file actions
30 lines (27 loc) · 809 Bytes
/
get_groups.php
File metadata and controls
30 lines (27 loc) · 809 Bytes
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
<?php
$CONFIG_FILENAME = 'data/config.xml';
//config.xml dateisystem rechte überprüfen
if(!file_exists($CONFIG_FILENAME)) {
echo "Kann die Konfiguration (".$CONFIG_FILENAME.") nicht finden!\n";
exit(1);
}
if(!is_readable($CONFIG_FILENAME)) {
echo "Kann die Konfiguration (".$CONFIG_FILENAME.") nicht lesen!\n";
exit(2);
}
//config.xml einlesen
libxml_use_internal_errors(true);
$xml = simplexml_load_file($CONFIG_FILENAME);
if (!$xml) {
echo "Kann die Konfiguration (".$CONFIG_FILENAME.") nicht laden!\n";
foreach(libxml_get_errors() as $error) {
echo "\t", $error->message;
}
exit(4);
}
$ResStr="";
foreach($xml->groups->group as $group) {
$ResStr .= $group->id.":".$group->name."|";
}
echo substr($ResStr, 0, strlen($ResStr)-1);
?>