forked from mixu/useradmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.php
38 lines (34 loc) · 967 Bytes
/
init.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
<?php defined('SYSPATH') or die('No direct access allowed.');
Route::set('user/default', 'user(/<action>(/<provider>))',
array(
'action' => '(provider|provider_return|associate|associate_return)',
'provider' => '.+',
))
->defaults(array(
'controller' => 'user',
'action' => 'index',
'provider' => NULL,
));
Route::set('user/admin', 'admin_user(/<action>(/<id>))',
array(
'action' => '(edit|delete)',
))
->defaults(array(
'controller' => 'admin_user',
'action' => 'index',
'id' => NULL,
));
// Static file serving (CSS, JS, images)
Route::set('assets', 'useradmin_assets/<dir>(/<file>)', array('file' => '.+', 'dir' => '(css|img|js)'))
->defaults(array(
'controller' => 'user',
'action' => 'media',
'file' => NULL,
'dir' => NULL,
));
//set the cookie salt if it is not yet set
if( ! Cookie::$salt )
{
$auth = Kohana::$config->load('useradmin.auth');
Cookie::$salt = $auth['cookie_salt'];
}