Repository navigation
Expand file tree
/
Copy pathinit.php
More file actions
136 lines (126 loc) · 3.58 KB
/
Copy pathinit.php
File metadata and controls
136 lines (126 loc) · 3.58 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/**
* Setting the Routes
*
* @package Gleez\User\Routing
* @author Gleez Team
* @copyright (c) 2011-2014 Gleez Technologies
* @license http://gleezcms.org/license Gleez CMS License
*/
if ( ! Route::cache())
{
//User Backend routes
Route::set('admin/permission', 'admin/permissions(/<action>)(/<id>)', array(
'id' => '\d+',
'action' => 'list|role|user'
))
->defaults(array(
'directory' => 'admin',
'controller' => 'permission',
'action' => 'list'
));
Route::set('admin/role', 'admin/roles(/<action>(/<id>))(/p<page>)', array(
'id' => '\d+',
'page' => '\d+',
'action' => 'list|add|edit|delete'
))
->defaults(array(
'directory' => 'admin',
'controller' => 'role',
'action' => 'list'
));
Route::set('admin/user', 'admin/users(/<action>(/<id>))(/p<page>)', array(
'id' => '\d+',
'page' => '\d+',
'action' => 'list|add|edit|delete'
))
->defaults(array(
'directory' => 'admin',
'controller' => 'user',
'action' => 'list',
));
//User Frontend routes
Route::set('user', 'user(/<action>)(/<id>)(/<token>)', array(
'action' => 'edit|login|logout|view|register|confirm|password|profile|photo',
'id' => '\d+'
))
->defaults(array(
'controller' => 'user',
'action' => 'view',
'token' => NULL,
));
Route::set('user/oauth', 'oauth/<controller>(/<action>)')
->defaults(array(
'directory' => 'oauth',
'action' => 'index',
));
Route::set('user/reset', 'user/reset(/<action>)(/<id>)(/<token>)(/<time>)', array(
'action' => 'password|confirm_password',
'id' => '\d+',
'time' => '\d+'
))
->defaults(array(
'controller' => 'user',
'action' => 'confirm_password',
'token' => NULL,
'time' => NULL,
));
Route::set('user/buddy', 'buddy(/<action>)(/<id>)(/p<page>)', array(
'action' => 'index|add|accept|reject|delete|sent|pending',
'id' => '\d+',
'page' => '\d+',
))
->defaults(array(
'controller' => 'buddy',
'action' => 'index',
));
Route::set('user/message', 'message(/<action>)(/<id>)', array(
'id' => '\d+',
'action' => 'index|inbox|outbox|drafts|list|view|edit|compose|delete|bulk'
))
->defaults(array(
'controller' => 'message',
'action' => 'index'
));
}
/**
* Define Module specific Permissions
*
* Definition of user privileges by default if the ACL is present in the system.
* Note: Parameter `restrict access` indicates that these privileges have serious
* implications for safety.
*
* @uses ACL Used to define the privileges
*/
if ( ! ACL::cache() )
{
ACL::set('user', array(
'administer permissions' => array(
'title' => __('Administer permissions'),
'restrict access' => TRUE,
'description' => __('Managing user authority'),
),
'administer users' => array(
'title' => __('Administer users'),
'restrict access' => TRUE,
'description' => __('Users management'),
),
'access profiles' => array(
'title' => __('Access profiles'),
'restrict access' => FALSE,
'description' => __('Access to all profiles'),
),
'edit profile' => array(
'title' => __('Editing profile'),
'restrict access' => FALSE,
'description' => __('The ability to change profile'),
),
'change own username' => array(
'title' => __('Change own username'),
'restrict access' => TRUE,
'description' => __('The ability to change own username'),
)
));
/** Cache the module specific permissions in production */
ACL::cache(FALSE, Kohana::$environment === Kohana::PRODUCTION);
}