forked from ldleman/yana-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetting.php
More file actions
executable file
·109 lines (88 loc) · 2.8 KB
/
setting.php
File metadata and controls
executable file
·109 lines (88 loc) · 2.8 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
require_once(dirname(__FILE__).'/header.php');
if(isset($myUser) && $myUser!=false && $myUser->can('configuration', 'r')){
switch(@$_['section']){
case 'plugin':
$plugins = Plugin::getAll();
$tpl->assign('plugins',$plugins);
break;
case 'user':
//Gestion de la modification des utilisateurs
if (isset($_['id_user'])){
$usersManager = new User();
$id_modusers = $_['id_user'];
$selected = $usersManager->getById($id_modusers);
$description = $selected->GetFirstName()." ".$selected->GetName();
$button = "Modifier";
$tpl->assign('id_modusers',$id_modusers);
$tpl->assign('login',$selected->getLogin());
$tpl->assign('firstname',$selected->getFirstName());
$tpl->assign('lastname',$selected->getName());
$tpl->assign('email',$selected->getMail());
$tpl->assign('userrank',$selected->getRank());
}
else
{
$description = "Ajout d'un utilisateur";
$button = "Ajouter";
$tpl->assign('userrank','');
}
$tpl->assign('button',$button);
$tpl->assign('description',$description);
$users = User::getAllUsers();
$ranks = new Rank();
$ranks = $ranks->populate();
$ranksLabel = array();
foreach($ranks as $rank){
$ranksLabel[$rank->getId()]= $rank->getLabel();
}
$tpl->assign('ranksLabel',$ranksLabel);
$tpl->assign('users',$users);
$tpl->assign('ranks',$ranks);
break;
case 'access':
$rankManager = new Rank();
$ranks = $rankManager->populate();
//Gestion de la modification des rank
if (isset($_['id_rank'])){
$id_modrank = $_['id_rank'];
$selected = $rankManager->getById($id_modrank);
$description = $selected->getLabel();
$button = "Modifier";
$tpl->assign('id_modrank',$id_modrank);
$tpl->assign('label_rank',$selected->getLabel());
$tpl->assign('description_rank',$selected->getDescription());
}
else
{
$description = "Ajout d'un rang";
$button = "Ajouter";
}
$tpl->assign('description',$description);
$tpl->assign('button',$button);
$tpl->assign('ranks',$ranks);
break;
case 'right':
$rightManager = new Right();
$sectionManager = new Section();
$rank = new Rank();
$rank = $rank->getById($_['id']);
$rights = $rightManager->loadAll(array('rank'=>$_['id']));
$rightsDictionnary = array();
foreach ($rights as $value) {
$rightsDictionnary[$value->getSection()]['c'] = $value->getCreate();
$rightsDictionnary[$value->getSection()]['r'] = $value->getRead();
$rightsDictionnary[$value->getSection()]['u'] = $value->getUpdate();
$rightsDictionnary[$value->getSection()]['d'] = $value->getDelete();
}
$tpl->assign('rights',$rightsDictionnary);
$tpl->assign('sections',$sectionManager->populate('label'));
$tpl->assign('rank',$rank);
break;
}
$view = 'setting';
}else{
exit('Vous devez être connecté');
}
require_once(dirname(__FILE__).'/footer.php');
?>