Ideas….

a blog for me to record thoughts and ideas

Browsing Posts published in June, 2009

So I have a server with an SSL cert.  It requires a passphrase every time I restart.  This is slightly annoying.  So one of my coworkers recommended the following:

  1. create a simple perl script that prints the password
  2. in the ssl.conf file change SSLPassPhraseDialog builtin to SSLPassPhraseDialog exec:/location/to/passphrase.pl
  3. restart apache

It works beautifully.  I am of course writing this down because I will forget what he told me in like 5 minutes.

Going to ALA 2009

No comments

I’m going to ALA Annual in Chicago.  I’ve finally set my schedule sort of…there are a few sessions I’ll go to depending on my mood that day.  I decided to be a loser and post what it is I’m hoping to attend, you know just in case anyone cares (or wants to stalk me…why though I’m not so sure).

Not on this list is the fact that I would like to crash the Ex Libris Reception.  I’m not sure who from my old gig will be there but its always nice to see my favorite product manager (yes you Nettie).


Fri Jul 10


4pm – 5:30pm    LITA 101: Open House – Palmer House Chicago, IL


Sat Jul 11


8am – 10:30am     RSS All Committee Meeting – Swissotel, Chicago, IL
10:30am – 12pm    The Open Library Environment Project: Building an ILS for Service Oriented Architecture Integration – McCormick Place, Chicago, IL
1:30pm – 5:30pm    Look Before You Leap: Taking RDA For a Test-Drive – McCormick Place, Chicago, IL
– OR –
1:30pm – 3:30pm    The Secret Life of Our Data: Privacy in the Digital Age – McCormick Place, Chicago, IL
3:30pm – 5:30pm    Open Access Digital Initiatives in the Humanities: Creation, Dissemination, Preservation – McCormick Place, Chicago, IL


Sun Jul 12


12pm – 1:30pm    OCLC Developer Network Luncheon – Intercontinental Chicago Hotel, Chicago, IL
1:30pm – 3pm    Top Technology Trends – Intercontinental Chicago Hotel, Chicago, IL
3:30pm – 5:30pm    Improving User Services Through Open Source Solutions: Potentials and Pitfalls – McCormick Place, Chicago, IL
– OR –
3:30pm – 5:30pm    You Got Me, Do You Like Me? Evaluating Next Generation Catalogs – McCormick Place, Chicago, IL


Mon Jul 13


8am – 10am    Resuscitating the Catalog: Next-Generation Strategies for Keeping the Catalog Relevant – McCormick Place, Chicago, IL
10:30am – 12pm    Social Software Showcase 2009 – McCormick Place, Chicago, IL
1:30pm – 3pm    Content Management Systems in Libraries: Opportunities and Lessons Learned – McCormick Place, Chicago, IL

Moodle Enrollment: Flat Files

1 comment

Currently we are using the LMB Plugin for Moodle to enroll students into our courses.  This works swimmingly, until you have to enroll a large group into a class that really isn’t a class.  Let me explain…no let me sum up.

We have a bunch of placement tests and advising courses and that sort of thing we want our first year students to be enrolled in.  Moodle happens to have a flat file enrollment feature.  Below are the instructions from that enrollment feature:

This method will repeatedly check for and process a specially-formatted text file in the location that you specify. The file is a comma separated file assumed to have four or six fields per line:

*  operation, role, idnumber(user), idnumber(course) [, starttime, endtime]
where:
*  operation        = add | del
*  role             = student | teacher | teacheredit
*  idnumber(user)   = idnumber in the user table NB not id
*  idnumber(course) = idnumber in the course table NB not id
*  starttime        = start time (in seconds since epoch) - optional
*  endtime          = end time (in seconds since epoch) - optional

It could look something like this:

   add, student, 5, CF101
   add, teacher, 6, CF101
   add, teacheredit, 7, CF101
   del, student, 8, CF101
   del, student, 17, CF101
   add, student, 21, CF101, 1091115000, 1091215000

So great, I need to pull a randomly generated number rather than a username in order to enroll students.  So now I need to figure out a way to take a list of usernames in banner and get their corresponding idnumbers in Moodle.

Now if this were a one time thing I would take the lazy man’s way out and I would create a table in the database and do a simple

select table.username, user.idnumber
from table, user
where table.username = user.username;

But I’m going to have to do this every year until we either get rid of Moodle or I leave Wheaton.  Since plans are not in the work for either, I’ll actually do something more substantive.

First I made the decision to use the MySQL select in clause.  For those of you who don’t know, you can do:

select username, idnumber
from user
where username in ('value1', 'value2', 'valueN');

Its pretty useful really.  I can’t really find a MySQL page that talks about the in() clause but I did find a good post in the MySQL lists.  The next thing I had to figure out was how to push a file into a php array.  Again I found a great post on using the file() command to do this.  The only drawback is that when i go to print it’ll just show:

value1 value2 valueN

When that’s not what I want.  I need quotes and commas and crap around it.  So I found another great post that talks about using the implode function to put a php array into an in() clause.  The implode function will allow me to put quotes and what not around each one of the values in the array so it will look like this:

'value1', 'value2', 'valueN'

So now that I have the component parts, all I need to do is create a php page that will let me upload a file, run the query, and retrieve the outfile.  Of course the idea of writing this code makes me tired and since its 5pm I shall just publish this post and write the code tomorrow (hopefully).

UPDATE

I was wrong.  The value is not a randomly generated number, well it is, but its randomly generated by Banner.  In the Banner XML the value is the <sourcedid> for a <person>.

Luckily this randomly generated value is something that we can pull out of Banner using our reporting system.  The value (in our Banner) is gobsrid_sourced_id.  Not sure if it will be the same in your Banner, but hopefully this will put someone on the right track.

My next step is to document how to do all of this in our Moodle Documentation Wiki.  I might do a Jing Video.