Enrolling from Guest to Registered User... wants non-existent key?

Enrolling from Guest to Registered User... wants non-existent key?

by Derry Lyons -
Number of replies: 4

Greetings!

I have a course that is open to guests (no enrollment key) that I would like to use as a content engine for an e-newsletter. Folks can click a link in the e-mail and see the Moodle resources in their web browser.

Link to course: http://moodle.skitsap.wednet.edu/course/view.php?id=48

At the top of the course is a "Join Us" link where I would like the (existing LDAP) users to enroll, after which they'll be able to participate in discussions, vote, etc.

Link to enroll: http://moodle.skitsap.wednet.edu/course/enrol.php?id=48

The bizarre part? If I click the Enroll link outside of Moodle, it works great. If, after viewing Moodle content as a guest (hence clicking on the link at the top of the course), I'm instead prompted for the enrollment key (which doesn't exist).

I've tried messing with the "loginasguest" flag, but it doesn't fit this context.

Anybody have any thoughts? I'm TOTALLY jazzed about this idea, and my first look through the code doesn't jump anything out to me...

Thanks! smile Derry

 

Average of ratings: -
In reply to Derry Lyons

Re: Enrolling from Guest to Registered User... wants non-existent key?

by Derry Lyons -

Well, I made a funky workaround, but a more mainstream solution might be more elegant...

In $CFG->wwwroot/login I created a new script called logoutenrol.php based on the logout.php script. It basically logs the user out and redirects them to the enrol.php script. Text of it is as follows:


If anyone has any additional ideas, I'd love to hear them! smile

In reply to Derry Lyons

Re: Enrolling from Guest to Registered User... wants non-existent key?

by Dr S Bhatia -
you guys are talking pretty computerese which is greek to me

just one thought

in the settings for the course, have you set it to

allow guests without the key or allow guests with the key?
In reply to Dr S Bhatia

Re: Enrolling from Guest to Registered User... wants non-existent key?

by Derry Lyons -
Great question - since I didn't indicate that in the original post. But no, I've allowed guests without the key... Thanks! smile
In reply to Derry Lyons

Re: Enrolling from Guest to Registered User... wants non-existent key?

by Dr S Bhatia -
I tried your website.

I found an anomaly which may or may not help you(because i am technically illiterate) but may be something to look at.

Ordinarily, when we access any moodle frontpage, it says:
"You are not logged in. (Login)"

but when we go to http://moodle.skitsap.wednet.edu/ NOT from any link but directly, your top right corner says:"You are currently using guest access (Login)"

Now this has something to do with user permissions at site setting levels
one feature is autologinasguest....another is forcelogin.... i think  you have set the first one as  yes but second to no....thats why everytime we go to your site we are auto-loggedin as guests......but when we try to login into the course, and the course uses ldap, then when we try guest access, moodle gets confused ......why? i cannot say......
but temporarily
TRY THIS
Do create a key for the guests let's say 'password'
and then, attempt to login using this key and see if this logs you in as a guest or does it override your ldap method......it'd be interesting to know. If it simply logs you in as guest, then write in the summary of your course: 'Please use 'password' as enrolment key;......period.....temporary relief achieved.

And lastly, i tried something

from the page that says you require a key from so and so, i directly clicked the link to sktech news and LO! it opened .

So till this problem is solved, just write in the summary of your course:"If you are asked for a login key, please ignore it and click directly here" and link the words here to sktechnews......this may override the problem temporarily,TILL the bug, if it's a bug, is sorted out.

Regards