Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78daaf6

Browse files
committed
version 0.23.03
1 parent 83623fb commit 78daaf6

File tree

4 files changed

+43
-43
lines changed

4 files changed

+43
-43
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "zircote/oauth2",
33
"type": "library",
4-
"version": "0.23.01",
4+
"version": "0.23.03",
55
"time" : "2012-04-01",
66
"description": "OAuth2 Library, this is by no means complete nor is the test coverage optimal, mileage may (will) vary.",
77
"keywords": ["library", "OAuth2", "Auth"],

examples/mongo/authorize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* In reality, you'd probably use a nifty framework to handle most of the crud for you.
1010
*/
11-
11+
1212
require 'OAuth2/Server/MongoServer.php';
1313
require_once 'OAuth2/Exception/ServerException.php';
1414

library/OAuth2/Server/MongoServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(StorageMongo $db, $options = array())
2121
{
2222
parent::__construct($db, $options);
2323
}
24-
24+
2525
/**
2626
*
2727
* @param unknown_type $client_id

library/OAuth2/Storage/StorageMongo.php

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
*/
1919
class StorageMongo implements GrantCodeInterface, RefreshTokensInterface
2020
{
21-
const RESPONSE_TYPE_TOKEN = 'RESPONSE_TYPE_TOKEN';
22-
/**
23-
*
24-
*
25-
* @var string
26-
*/
27-
public static $CRYPT = '$2a$';
28-
/**
29-
*
30-
*
31-
* @var string
32-
*/
21+
const RESPONSE_TYPE_TOKEN = 'RESPONSE_TYPE_TOKEN';
22+
/**
23+
*
24+
*
25+
* @var string
26+
*/
27+
public static $CRYPT = '$2a$';
28+
/**
29+
*
30+
*
31+
* @var string
32+
*/
3333
public static $LOAD = '15$';
3434

3535
/**
@@ -42,37 +42,37 @@ class StorageMongo implements GrantCodeInterface, RefreshTokensInterface
4242
*/
4343
public function __construct(MongoDB $db = null) {
4444
$this->db = $db;
45-
}
46-
/**
47-
* @return string
48-
*/
49-
protected function _getSalt()
50-
{
45+
}
46+
/**
47+
* @return string
48+
*/
49+
protected function _getSalt()
50+
{
5151
return substr(
5252
str_replace('+', '.', base64_encode(sha1(microtime(true), true)))
5353
, 0, 22
54-
);
55-
}
56-
/**
57-
*
58-
*
59-
* @param string $password
60-
* @return string
61-
*/
62-
protected function _crypt($client_secret)
63-
{
64-
return crypt($client_secret, self::$CRYPT . self::$LOAD . $this->_getSalt());
65-
}
66-
/**
67-
*
68-
*
69-
* @param string $password
70-
* @param string $credential
71-
* @return boolean
72-
*/
73-
protected function _isValid($client_secret, $pw)
74-
{
75-
return ($pw == crypt($client_secret, $pw));
54+
);
55+
}
56+
/**
57+
*
58+
*
59+
* @param string $password
60+
* @return string
61+
*/
62+
protected function _crypt($client_secret)
63+
{
64+
return crypt($client_secret, self::$CRYPT . self::$LOAD . $this->_getSalt());
65+
}
66+
/**
67+
*
68+
*
69+
* @param string $password
70+
* @param string $credential
71+
* @return boolean
72+
*/
73+
protected function _isValid($client_secret, $pw)
74+
{
75+
return ($pw == crypt($client_secret, $pw));
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)