# Beginning Moodle 2.0 Administration 2

Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Beginning Moodle 2.0 Administration 2.

This page is a sequential page to Beginning Moodle 2.0 Administration. Questions and answers here relate to all versions of Moodle 2.x, (so far).

### I am getting a PHP error when trying to install with a Microsoft MSSQL database server

There are a couple of potential issues here, but if you go to Installing MSSQL for PHP and then Using the Microsoft SQL Server Driver for PHP, these should provide you with a great deal more information.

There are a couple of causes for this problem, but the main one seems to be we forget the jumble of passwords we are required to remember. There are also a number of ways of getting around it, as well.

This discussion covers just about all of them. There are a couple of scripts so be careful and use the right one if you need to.

If you do not wish to use a script, then you can try this: Using phpMyAdmin, enter the database and look for the mdl_users table. The first line of that table's data should be the Guest, and the password for Guest is "guest", without the quote marks. Copy that password and then look for your identity. Paste the "guest" password over the top of yours when you locate it. You should then be able to get into your Moodle as an Admin. It has been reported this does not work in every circumstance, but it will for most. To get around any problem that this solution throws up, you might want to go to the config.php file and try commenting out the line

 \$CFG->passwordsaltmain =


This tip should then work.

### How do I create a repository?

To setup and use a repository in Moodle 2.0, is not complex, just detailed. What follows will set up a site wide repository, that is the contents of this repository will be available to the entire site - so make sure this is really what you want. This is for the kind of resources you may want to use across a number of courses.

1. In the moodledata folder there is a folder called Repository. Create whatever folders you want in there, but it is suggested you use a consistent naming convention, so everyone knows what type of materials reside there, e.g. CalculusPDFs, EnglishCivilWarDocs, and so on. You can copy the required materials into each folder as you create them or add to it at any time thereafter.

2. In your Moodle 2.0 there are a couple of things you need to do, but first you have to activate the user repository system by going to Site Administration > Plugins >Repositories > Manage Repositories and you will see in the list contained in the right-hand panel an item named "File System". Select the dropdown list box and change the value to "Enabled and visible"

Setting the File System Repository in Moodle 2.0

3. Click the "Settings" link and that will take you to the "Setup repository on file system" page. Click the "Create a Repository Instance" button and this will take you to the next page. On that page you have two text boxes and two buttons. Add the name of the repository you created in the Repository folder and click "Save".

Saving the new Repository in Moodle 2.0

When you return to the "Setup repository on file system" page, you will now see that a list of repositories is available. When you access any course file or image picker, the repository will be available to you under the name you have given it. Any file inside the repository will be available for uploading to your course.

### How do I set up a course repository?

Setting up the Course repository is almost exactly the same, but the major difference is that is should only be accessible to that one course.

Create a folder in your moodledata/Repository folder, naming it whatever is relevant. Add the files you want in that repository as you create the folder, or you can add them later.

In the Course Administration menu, click the Repository item which takes you to the "Course Repositories" page. You will see a list of all available Repositories so you can access one of them if you chose, or you can select the Create A Repository Instance, Create a "FileSystem" instance link. This takes you to the same page as shown above.

Creating a new Course Repository in Moodle 2.0

Create your repository instance in the same manner as described above and when you return to the Course Repositories page, you will see your repository listed there.

When you are adding a file to your course from the repository, you can access the stored file from the image or file picker via your repository. The repository is not available outside the course you create it for.

### How do I get and install phpMyAdmin?

phpMyAdmin is another very useful plugin. In Moodle 2.0 the plugin has been updated and is now located in a different place than it was in earlier versions. Go to the phpMyAdmin page in Modules and Plugins and download the Moodle 2.0 version. Unzip it to the moodle/local folder and then go to Notifications. Moodle will then tell you it has been successfully installed. If you look in Administration > Server you will now find a line "phpMyAdmin". To access your database, click the link.

### I want to change our logo and some other images but there seems no clear way of doing it.

Moodle 2 has done things very differently here. Logos and other images are all controlled by the theme. Each theme folder is constructed the same way so it makes it easy to edit. Native Moodle themes use the moodle/pix folder to store common images. Look in there to find the logo for any native theme and that can be replaced by a new logo. Third party themes often use the moodle/theme/pix folder to store images, including logos.

Go and look at the theme folder and in it you will find the name of the theme you are using. In it you will also find the sub-folders for different elements and you should find your layout folder contains most of the instructions for controlling the layout, the Styles folder controls the appearance and so on. Images used in the theme can all be located there as well, in the pix folder.

If you want to use a theme that does not have an image or a logo, just the default icons, then you are talking a serious revamp. For that, you need to look at the Themes 2.0 page.

### What about other elements of the Front Page?

