Login using any Auth-Plugin fails in 1.0

Login using any Auth-Plugin fails in 1.0

Issue ID:3299
Issue Category:bug
Component:core
Priority:critical
Status:active
Assigned:Unassigned
Version:1.0
Milestone:1.0
Keywords:patch exists, Solution

I moved from 1.0.0beta2 to beta3. In an existing browser session from beta2 where the user is already logged in, everything works fine.

When attempting to login via a new session, I receive the following:

Fatal error: Class User_username contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Managed_DataObject::schemaDef) in C:\wwwscripts\status\classes\User_username.php on line 63

I reverted User_username.php back to beta 2's class User_username extends Memcached_DataObject. With that one change, everything works again.

Updates

#1

same here, but i don't see an error message, just a blank page after login

#2

Component:core» plugin

Same thing happens on v1.0.0rc1 and PHP 5.3.8

#3

Component:plugin» core

I can confirm that reverting to Beta 2's User_username class solves the problem.

PS. Sorry, changing component back to core, as the bug is not plugin related.

#4

The problem persists on stable version 1.0.1

#5

I have the same problem with after upgrading StatusNet from 0.9.7 to 1.0.1 too. I can do any tests if needed.

#6

Issue still a problem with 1.0.1 and also a Git checkout of the master branch as of today (2011-10-16). I was able to apply the simple workaround suggested by the OP (changing the base class that User_username extends) and that appears to work.

#7

*please* get this fixed. As far as I can see, this bug means that ALL AUTH PLUGINS ARE FAILING! It's not specific to LDAP in any way.

This bug seems easy to fix. How come no one is looking into it?

#8

Title:Cannot login to beta 3 with LDAP authentication and PHP 5.3.1» Login using any Auth-Plugin fails in 1.0

changing issue description as per above.

#9

Keywords:+Solution

I've been hit with the same issue so I dug into it to try and work out the cause.

classes/Managed_DataObject.php
This declares an "abstract" class with the method "schemaDef()" and the comment "The one True Thingy that must be defined and declared.".

classes/User_username.php
This is what's complaining with the already mentioned error message. Appears to be caused by the fact the class doesn't contain a "schemaDef" method. If I put an empty on in, it gets past the error but then just times out doing something else... Don't know what that method should be doing once declared, so I figured the one from the User.php class would make sense. Copied, pasted, worked. Use at your own risk as I haven't really understood what was needed and possible issues caused by using it.

AttachmentSize
User_username.txt 6.53 KB

#10

Hi,
I got this error when I tried to activate the LdapAuthentication plugin in my SN-1.0.1 instance.
So I applied this on classes/User_username.php with the precious help of Macno (https://gitorious.org/~macno ) ;)

It's not well formated here, so I gave you the link on our git repository for the commit diff http://git.auf.org/?p=ublog.git;a=commitdiff;h=2fb42ede371912b5789c65d49... . Apologies If I wasn't using gitorious for that purpose

Then it was working. :)

#11

Thomas Johnson made a merge request for this recently:
https://gitorious.org/statusnet/mainline/merge_requests/202

#12

Keywords:+patch exists

#13

I feel schemaDef method means 'table struct'.
Then, the trouble might solve, to add following code after '###END_AUTOCODE' (26 lines) of 'classes/User_username.php'.

public static function schemaDef()
{
return array(
'description' => 'local username',
'fields' => array(
'provider_name' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'collate' => 'utf8_bin', 'description' => 'provider name'),
'username' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'collate' => 'utf8_bin', 'description' => 'user name'),
'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user id'),

'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
),
'primary key' => array('provider_name', 'username'),
);
}

Best regards,

#14

Hi, the schemaDef() method seems table struct.
So that, the problem might be solve insert following code after line 27 of 'classes/User_username.php';


    public static function schemaDef() {
        return array(
            'description' => 'local username',
            'fields' => array(
                'provider_name' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'collate' => 'utf8_bin', 'description' => 'provider name'),
                'username' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'collate' => 'utf8_bin', 'description' => 'user name'),
                'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to user table'),

                'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
                'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
            ),
            'primary key' => array('provider_name', 'username'),
        );
    }

AttachmentSize
User_username.php_.txt 2.96 KB
Login or Register to modify this issue, or to receive updates by email.

You can also subscribe to the RSS feed for updates to this issue.