-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathorchestra.php
executable file
·110 lines (82 loc) · 3.55 KB
/
orchestra.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
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
<?php
/*
|--------------------------------------------------------------------------
| Integration with Orchestra
|--------------------------------------------------------------------------
|
| Overwrite default configuration.
|
*/
Config::set('oneauth::urls', array(
'registration' => handles('orchestra::register'),
'login' => handles('orchestra::login'),
'callback' => handles('oneauth::connect/callback'),
'registered' => handles('orchestra'),
'logged_in' => handles('orchestra'),
));
Orchestra\Extension\Config::map('oneauth', array(
'basecamp_id' => 'oneauth::api.providers.basecamp.id',
'basecamp_secret' => 'oneauth::api.providers.basecamp.secret',
'dropbox_key' => 'oneauth::api.providers.dropbox.key',
'dropbox_secret' => 'oneauth::api.providers.dropbox.secret',
'facebook_id' => 'oneauth::api.providers.facebook.id',
'facebook_secret' => 'oneauth::api.providers.facebook.secret',
'facebook_scope' => 'oneauth::api.providers.facebook.scope',
'flickr_key' => 'oneauth::api.providers.flickr.key',
'flickr_secret' => 'oneauth::api.providers.flickr.secret',
'foursquare_id' => 'oneauth::api.providers.foursquare.id',
'foursquare_secret' => 'oneauth::api.providers.foursquare.secret',
'github_id' => 'oneauth::api.providers.github.id',
'github_secret' => 'oneauth::api.providers.github.secret',
'google_id' => 'oneauth::api.providers.google.id',
'google_secret' => 'oneauth::api.providers.google.secret',
'instagram_id' => 'oneauth::api.providers.instagram.id',
'instagram_secret' => 'oneauth::api.providers.instagram.secret',
'linkedin_key' => 'oneauth::api.providers.linkedin.key',
'linkedin_secret' => 'oneauth::api.providers.linkedin.secret',
'paypal_id' => 'oneauth::api.providers.paypal.id',
'paypal_secret' => 'oneauth::api.providers.paypal.secret',
'soundcloud_id' => 'oneauth::api.providers.soundcloud.id',
'soundcloud_secret' => 'oneauth::api.providers.soundcloud.secret',
'tumblr_key' => 'oneauth::api.providers.tumblr.key',
'tumblr_secret' => 'oneauth::api.providers.tumblr.secret',
'twitter_key' => 'oneauth::api.providers.twitter.key',
'twitter_secret' => 'oneauth::api.providers.twitter.secret',
'vimeo_key' => 'oneauth::api.providers.vimeo.key',
'vimeo_secret' => 'oneauth::api.providers.vimeo.secret',
'windowslive_id' => 'oneauth::api.providers.windowslive.id',
'windowslive_secret' => 'oneauth::api.providers.windowslive.secret',
));
/*
|--------------------------------------------------------------------------
| Integration with Orchestra
|--------------------------------------------------------------------------
|
| Map controller routing for OneAuth.
|
*/
Route::controller(array('oneauth::connect'));
/*
|--------------------------------------------------------------------------
| Integration with Orchestra
|--------------------------------------------------------------------------
|
| Add on logged-in integration between OneAuth and Orchestra.
|
*/
Event::listen('orchestra.auth: login', function()
{
$user = IoC::resolve('oneauth.driver: auth.user');
Event::fire('oneauth.sync', array($user->id));
});
IoC::register('orchestra.user: register', function ()
{
$user = new Orchestra\Model\User;
if ( ! is_null($session = OneAuth\Auth\Core::session()))
{
$user->fullname = $session['info']['name'] ?: '';
$user->email = $session['info']['email'] ?: '';
}
return $user;
});
include_once Bundle::path('oneauth').'orchestra'.DS.'configure'.EXT;