OCS: Two users are registered and paid but their account does not show

Hi

I have two users out of 340 that appear in the Conference Manager/Registrations page but do not appear and can’t be found from the Conference Manager/Enrolled Users page.
I can search for them via their login or name but they don’t appear.

Looking deeper I can see they are user id 345 and 346 with rego id 494 and 495 from mysql queries.

mysql> select registration_id,sched_conf_id,user_id from registrations where registration_id=494;
+-----------------+---------------+---------+
| registration_id | sched_conf_id | user_id | 
+-----------------+---------------+---------+
|             494 |             1 |     346 | 
+-----------------+---------------+---------+

They both have sched_conf_id set to 1 which is our only conference.

If I directly enter the URL https// blah/blah/index.php/uis/index/login/signInAsUser/346 I get the message under the My Conferences title of
“Your account is not currently associated with any conferences. Please choose a conference:” and our conference is listed.

For all other users if i login as them via the Enrolled Users page they get taken straight to the correct conference page.

I can’t see anything amis with those two users via mysql queries. Selecting info on them from the users table shows perfectly OK.

(Sorry there are a few posts I have not had a chance to get back to.)

Hi

I can fix the problem by going to Roles / Readers and at the bottom selecting “Enroll User” as a Reader and selecting the user by searching for their name. Their name does appear in this search OK. Once this is done the user appears in a search for All Enrolled users.

I have not done this for the other user yet so I can work out, with some help from here, as to why the user does not appear in Enrolled users search.

However I have found whats missing in the database. It’s a users role.

This is the remaining problem user:

mysql> select * from roles where user_id=346;
Empty set (0.00 sec)

This is the user that is now fixed:

mysql> select * from roles where user_id=347;
+---------------+---------------+---------+---------+
| conference_id | sched_conf_id | user_id | role_id |
+---------------+---------------+---------+---------+
|             1 |             1 |     347 |   32768 |
+---------------+---------------+---------+---------+

So they have no roles. Whats the bit code mean? A bit value to represent reader,author,director,manager somehow?

32768   2^15    Readers?    273 users 
4096    2^12    Authors?    213 users   
256     2^8     Reviewers?   58 users 
64      2^6     Directors     4 users 
16      2^4     Conf Managers 4 users 
1`      2^0     Admin         1 user = me 

Why do some accounts end up not displaying when the user does not select a role?

In fact I have a few users that dont have any role specified.

mysql> select user_id from users where user_id not in (select distinct user_id from roles);
+---------+
| user_id |
+---------+
|     246 |
|     226 |
|     151 |
|     346 |
|     195 |
+---------+
5 rows in set (0.00 sec)

Hi @MikeL,

As OCS is capable of hosting multiple conferences, the associations between user accounts, roles and conferences needs to be flexible. This is backed in the roles table, as you’ve noted. The role_id constants correspond to PHP-side ROLE_ID_… constants, defined in classes/security/Role.inc.php.

It’s possible for a user to register but without selecting any roles, in which case their account will exist but will not be associated with any conferences. Likewise, users who were previously active in a conference but removed will still exist in the system, but without roles.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alex

Ah thanks for pinting me to “classes/security/Role.inc.php”. Now I see where its defined.
I like the term “discussant” :slight_smile:

Yes I know it supports multiple conferences. Hence that’s why all our users should have a sched_conf_id=1. The missing users though had sched_conf_id=1 but didn’t have a role_id.
So they were associated with a conference in the database.

What I might have to do is to run a cron job that does a:

select user_id from users where user_id not in (select distinct user_id from roles);

and for those users set their role_id to reader. But I should not need to do that.

Hi @MikeL,

The missing users though had sched_conf_id=1 but didn’t have a role_id.

Can you describe these entries in more detail? The roles table requires a role_id, IIRC.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alex

What I mean by not having a role_id is that in the roles table there is no entry for 5 users as per the msql query in post 3. Those users have a sched_conf_id=1 in the registrations table. We only have one conference.

It looks like this occurs when a user deselects the Reader role during a signup. So they end up having no role but are in the conference.

They have sched_conf_id=1 (which to me means they are associated with the conference) but they don’t have a role entry (and that lack of an entry triggers the error “Not associated with any conference.”) To me this does not seem logical.

I think the best way might be to remove a users ability to deselect the Reader role by modifying the template. (in templates/user/createAccount.tpl or should $allowRegReader not be allowed to be null ?)

My humble opinion is that this reader role is confusing. The person that looks after registrations finds these 5 users as having a paid registration but can’t find them via the “All Enrolled Users” search. This is close to a “bug” :slight_smile:

Mike

Hi @MikeL,

Is it possible that these users un-checked all role options while registering? The reader option should be checked by default, and possible the author option, too, depending on how they came to the account creation form.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alex

Yes, I can replicate the problem if in my test system I uncheck all roles. In my production system 7 out of 300 users have I think done that. The effect is that it created a headache for the Registration Manager. He could not understand why a paid registrant could not be found in the “All Enrolled Users” search.

I need a minimal and “best” way to disable a users ability to unenroll from Reader. Remove the checkbox from template or code to ensure all users have a “minimal” role of Reader?.

Mike

Hi @MikeL,

The least invasive approach would probably be to upload a bit of CSS that hides that control. It’ll be checked by default so that’ll prevent users from unchecking it.

Regards,
Alec Smecher
Public Knowledge Project Team

Ace. Simple and it doesn’ t change the code base as much.
It’s not quite perfect though.
I have added this to public/site/sitestyle.css

    label[for=readerRole] { display:none; }
    input#readerRole { display:none; }
    label[for=createAsReader] { display:none; }
    input#createAsReader { display:none; }

The first two lines are for “user/profile” for an existing account and this works fine.
The last two lines are for “user/account” when a user creates an account.
This hides the checkbox but I get the text “: Notified by email on publication of presentations.” because we have this:

<label for="createAsReader">Reader</label>: Notified by email on publication of presentations.<br>

Have to work out how to CSS select that text to hide it. So I may have to change the template. This string comes from: locale/en_US/locale.xml:

<message key="user.account.readerDescription">Notified by email on publication of presentations.</message>

Mike