Browse files

rename oauth_consumer to oauth_provider_consumer

  • Loading branch information...
1 parent d749ef3 commit fdae9ed27d9b8b84729ba364e96142b55cc2c470 Freek Lijten committed Sep 29, 2011
Showing with 7 additions and 7 deletions.
  1. +1 −1 src/example/provider/create_consumer.php
  2. +1 −1 src/lib/tables.sql
  3. +5 −5 src/model/OAuthConsumerModel.php
View
2 src/example/provider/create_consumer.php
@@ -14,7 +14,7 @@ function newConsumerInfo($DB)
$consumerKey = sha1(substr($random, 0, 100));
$consumerSecret = sha1(substr($random, 100, 100));
- $sql = "INSERT INTO `oauth_consumer`
+ $sql = "INSERT INTO `oauth_provider_consumer`
SET consumer_key = '" . $DB->real_escape_string($consumerKey) . "',
consumer_secret = '" . $DB->real_escape_string($consumerSecret) . "',
consumer_create_date = '" . $DB->real_escape_string(time()) . "'";
View
2 src/lib/tables.sql
@@ -1,6 +1,6 @@
# This file contains the table definitions necessary for using the OAuth provider class out of the box.
-CREATE TABLE `oauth_consumer` (
+CREATE TABLE `oauth_provider_consumer` (
`consumer_id` int(11) NOT NULL AUTO_INCREMENT,
`consumer_key` varchar(40) NOT NULL,
`consumer_secret` varchar(40) NOT NULL,
View
10 src/model/OAuthConsumerModel.php
@@ -68,7 +68,7 @@ public static function loadFromConsumerKey($consumerKey, $DataStore)
$OAuthConsumer = new OAuthConsumerModel($DataStore);
$sql = "SELECT *
- FROM `oauth_consumer`
+ FROM `oauth_provider_consumer`
WHERE `consumer_key` = '" . $DataStore->real_escape_string($consumerKey) . "'";
$result = $DataStore->query($sql);
@@ -94,7 +94,7 @@ public static function loadFromConsumerKey($consumerKey, $DataStore)
*/
protected function create()
{
- $sql = "INSERT INTO `oauth_consumer`
+ $sql = "INSERT INTO `oauth_provider_consumer`
SET `consumer_key` = '" . $this->DataStore->real_escape_string($this->consumerKey) . "
`consumer_secret` = '" . $this->DataStore->real_escape_string($this->consumerSecret) . "',
`consumer_create_date` = '" . $this->DataStore->real_escape_string($this->consumerCreateDate) . "'";
@@ -113,7 +113,7 @@ protected function create()
protected function read()
{
$sql = "SELECT *
- FROM `oauth_consumer`
+ FROM `oauth_provider_consumer`
WHERE `consumer_id` = '" . $this->DataStore->real_escape_string($this->consumerId) . "'";
$result = $this->DataStore->query($sql);
@@ -134,7 +134,7 @@ protected function read()
*/
protected function update()
{
- $sql = "UPDATE `oauth_consumer`
+ $sql = "UPDATE `oauth_provider_consumer`
SET `consumer_key` = '" . $this->DataStore->real_escape_string($this->consumerKey) . "
`consumer_secret` = '" . $this->DataStore->real_escape_string($this->consumerSecret) . "',
`consumer_create_date` = '" . $this->DataStore->real_escape_string($this->consumerCreateDate) . "
@@ -151,7 +151,7 @@ protected function update()
*/
protected function delete()
{
- $sql = "DELETE FROM `oauth_consumer`
+ $sql = "DELETE FROM `oauth_provider_consumer`
WHERE `consumer_id` = '" . $this->DataStore->real_escape_string($this->consumerId) . "'";
if (!$this->DataStore->query($sql)) {

0 comments on commit fdae9ed

Please sign in to comment.