shaufi10 / oauth2-php

Automatically exported from code.google.com/p/oauth2-php
MIT License
0 stars 0 forks source link

Problem adding clients in example pdo_oauth.php #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Visit addclient.php
2. Fill out the three fields
3. Click Submit

Expected to see the row added to the `clients` table. No row is added.

The fix is to change the variable name in the function declaration on line 40 
of pdo_oauth.php to $pw instead of $secret.

@@ -37,7 +37,7 @@

     // Little helper function to add a new client to the database
     // Do NOT use this in production!  This sample code stores the secret in plaintext!
-    public function add_client($client_id, $secret, $redirect_uri) {
+    public function add_client($client_id, $pw, $redirect_uri) {
         try {
             $sql = "insert into clients (client_id, pw, redirect_uri) values (:client_id, :pw, :redirect_uri)";
             $stmt = $this->db->prepare($sql);

Original issue reported on code.google.com by aaron.parecki on 25 Jul 2010 at 6:53

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Fixed in revision 1c58440e66

Original comment by aaron.parecki on 4 Aug 2010 at 5:16