[Sugar-devel] [sugar-devel]engineering the moodle-print communication
martin.langhoff at gmail.com
Mon Jun 8 15:15:03 EDT 2009
On Mon, Jun 8, 2009 at 8:55 PM, Vamsi Krishna
Davuluri<vamsi.davuluri at gmail.com> wrote:
> This would be through a HTTP POST
Cookie + HTTP POST to a defined URL would work well.
Apologies for not being able to help more this week.
> [23:56] <aa> daveb: if you aren't registered we will probably have to let
> the user know
If you aren't registered, you should not let the users print. You can
check against the Sugar API whether the user is registered...
> [23:57] <iwikiwi> aa: even if i do, i dont see how moodle can authenticate
> me without my password.
It's not bulletproof security. Moodle trusts your cookie because it
matches the data from registration. The server-devel archive has a
good discussion on why this is so (and of what it'd take to make
things cryptographically secure).
> [23:58] <aa> the schoolserver guys wanted a way to let kids use moodle
> without passwords
grab a group of 30 6-year olds. Teach each of them a written password today.
Talk to them tomorrow.
> [23:59] <aa> and didnt have the time to code a pub key based auth mechanism
> [00:00] <aa> iwikiwi: I'm not sure what moodle does internally with this
> cookie to authenticate the user, but it should be no more than copying and
> pasting that code
You'll need to read the code in auth/olpcxs/auth.php -- note that
_that_ code does a lot of stuff. You don't need to login the user,
only to identify the right account and put the print request in the
I'd encourage handling the queue from moodle's cron. See admin/cron.php
> [00:02] <iwikiwi> aa: im more worried on how to parse the pdf under a
> specific user. like: leona made a pdf and wants to show her teacher under
> her moodle username leona, which the teacher will approve/disapprove. But
> when i do this the webactivity way, I dont see how i can upload under a
> specific user
You mean how to _show_ the pdf in Moodle as belonging to a specific user?
In that case, you will want to add a new tab to the 'user page'. You
can see how I've added a 'backup' tab and an 'alias' tab.
In that page,
1 - the student who's looking at his/her own print queue can see
what's in the queue, it status, maybe old printjobs, and can remove
2 - the teacher can view, ok for the print queue, and cancel
3 - it may make sense to add a small activity module for this that
shows everything that the teacher ok'd to print (so 'printing' is also
publishing in the online environment for the whole group). Given that
all of this interaction is scoped to a group (the course participants
in moodle parlance) it makes sense.
I'm not sure what your UIs look on the Sugar side, but we could
leverage your work into being a "publish into moodle and/or print"
action. "Push to moodle where everyone can see it and (if there's a
printer) the teacher gets and extra button to print".
martin.langhoff at gmail.com
martin at laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
More information about the Sugar-devel