Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi Auth integration #206 #226

Merged
merged 46 commits into from
May 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b3066c9
mailer
yuklia Feb 26, 2015
df5545c
hybrid auth
yuklia May 5, 2015
3652a36
hotfix
yuklia May 5, 2015
ab80d90
test
yuklia May 5, 2015
765927b
hotfix
yuklia May 5, 2015
0ddedd8
test
May 6, 2015
3e259b6
sign in via twitter
yuklia May 6, 2015
fc2566a
hotfix
yuklia May 6, 2015
6b18359
facebook/google
yuklia May 6, 2015
49d9069
config modified
yuklia May 6, 2015
38056ee
change prov
yuklia May 6, 2015
74e47a7
auth providers
yuklia May 6, 2015
3fa4666
auth providers
yuklia May 6, 2015
eb565be
unused classes were removed
yuklia May 6, 2015
c211394
hotfix
yuklia May 6, 2015
5f5f397
enpoint fix
yuklia May 6, 2015
1632ce6
hotfix
yuklia May 6, 2015
5dec51a
hotfix
yuklia May 6, 2015
d5c248d
provider cheking
yuklia May 6, 2015
2fd9b28
hotfix
yuklia May 7, 2015
ebf4a1f
hotfix
yuklia May 7, 2015
b81e5c0
tests
yuklia May 7, 2015
46c9078
hybrid auth outside
yuklia May 7, 2015
fe83121
test
yuklia May 7, 2015
719964b
linked to test
May 7, 2015
dedae84
fix
May 7, 2015
69124b7
tests
yuklia May 8, 2015
deebdbd
hotfix
yuklia May 8, 2015
96dc8dd
old functionality
yuklia May 8, 2015
ae3b702
mailer config was restored
yuklia May 8, 2015
36bc319
phpunit.xml was added to .gitignore/hybridauth.php was restored
yuklia May 8, 2015
c984180
hybridauth/hybridauth was replaced to require section
yuklia May 8, 2015
67e220b
hotfix
yuklia May 8, 2015
0a44eaa
hotfix
yuklia May 8, 2015
4d8fdeb
controller index.php was restored
yuklia May 8, 2015
c303055
unused attribute data-provider was removed from profile.phtml
yuklia May 8, 2015
6f0b893
hotfix
yuklia May 8, 2015
05983a4
single blank line for mailer.php
yuklia May 8, 2015
aaf0e5c
psr2
yuklia May 8, 2015
dbdaada
psr2
yuklia May 8, 2015
49daa81
test testUserNotLinkedTo was fixed
yuklia May 8, 2015
d68cd71
old facebook/controlles was remowed
yuklia May 8, 2015
e0ad5ce
hotfix
yuklia May 8, 2015
98fec4c
psr2
yuklia May 8, 2015
0c8465f
guzzle, google,twitter,facebook libs were removed
yuklia May 13, 2015
d0b34db
.gitignore was added to public
yuklia May 13, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ nbproject
composer.lock
composer.phar
/vendor/*
phpunit.xml
12 changes: 0 additions & 12 deletions application/configs/default/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,5 @@
"encryptFunction" => function ($password, $salt) {
return md5(md5($password) . $salt);
}
),
"facebook" => array(
"appId" => "%%appId%%",
"secret" => "%%secret%%",
),
"twitter" => array(
"consumer_key" => "%%consumerKey%%",
"consumer_secret" => "%%consumerSecret%%"
),
"google" => array(
'client_id' => "%%client_id%%",
'client_secret' => '%%client_secret%%'
)
);
49 changes: 49 additions & 0 deletions application/configs/default/hybridauth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пора бы на что-нить более стандартное поменять

* Created by PhpStorm.
* User: yuklia
* Date: 05.05.15
* Time: 14:04
*/

/**
* @link http://hybridauth.sourceforge.net/userguide/Configuration.html
*/
return array(
//"base_url" the url that point to HybridAuth Endpoint (where index.php and config.php are found)
"base_url" => "%%domain%%/auth/endpoint",

"providers" => array(
// google
"Google" => array( // 'id' is your google client id
"enabled" => true,
"wrapper" => array( "path" => "Providers/Google.php", "class" => "Hybrid_Providers_Google" ),
"keys" => array("id" => "%%client_id%%",
"secret" => "%%client_secret%%"),
"scope" => "https://www.googleapis.com/auth/userinfo.profile ". // optional
"https://www.googleapis.com/auth/userinfo.email" , // optional
"access_type" => "offline", // optional
"approval_prompt" => "force", // optional
),

// facebook
"Facebook" => array( // 'id' is your facebook application id
"enabled" => true,
"wrapper" => array( "path" => "Providers/Facebook.php", "class" => "Hybrid_Providers_Facebook" ),
"keys" => array("id" => "%%appId%%", "secret" => "%%secret%%"),
"scope" => "email, user_about_me, user_birthday, user_hometown, publish_actions", // optional
),

// twitter
"Twitter" => array( // 'key' is your twitter application consumer key
"enabled" => true,
"wrapper" => array( "path" => "Providers/Twitter.php", "class" => "Hybrid_Providers_Twitter" ),
"keys" => array("key" => "%%consumerKey%%", "secret" => "%%consumerSecret%%")
)
),

"debug_mode" => false,

// to enable logging, set 'debug_mode' to true, then provide here a path of a writable file
"debug_file" =>''
);
111 changes: 0 additions & 111 deletions application/library/Google/Client.php

This file was deleted.

127 changes: 0 additions & 127 deletions application/library/Twitter/Client.php

This file was deleted.

44 changes: 44 additions & 0 deletions application/models/Auth/AuthInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Created by PhpStorm.
* User: yuklia
* Date: 06.05.15
* Time: 18:41
*/
namespace Application\Auth;

/**
* Interface AuthInterface
* @package Application\Auth
*/
interface AuthInterface
{
/**
* @param array $data
* @param \Application\Users\Row $user
* @return void
*/
public function registration($data, $user);

/**
* @return void
*/
public function authProcess();

/**
* @return array
* @throws \Application\Exception
*/
public function getOptions();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Придираюсь, но перевод строки лишний :)

/**
* @param \Application\Auth\Row $auth
* @return mixed
*/
public function alreadyRegisteredLogic($auth);

/**
* @return array
*/
public function getProfile();
}