In some ways, Moodle 2 has made it easier to setup a front page the way you want it. Different themes will use different defaults, many moving away from the traditional three collumn, blocks, categories/courses, blocks, structure that pervaded Moodle 1.9. The Moodle 2 documentation has a more complete look at the Front page settings than can be viewed here. Also, for a better overview of how this can all be done at a site level, look at the Customising appearance pages.

### Can I still use the TeX Notation filter in Moodle 2 like I did in Moodle 1.9?

Yes, you can. In fact there is very little that has changed in the changing version. Not that the TeX filter has not be changed, it certainly has, but it does not affect how you will use TeX Notation. It is supposed to be easier to add a third party plugin for TeX, but the relationship between Moodle and such tools as MathJax or Geogebra, or similar tools, is still to be determined.

UPDATE: Mauno Korpelainen has successfully integrated a number of Maths tools onto Moodle. These tools include Geogebra, JSXGraph, Math, MathML, MathTran, tex, DragMath, Geonext, JSQuery, MathJax and if that were not enough, Mauno had also included a version of TinyMCE that has, as native, a Maths editing toolbar. Further information can be found on the Moodle 2 Advanced Maths Tools page.

### Our TeX filter is not working, no matter what we try.

There are a number of possibilities here, but the most common one is the filters have not been properly activated. Go to Site administration > Plugins > Filters > Manage filters and make sure that the Algebra Notation and Tex Notation filters have both been turned on. On the right of that Tex Notation row, click on Settings and make sure that the path statements are correct.

Another common issue is that on a Shared Hosting service, the Host will turn off some PHP variables that are required by the filters. You cannot change this, not without changing hosts, which is not always the most acceptable solution. The most obvious test for this is to go and look at your debug logs, they might read something like:

 Notice: Undefined variable: status in /moodle/xxxxxxxx/public_html/filter/tex/texdebug.php on line 152
Warning: system() has been disabled for security reasons in /moodle/xxxxxxxx/public_html/filter/tex/texdebug.php on line 152
Warning: shell_exec() has been disabled for security reasons in /moodle/xxxxxxxx/public_html/filter/tex/texdebug.php on line 163


There are a variety of reasons that hosts do this, but usually they say it is done on security grounds. There is a way around this issue, use an external service as is proposed in this discussion.

### We want to use LDAP to enroll students, but how?

Lightweight Directory Access Protocol (LDAP) is used for Authentication and enrollment. You must set it for LDAP Authentication before you can use it for enrollment.

### I am getting an "HTTP 406 Not Acceptable" error, but what is it?

This is a very rare error actually, and is caused by your browser not accepting some data. Browsers are, by their nature, usually accepting of all data, but sometimes an error can occur.

Any client, your browser, steps through this cycle:

1. Can obtain an IP address from a site, then converts the IP name to an IP address that can be provided by the DNS.
2. It opens a socket connection then writes an HTTP data stream through that socket.
3. It then receives a data stream back from the server in response and will parse this data stream for status codes and other useful information.
 Clearly, it is not this simple, but these are general comments that encapsulate the actual process.


The 406 error occurs here, in the last step when the client receives an HTTP status code from the server that the server does not recognize a command or there is a conflict with the command in the server.

One way to get around this error is to use the .htaccess file. Add the line:

 SecFilterEngine Off


This has been known to resolve the 406 error.

### Is is possible to move users (with password) from moodle 1.9 to a moodle 2.x?

You cannot use the Front Page backup to get User details with passwords, but you can use phpMyAdmin. In the old Moodle, open the database and go to the users table. Open the table and then go to Export and dump the data to an sql file. Repeat the process with your new install.

You have two options here, open the files using a spreadsheet and copy the user data only to the v2 file. This may take a while as you have to make sure the fields are in the same order. There are additional fields in v2 that you need to account for in the data, some fields will be renamed. You have to fix these exactly right or it is not going to work.

Depending on how many users you actually have, you may want to make the two dumps exactly the same in data and then run the sql file back to the v2 using just the insert data statement.

Alternatively, with a lot of users it may be easier for you to delete non-essential columns and rows, save the important parts as a csv file and upload that. The main parts are "username, password, firstname, lastname, email" but you may want to add in additional fields like idnumber or cohort.

Additional fields like idnumber and cohort represent unique identifiers and can be used throughout the moodle. In cohort, which will not be there, you may add in something that will differentiate staff from students say, or year levels, or anything unique to a group. Or you may want to add in a unique idnumber, which you can do easily using incrementing numbers. Or if you already have a student idnumber in place, then you may want to use that. Whatever you do, in using a csv file, you will have to clean up any single or double quotemarks or unneccessay commas in the spreadsheet and then save the file as a csv file.