Actual problem
I've followed the tutorial at
http://rtfm.modx.com/display/revolution20/Extending+modUser upto step 3 (setting extension_packages). When I want to change the class of some pre-existing user to my own class, I get a dialog saying 'user_err_nfs', and three entries are added to the error log:
[2012-02-28 10:36:14] (ERROR @ /connectors/security/user.php) Could not load class: ClubLid from mysql.clublid.
[2012-02-28 10:36:14] (ERROR @ /connectors/security/user.php) Could not load class: ClubLid from mysql.clublid.
[2012-02-28 10:36:14] (ERROR @ /connectors/security/user.php) ClubLid::load() is not a valid static method.
I've tried regenerating the the xpdo-classes, without any effect...
What I'm trying to do
I'm making a sports club website and I want only the members of the club to have an (active) account on the site (but special accounts not mappable to a member should still be possible). Also, club members should have access to the full member list. Since not all members will have an account, I added a custom table to contain the full member list. This table contains an 'id' field for identifying members (regardless of them having an account or not) and a 'user' field, just like in the tutorial.
Now I want to be able to update the member list from a .csv and update the user-table accordingly:
- deactivate any accounts of users that are no longer in the member list
- update the profile information of the website-users according to the information in the member list
Thus, I decided to extend the modUser-class, such that some basic stuff can be done automatically for each member that creates/activates his website account and to allow for further tweaking.
At this point, the schema looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<model package="ledenlijst" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM">
<object class="LedenlijstLid" table="ledenlijst" extends="xPDOSimpleObject">
<!-- The id is 'YYYYMMDD' . md5(naam . voornaam); this should be adequate to providing unique ids -->
<field key="id" dbtype="varchar" precision="40" phptype="string" null="false" />
<!-- Not all members will have a user attached to it, so we must allow null -->
<field key="user" dbtype="int" phptype="integer" null="true" />
<field key="naam" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="voornaam" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="email" dbtype="varchar" precision="255" phptype="string" null="true" />
<!-- other field definitions come here -->
<aggregate alias="ClubLid" local="user" foreign="id" cardinality="one" owner="foreign" />
</object>
<object class="ClubLid" table="users" extends="modUser">
<composite alias="LedenlijstLid" local="id" foreign="user" cardinality="one" owner="local" />
</object>
</model>
Any help is greatly appreciated