Welcome Guest, Not a member yet? Register   Sign In
A3M - Account Authentication & Authorization Module
#91

[eluser]vicman[/eluser]
Great work.
#92

[eluser]Peng Kong[/eluser]
thanks vicman. let me know ur experience using it or integrating it please. it would be most helpful Smile
#93

[eluser]loosetops[/eluser]
Bug Report

I have found the cause to the error I was getting while trying to view the link http://domain.com/a3m/oauth/apps
Quote:Fatal error: Uncaught exception ‘OAuthException2’ with message ‘No OAuthStore for mysql (file /homepages/37/d248106511/htdocs/domain/a3m/application/modules/oauth/libraries/oauth-php/library/store/OAuthStoremysql.php)’ in /homepages/37/d248106511/htdocs/domain/a3m/application/modules/oauth/libraries/oauth-php/library/OAuthStore.php:76
Stack trace:
#0 /homepages/37/d248106511/htdocs/domain/a3m/application/modules/oauth/controllers/oauth.php(25): OAuthStore::instance(‘mysql’, Array)
#1 /homepages/37/d248106511/htdocs/domain/a3m/system/codeigniter/CodeIgniter.php(201): OAuth->OAuth()
#2 /homepages/37/d248106511/htdocs/domain/a3m/index.php(115): require_once(’/homepages/37/d…’)
#3 {main}
thrown in /homepages/37/d248106511/htdocs/domain/a3m/application/modules/oauth/libraries/oauth-php/library/OAuthStore.php on line 76

The bug is at this section
file: [modules/oauth/controllers/oauth.php]
Code:
function OAuth()
    {
        parent::Controller();
        
        require_once APPPATH.'/modules/oauth/libraries/oauth-php/library/OAuthServer.php';
        require_once APPPATH.'/modules/oauth/libraries/oauth-php/library/OAuthStore.php';
        $DB = $this->load->database('default', TRUE);
        $this->store = OAuthStore::instance($DB->dbdriver, array('conn' => $DB->conn_id));
        $this->server = new OAuthServer();
    }

The property $DB->dbdriver returns mysql instead of MySQL.

This leads to the creation of a file that doesn't exist in modules/oauth/libraries/oauth-php/library/OAuthStore.php
Code:
public static function instance ( $store = 'MySQL', $options = array() )
    {  
        if (!OAuthStore::$instance)
        {
            // Select the store you want to use
            if (strpos($store, '/') === false)
            {
                $class = 'OAuthStore'.$store;
                $file  = dirname(__FILE__) . '/store/'.$class.'.php';
            }

So
$file is modules/oauth/libraries/oauth-php/library/store/OAuthStoremysql.php instead of
modules/oauth/libraries/oauth-php/library/store/OAuthStoreMySQL.php

For now, I'm overriding the passed variable of 'mysql' with 'MySQL' and this is what the page looks like.

Looking at all driver specific files in modules/oauth/libraries/oauth-php/library/store/ a general fix that takes care of this lowercase issue is maybe needed.

Very good job once again. This is one monster that is going down.
#94

[eluser]Peng Kong[/eluser]
that's exactly what the page should look like Big Grin

crap, ok no error on windows becuz upper/lower cases doesn't affect but on *nix it does.
i was trying not to hardcode "MySQL" incase some of us were using the other databases supported by CI.
i think the best way now is to write a "converter" to link between the full lowercase given by $DB->dbdriver (based on all the possible CI dbs) and the way casing is done in oauth-php.
will patch this into next version.

thanks for helping to smash this bug Wink
#95

[eluser]ShannenName[/eluser]
When you can please check out the bugs I have pointed out on the google codes page.
http://code.google.com/p/a3m/issues/list
#96

[eluser]Peng Kong[/eluser]
ok great you're first to use it Big Grin
#97

[eluser]Isern Palaus[/eluser]
Love this, I will implement to a new fashion portal I've to design/code.

I repeat: LOVE IT Smile!
#98

[eluser]Peng Kong[/eluser]
cool! share with us the url when you're done k Smile thanks
#99

[eluser]ShannenName[/eluser]
What I'm planning to do is create a portal where users join then link all their accounts so they can post/view/do whatever the api let's them from one website.

[eluser]Peng Kong[/eluser]
1) i stand corrected, google and yahoo! works without SSL.
therefore i've disabled SSL by default in the config

2) removed all php short tags so rewrite isn't need.

3) fix oauth-php db lower case issue. now mysql and mysqli will work.

4) fix query strings issue with '/' is needed before GET ? if request_uri is used.
all ? for GET in URL will be preceeded with '/'

these fixes will be in v0.7 (currently it's v0.6) along with ACL (which im starting next week).




Theme © iAndrew 2016 - Forum software by © MyBB