Merge branch 'MDL-26572_backup_sum' of git://github.com/andyjdavis/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 6 Mar 2011 23:10:16 +0000 (00:10 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 6 Mar 2011 23:10:16 +0000 (00:10 +0100)
688 files changed:
admin/generator.php [changed mode: 0755->0644]
admin/langimport.php [changed mode: 0755->0644]
admin/process_email.php [changed mode: 0755->0644]
admin/report/spamcleaner/index.php [changed mode: 0755->0644]
admin/report/unittest/coveragefile.php [changed mode: 0755->0644]
admin/roles/allow.php [changed mode: 0755->0644]
admin/roles/assign.php [changed mode: 0755->0644]
admin/roles/check.php [changed mode: 0755->0644]
admin/roles/define.php [changed mode: 0755->0644]
admin/roles/lib.php
admin/roles/manage.php [changed mode: 0755->0644]
admin/roles/managetabs.php [changed mode: 0755->0644]
admin/roles/override.php [changed mode: 0755->0644]
admin/uploaduser.php [changed mode: 0755->0644]
admin/uploaduser_form.php
admin/uploaduserlib.php [new file with mode: 0644]
admin/user/user_bulk.php [changed mode: 0755->0644]
admin/user/user_bulk_confirm.php [changed mode: 0755->0644]
admin/user/user_bulk_delete.php [changed mode: 0755->0644]
admin/user/user_bulk_display.php [changed mode: 0755->0644]
admin/user/user_bulk_download.php [changed mode: 0755->0644]
admin/user/user_bulk_message.php [changed mode: 0755->0644]
auth/ldap/cli/sync_users.php [changed mode: 0755->0644]
auth/manual/db/upgrade.php [new file with mode: 0644]
auth/manual/version.php [new file with mode: 0644]
auth/shibboleth/config.html [changed mode: 0755->0644]
backup/backupfilesedit.php [changed mode: 0755->0644]
backup/cc/cc2moodle.php [changed mode: 0755->0644]
backup/cc/entities.class.php [changed mode: 0755->0644]
backup/cc/entity.forum.class.php [changed mode: 0755->0644]
backup/cc/entity.label.class.php [changed mode: 0755->0644]
backup/cc/entity.quiz.class.php [changed mode: 0755->0644]
backup/cc/entity.resource.class.php [changed mode: 0755->0644]
backup/cc/includes/constants.php [changed mode: 0755->0644]
backup/cc/restore_cc.php [changed mode: 0755->0644]
backup/cc/schemas/cclibxml2validator.xsd [changed mode: 0755->0644]
backup/cc/schemas/config.xml [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_0/imsccauth_v1p0.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_0/imsccauth_v1p0_constraintsDocument.scmt [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_0/imsccauth_v1p0_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/anyElement.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/anyElement_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/common/anyElement.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/common/dataTypes.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/common/elementNames.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/common/elementTypes.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/common/rootElement.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/common/vocabTypes.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/common/vocabValues.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/dataTypes_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/elementNames_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/elementTypes_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/extend/custom.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/imscc_m_definition.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/lomLoose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/lomLoose_constraintsDocument.scmt [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/lomLoose_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/loose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/rootElement_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/unique/loose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/vocab/loose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/vocabTypes_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_1/vocabValues_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/anyElement.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/anyElement_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/common/anyElement.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/common/dataTypes.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/common/elementNames.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/common/elementTypes.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/common/rootElement.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/common/vocabTypes.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/common/vocabValues.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/dataTypes_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/elementNames_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/elementTypes_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/extend/custom.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/imscc_mR_definition.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/lomLoose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/lomLoose_constraintsDocument.scmt [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/lomLoose_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/loose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/rootElement_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/unique/loose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/vocab/loose.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/vocabTypes_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_2/vocabValues_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_3/imscp_extensionv1p2.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_constraintsDocument.scmt [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_4/imscc_q_definition.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_4/xml.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_5/imswl_v1p0.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_5/imswl_v1p0_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_6/imsdt_v1p0.xsd [changed mode: 0755->0644]
backup/cc/schemas/domainProfile_6/imsdt_v1p0_localised.xsd [changed mode: 0755->0644]
backup/cc/schemas/imscc_c1p2maeV0p15_definition.xsd [changed mode: 0755->0644]
backup/cc/schemas/imscp_v1p2.xsd [changed mode: 0755->0644]
backup/cc/schemas/imscp_v1p2_constraintsDocument.scmt [changed mode: 0755->0644]
backup/cc/schemas/imscp_v1p2_localised.xsd [changed mode: 0755->0644]
backup/cc/sheets/base.xml [changed mode: 0755->0644]
backup/cc/sheets/course_blocks_block.xml [changed mode: 0755->0644]
backup/cc/sheets/course_header.xml [changed mode: 0755->0644]
backup/cc/sheets/course_modules_mod_forum.xml [changed mode: 0755->0644]
backup/cc/sheets/course_modules_mod_label.xml [changed mode: 0755->0644]
backup/cc/sheets/course_modules_mod_quiz.xml [changed mode: 0755->0644]
backup/cc/sheets/course_modules_mod_quiz_feedback.xml [changed mode: 0755->0644]
backup/cc/sheets/course_modules_mod_quiz_question_instance.xml [changed mode: 0755->0644]
backup/cc/sheets/course_modules_mod_resource.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories_question_category.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories_question_category_question.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories_question_category_question_answer.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories_question_category_question_eesay.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories_question_category_question_multiple_choice.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories_question_category_question_shortanswer.xml [changed mode: 0755->0644]
backup/cc/sheets/course_question_categories_question_category_question_true_false.xml [changed mode: 0755->0644]
backup/cc/sheets/course_sections_section.xml [changed mode: 0755->0644]
backup/cc/sheets/course_sections_section_mods_mod.xml [changed mode: 0755->0644]
backup/cc/sheets/info_details_mod.xml [changed mode: 0755->0644]
backup/cc/sheets/info_details_mod_instance.xml [changed mode: 0755->0644]
backup/moodle2/backup_plan_builder.class.php
backup/moodle2/backup_stepslib.php
backup/moodle2/backup_theme_plugin.class.php [new file with mode: 0644]
backup/moodle2/restore_plan_builder.class.php
backup/moodle2/restore_stepslib.php
backup/moodle2/restore_theme_plugin.class.php [new file with mode: 0644]
backup/restorefile.php [changed mode: 0755->0644]
backup/restorefile_form.php [changed mode: 0755->0644]
backup/util/dbops/backup_plan_dbops.class.php
backup/util/ui/renderer.php
backup/util/xml/parser/simpletest/fixtures/test4.xml [changed mode: 0755->0644]
blocks/blog_menu/block_blog_menu.php [changed mode: 0755->0644]
blocks/html/block_html.php [changed mode: 0755->0644]
blocks/mentees/block_mentees.php [changed mode: 0755->0644]
blocks/mentees/lang/en/block_mentees.php [changed mode: 0755->0644]
blocks/private_files/block_private_files.php [changed mode: 0755->0644]
blocks/rss_client/lang/en/block_rss_client.php [changed mode: 0755->0644]
blocks/section_links/config_instance.html [changed mode: 0755->0644]
blocks/section_links/settings.php [changed mode: 0755->0644]
blog/edit.php [changed mode: 0755->0644]
blog/index.php [changed mode: 0755->0644]
blog/preferences.php [changed mode: 0755->0644]
blog/rsslib.php [changed mode: 0755->0644]
course/edit_form.php
course/format/scorm/config.php [changed mode: 0755->0644]
course/format/social/config.php [changed mode: 0755->0644]
course/format/topics/config.php [changed mode: 0755->0644]
course/format/weeks/config.php [changed mode: 0755->0644]
course/lib.php
course/pending.php
course/request_form.php
course/reset.php [changed mode: 0755->0644]
course/simpletest/testcourselib.php [changed mode: 0755->0644]
enrol/authorize/enrol_form.php [changed mode: 0755->0644]
enrol/authorize/version.php [changed mode: 0755->0644]
files/externallib.php [changed mode: 0755->0644]
files/filebrowser_ajax.php [changed mode: 0755->0644]
filter/algebra/AlgParser.pm [changed mode: 0755->0644]
filter/algebra/algebra2tex.pl [changed mode: 0755->0644]
filter/mediaplugin/mp3player.swf [changed mode: 0755->0644]
filter/tex/mimetex.exe [changed mode: 0755->0644]
grade/edit/outcome/course_form.html [changed mode: 0755->0644]
grade/edit/outcome/edit_form.php
grade/edit/outcome/index.php
grade/edit/tree/functions.js [changed mode: 0755->0644]
grade/edit/tree/grade_form.php [changed mode: 0755->0644]
grade/edit/tree/lib.php [changed mode: 0755->0644]
grade/export/grade_export_form.php [changed mode: 0755->0644]
grade/export/lib.php [changed mode: 0755->0644]
grade/export/ods/export.php [changed mode: 0755->0644]
grade/export/ods/grade_export_ods.php [changed mode: 0755->0644]
grade/export/ods/index.php [changed mode: 0755->0644]
grade/export/txt/export.php [changed mode: 0755->0644]
grade/export/txt/grade_export_txt.php [changed mode: 0755->0644]
grade/export/txt/index.php [changed mode: 0755->0644]
grade/export/txt/version.php [changed mode: 0755->0644]
grade/export/xls/export.php [changed mode: 0755->0644]
grade/export/xls/grade_export_xls.php [changed mode: 0755->0644]
grade/export/xls/index.php [changed mode: 0755->0644]
grade/export/xml/export.php [changed mode: 0755->0644]
grade/export/xml/grade_export_xml.php [changed mode: 0755->0644]
grade/export/xml/index.php [changed mode: 0755->0644]
grade/import/xml/index.php [changed mode: 0755->0644]
grade/report/outcomes/index.php
install/welcome.html [changed mode: 0755->0644]
lang/en/admin.php
lang/en/blog.php [changed mode: 0755->0644]
lang/en/error.php [changed mode: 0755->0644]
lang/en/grades.php
lang/en/install.php [changed mode: 0755->0644]
lang/en/moodle.php
lang/en/notes.php [changed mode: 0755->0644]
lang/en/role.php
lib/accesslib.php [changed mode: 0755->0644]
lib/ajax/section_classes.js [changed mode: 0755->0644]
lib/alfresco/Service/Association.php [changed mode: 0755->0644]
lib/alfresco/Service/BaseObject.php [changed mode: 0755->0644]
lib/alfresco/Service/ChildAssociation.php [changed mode: 0755->0644]
lib/alfresco/Service/ContentData.php [changed mode: 0755->0644]
lib/alfresco/Service/Functions.php [changed mode: 0755->0644]
lib/alfresco/Service/Logger/Logger.php [changed mode: 0755->0644]
lib/alfresco/Service/Logger/LoggerConfig.php [changed mode: 0755->0644]
lib/alfresco/Service/NamespaceMap.php [changed mode: 0755->0644]
lib/alfresco/Service/Node.php [changed mode: 0755->0644]
lib/alfresco/Service/Repository.php [changed mode: 0755->0644]
lib/alfresco/Service/Session.php [changed mode: 0755->0644]
lib/alfresco/Service/SpacesStore.php [changed mode: 0755->0644]
lib/alfresco/Service/Store.php [changed mode: 0755->0644]
lib/alfresco/Service/Version.php [changed mode: 0755->0644]
lib/alfresco/Service/VersionHistory.php [changed mode: 0755->0644]
lib/alfresco/Service/WebService/AlfrescoWebService.php [changed mode: 0755->0644]
lib/alfresco/Service/WebService/WebServiceFactory.php [changed mode: 0755->0644]
lib/boxlib.php [changed mode: 0755->0644]
lib/db/upgrade.php
lib/ddl/simpletest/testddl.php [changed mode: 0755->0644]
lib/dml/simpletest/testdml.php [changed mode: 0755->0644]
lib/editor/tinymce/tiny_mce/3.3.9.2/plugins/moodlemedia/css/media.css [changed mode: 0755->0644]
lib/editor/tinymce/tiny_mce/3.3.9.2/plugins/moodlemedia/editor_plugin.js [changed mode: 0755->0644]
lib/editor/tinymce/tiny_mce/3.3.9.2/plugins/moodlemedia/editor_plugin_src.js [changed mode: 0755->0644]
lib/editor/tinymce/tiny_mce/3.3.9.2/plugins/moodlemedia/js/media.js [changed mode: 0755->0644]
lib/editor/tinymce/tiny_mce/3.3.9.2/plugins/moodlemedia/moodlemedia.htm [changed mode: 0755->0644]
lib/eventslib.php [changed mode: 0755->0644]
lib/flickrlib.php [changed mode: 0755->0644]
lib/form/selectwithlink.php [changed mode: 0755->0644]
lib/form/url.php [changed mode: 0755->0644]
lib/grade/simpletest/testgradecategory.php [changed mode: 0755->0644]
lib/grade/simpletest/testgradegrades.php [changed mode: 0755->0644]
lib/grade/simpletest/testgradeitem.php [changed mode: 0755->0644]
lib/grade/simpletest/testgradescale.php [changed mode: 0755->0644]
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt [changed mode: 0755->0644]
lib/htmlpurifier/HTMLPurifier/PropertyList.php [changed mode: 0755->0644]
lib/htmlpurifier/HTMLPurifier/PropertyListIterator.php [changed mode: 0755->0644]
lib/jabber/XMPP/Exception.php [changed mode: 0755->0644]
lib/markdown.php [changed mode: 0755->0644]
lib/moodlelib.php
lib/odbc.php [changed mode: 0755->0644]
lib/pear/HTTP/WebDAV/Server.php [changed mode: 0755->0644]
lib/pear/OLE.php [changed mode: 0755->0644]
lib/pear/OLE/PPS.php [changed mode: 0755->0644]
lib/pear/OLE/PPS/File.php [changed mode: 0755->0644]
lib/pear/OLE/PPS/Root.php [changed mode: 0755->0644]
lib/pear/PHP/runsniffer [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-cz.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-de.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-es.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-fr.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-it.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-nl.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-no.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-se.php [changed mode: 0755->0644]
lib/phpmailer/language/phpmailer.lang-tr.php [changed mode: 0755->0644]
lib/profilerlib.php [changed mode: 0755->0644]
lib/simpletest/testeventslib.php [changed mode: 0755->0644]
lib/simpletest/testmathslib.php [changed mode: 0755->0644]
lib/simpletest/testportfoliolib.php [changed mode: 0755->0644]
lib/tcpdf/README.TXT [changed mode: 0755->0644]
lib/tcpdf/config/tcpdf_config.php [changed mode: 0755->0644]
lib/tcpdf/fonts/README.TXT [changed mode: 0755->0644]
lib/tcpdf/fonts/freemono.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freemonob.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freemonobi.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freemonoi.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freesans.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freesansb.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freesansbi.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freesansi.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freeserif.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freeserifb.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freeserifbi.php [changed mode: 0755->0644]
lib/tcpdf/fonts/freeserifi.php [changed mode: 0755->0644]
lib/tcpdf/tcpdf.php [changed mode: 0755->0644]
lib/validateurlsyntax.php [changed mode: 0755->0644]
lib/zend/Zend/Amf/Adobe/Auth.php [changed mode: 0755->0644]
lib/zend/Zend/Amf/Adobe/DbInspector.php [changed mode: 0755->0644]
lib/zend/Zend/Amf/Adobe/Introspector.php [changed mode: 0755->0644]
lib/zend/Zend/Amf/Auth/Abstract.php [changed mode: 0755->0644]
lib/zend/Zend/Amf/Parse/Resource/MysqlResult.php [changed mode: 0755->0644]
lib/zend/Zend/Amf/Parse/Resource/Stream.php [changed mode: 0755->0644]
lib/zend/Zend/Amf/Value/Messaging/ArrayCollection.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Books.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Books/VolumeQuery.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Docs.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Docs/DocumentListEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Docs/DocumentListFeed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Docs/Query.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/DublinCore.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Entry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Distance.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Exposure.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/FStop.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Flash.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/FocalLength.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/ImageUniqueId.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Iso.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Make.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Model.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Tags.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Extension/Time.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Exif/Feed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Geo.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Geo/Entry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Geo/Extension/GeoRssWhere.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Geo/Extension/GmlPoint.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Geo/Extension/GmlPos.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Geo/Feed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Health.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Health/Extension/Ccr.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Health/ProfileEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Health/ProfileFeed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Health/ProfileListEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Health/ProfileListFeed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Health/Query.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Entry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaCategory.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaContent.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaCopyright.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaCredit.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaDescription.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaGroup.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaHash.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaKeywords.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaPlayer.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaRating.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaRestriction.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaText.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaThumbnail.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Extension/MediaTitle.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Media/Feed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/AlbumEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/AlbumFeed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/AlbumQuery.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/CommentEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Access.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/AlbumId.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/BytesUsed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Checksum.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Client.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/CommentCount.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/CommentingEnabled.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Height.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Id.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Location.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/MaxPhotosPerAlbum.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Name.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Nickname.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/NumPhotos.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/NumPhotosRemaining.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/PhotoId.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Position.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/QuotaCurrent.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/QuotaLimit.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Rotation.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Size.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Thumbnail.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Timestamp.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/User.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Version.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Weight.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/Extension/Width.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/PhotoEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/PhotoFeed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/PhotoQuery.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/TagEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/UserEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/UserFeed.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/Photos/UserQuery.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/Control.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/CountHint.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/Link.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/MediaContent.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/MediaGroup.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/MediaRating.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/Private.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/Extension/Token.php [changed mode: 0755->0644]
lib/zend/Zend/Gdata/YouTube/MediaEntry.php [changed mode: 0755->0644]
lib/zend/Zend/Http/Client/Adapter/Stream.php [changed mode: 0755->0644]
lib/zend/Zend/Http/Response/Stream.php [changed mode: 0755->0644]
lib/zend/Zend/Service/Amazon/Exception.php [changed mode: 0755->0644]
lib/zend/Zend/Service/Amazon/S3.php [changed mode: 0755->0644]
lib/zend/Zend/Service/Amazon/S3/Exception.php [changed mode: 0755->0644]
lib/zend/Zend/Service/Amazon/S3/Stream.php [changed mode: 0755->0644]
lib/zend/Zend/Service/Twitter.php [changed mode: 0755->0644]
lib/zend/Zend/Service/Twitter/Exception.php [changed mode: 0755->0644]
login/change_password.php
message/lib.php
message/output/email/version.php [changed mode: 0755->0644]
message/output/jabber/version.php [changed mode: 0755->0644]
message/output/popup/version.php [changed mode: 0755->0644]
mod/assignment/lib.php
mod/assignment/pix/icon.gif [changed mode: 0755->0644]
mod/chat/beep.wav [changed mode: 0755->0644]
mod/chat/chatd.php [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/bubble/bubbles.png [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/bubble/chat.css [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/bubble/config.php [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/bubble/horizontal.png [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/bubble/input.png [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/bubble/vertical.png [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/compact/chat.css [changed mode: 0755->0644]
mod/chat/gui_ajax/theme/compact/config.php [changed mode: 0755->0644]
mod/chat/pix/icon.gif [changed mode: 0755->0644]
mod/data/css.php [changed mode: 0755->0644]
mod/data/edit.php [changed mode: 0755->0644]
mod/data/field.php [changed mode: 0755->0644]
mod/data/field/checkbox/field.class.php [changed mode: 0755->0644]
mod/data/field/checkbox/mod.html [changed mode: 0755->0644]
mod/data/field/date/field.class.php [changed mode: 0755->0644]
mod/data/field/date/mod.html [changed mode: 0755->0644]
mod/data/field/file/field.class.php [changed mode: 0755->0644]
mod/data/field/file/mod.html [changed mode: 0755->0644]
mod/data/field/latlong/field.class.php [changed mode: 0755->0644]
mod/data/field/latlong/mod.html [changed mode: 0755->0644]
mod/data/field/menu/field.class.php [changed mode: 0755->0644]
mod/data/field/menu/mod.html [changed mode: 0755->0644]
mod/data/field/multimenu/field.class.php [changed mode: 0755->0644]
mod/data/field/multimenu/mod.html [changed mode: 0755->0644]
mod/data/field/number/field.class.php [changed mode: 0755->0644]
mod/data/field/number/mod.html [changed mode: 0755->0644]
mod/data/field/picture/field.class.php [changed mode: 0755->0644]
mod/data/field/picture/mod.html [changed mode: 0755->0644]
mod/data/field/radiobutton/field.class.php [changed mode: 0755->0644]
mod/data/field/radiobutton/mod.html [changed mode: 0755->0644]
mod/data/field/text/field.class.php [changed mode: 0755->0644]
mod/data/field/text/mod.html [changed mode: 0755->0644]
mod/data/field/textarea/field.class.php [changed mode: 0755->0644]
mod/data/field/textarea/mod.html [changed mode: 0755->0644]
mod/data/field/url/field.class.php [changed mode: 0755->0644]
mod/data/field/url/mod.html [changed mode: 0755->0644]
mod/data/import.php [changed mode: 0755->0644]
mod/data/index.php [changed mode: 0755->0644]
mod/data/lang/en/data.php [changed mode: 0755->0644]
mod/data/lib.php [changed mode: 0755->0644]
mod/data/pix/field/checkbox.gif [changed mode: 0755->0644]
mod/data/pix/field/date.gif [changed mode: 0755->0644]
mod/data/pix/field/file.gif [changed mode: 0755->0644]
mod/data/pix/field/latlong.gif [changed mode: 0755->0644]
mod/data/pix/field/menu.gif [changed mode: 0755->0644]
mod/data/pix/field/multimenu.gif [changed mode: 0755->0644]
mod/data/pix/field/number.gif [changed mode: 0755->0644]
mod/data/pix/field/picture.gif [changed mode: 0755->0644]
mod/data/pix/field/radiobutton.gif [changed mode: 0755->0644]
mod/data/pix/field/text.gif [changed mode: 0755->0644]
mod/data/pix/field/textarea.gif [changed mode: 0755->0644]
mod/data/pix/field/url.gif [changed mode: 0755->0644]
mod/data/pix/icon.gif [changed mode: 0755->0644]
mod/data/preset_form.php
mod/data/tabs.php [changed mode: 0755->0644]
mod/data/templates.php [changed mode: 0755->0644]
mod/data/view.php [changed mode: 0755->0644]
mod/feedback/analysis_to_excel.php
mod/forum/pix/icon.gif [changed mode: 0755->0644]
mod/glossary/db/install.xml [changed mode: 0755->0644]
mod/glossary/formats/TEMPLATE/TEMPLATE_format.php [changed mode: 0755->0644]
mod/label/pix/icon.gif [changed mode: 0755->0644]
mod/lesson/pix/icon.gif [changed mode: 0755->0644]
mod/quiz/db/install.xml [changed mode: 0755->0644]
mod/quiz/locallib.php
mod/quiz/pix/icon.gif [changed mode: 0755->0644]
mod/resource/db/upgrade.php
mod/resource/lib.php
mod/resource/version.php
mod/scorm/aicc.php [changed mode: 0755->0644]
mod/scorm/datamodel.php [changed mode: 0755->0644]
mod/scorm/datamodels/sequencinglib.php [changed mode: 0755->0644]
mod/scorm/index.php [changed mode: 0755->0644]
mod/scorm/lib.php [changed mode: 0755->0644]
mod/scorm/loadSCO.php [changed mode: 0755->0644]
mod/scorm/locallib.php [changed mode: 0755->0644]
mod/scorm/pix/browsed.gif [changed mode: 0755->0644]
mod/scorm/pix/completed.gif [changed mode: 0755->0644]
mod/scorm/pix/failed.gif [changed mode: 0755->0644]
mod/scorm/pix/icon.gif [changed mode: 0755->0644]
mod/scorm/pix/incomplete.gif [changed mode: 0755->0644]
mod/scorm/pix/minus.gif [changed mode: 0755->0644]
mod/scorm/pix/notattempted.gif [changed mode: 0755->0644]
mod/scorm/pix/passed.gif [changed mode: 0755->0644]
mod/scorm/pix/plus.gif [changed mode: 0755->0644]
mod/scorm/pix/popdown.gif [changed mode: 0755->0644]
mod/scorm/pix/popup.gif [changed mode: 0755->0644]
mod/scorm/pix/spacer.gif [changed mode: 0755->0644]
mod/scorm/player.php [changed mode: 0755->0644]
mod/scorm/report.php [changed mode: 0755->0644]
mod/scorm/view.php [changed mode: 0755->0644]
mod/survey/pix/icon.gif [changed mode: 0755->0644]
mod/workshop/pix/userplan/task-info.gif [changed mode: 0755->0644]
pix/a/l_breadcrumb.gif [changed mode: 0755->0644]
pix/adv.gif [changed mode: 0755->0644]
pix/b.gif [changed mode: 0755->0644]
pix/f/audio.gif [changed mode: 0755->0644]
pix/f/folder.gif [changed mode: 0755->0644]
pix/f/odt.gif [changed mode: 0755->0644]
pix/f/parent.gif [changed mode: 0755->0644]
pix/f/powerpoint.gif [changed mode: 0755->0644]
pix/f/video.gif [changed mode: 0755->0644]
pix/f/web.gif [changed mode: 0755->0644]
pix/f/xml.gif [changed mode: 0755->0644]
pix/f/zip.gif [changed mode: 0755->0644]
pix/g/f1.png [changed mode: 0755->0644]
pix/g/f2.png [changed mode: 0755->0644]
pix/help.gif [changed mode: 0755->0644]
pix/i/admin.gif [changed mode: 0755->0644]
pix/i/agg_sum.gif [changed mode: 0755->0644]
pix/i/all.gif [changed mode: 0755->0644]
pix/i/backup.gif [changed mode: 0755->0644]
pix/i/course.gif [changed mode: 0755->0644]
pix/i/db.gif [changed mode: 0755->0644]
pix/i/edit.gif [changed mode: 0755->0644]
pix/i/email.gif [changed mode: 0755->0644]
pix/i/feedback.gif [changed mode: 0755->0644]
pix/i/files.gif [changed mode: 0755->0644]
pix/i/grades.gif [changed mode: 0755->0644]
pix/i/group.gif [changed mode: 0755->0644]
pix/i/guest.gif [changed mode: 0755->0644]
pix/i/hide.gif [changed mode: 0755->0644]
pix/i/info.gif [changed mode: 0755->0644]
pix/i/key.gif [changed mode: 0755->0644]
pix/i/lock.gif [changed mode: 0755->0644]
pix/i/marked.gif [changed mode: 0755->0644]
pix/i/marker.gif [changed mode: 0755->0644]
pix/i/new.gif [changed mode: 0755->0644]
pix/i/news.gif [changed mode: 0755->0644]
pix/i/one.gif [changed mode: 0755->0644]
pix/i/reload.gif [changed mode: 0755->0644]
pix/i/report.gif [changed mode: 0755->0644]
pix/i/restore.gif [changed mode: 0755->0644]
pix/i/return.gif [changed mode: 0755->0644]
pix/i/roles.gif [changed mode: 0755->0644]
pix/i/scales.gif [changed mode: 0755->0644]
pix/i/search.gif [changed mode: 0755->0644]
pix/i/settings.gif [changed mode: 0755->0644]
pix/i/show.gif [changed mode: 0755->0644]
pix/i/stats.gif [changed mode: 0755->0644]
pix/i/switch.gif [changed mode: 0755->0644]
pix/i/unlock.gif [changed mode: 0755->0644]
pix/i/user.gif [changed mode: 0755->0644]
pix/i/users.gif [changed mode: 0755->0644]
pix/m/USD.gif [changed mode: 0755->0644]
pix/madewithmoodle.gif [changed mode: 0755->0644]
pix/moodlelogo-med-white.gif [changed mode: 0755->0644]
pix/moodlelogo-med.gif [changed mode: 0755->0644]
pix/moodlelogo.gif [changed mode: 0755->0644]
pix/movehere.gif [changed mode: 0755->0644]
pix/s/angry.gif [changed mode: 0755->0644]
pix/s/approve.gif [changed mode: 0755->0644]
pix/s/biggrin.gif [changed mode: 0755->0644]
pix/s/blackeye.gif [changed mode: 0755->0644]
pix/s/blush.gif [changed mode: 0755->0644]
pix/s/clown.gif [changed mode: 0755->0644]
pix/s/cool.gif [changed mode: 0755->0644]
pix/s/dead.gif [changed mode: 0755->0644]
pix/s/egg.gif [changed mode: 0755->0644]
pix/s/evil.gif [changed mode: 0755->0644]
pix/s/heart.gif [changed mode: 0755->0644]
pix/s/kiss.gif [changed mode: 0755->0644]
pix/s/martin.gif [changed mode: 0755->0644]
pix/s/mixed.gif [changed mode: 0755->0644]
pix/s/no.gif [changed mode: 0755->0644]
pix/s/sad.gif [changed mode: 0755->0644]
pix/s/shy.gif [changed mode: 0755->0644]
pix/s/sleepy.gif [changed mode: 0755->0644]
pix/s/smiley.gif [changed mode: 0755->0644]
pix/s/surprise.gif [changed mode: 0755->0644]
pix/s/thoughtful.gif [changed mode: 0755->0644]
pix/s/tongueout.gif [changed mode: 0755->0644]
pix/s/wideeyes.gif [changed mode: 0755->0644]
pix/s/wink.gif [changed mode: 0755->0644]
pix/s/yes.gif [changed mode: 0755->0644]
pix/spacer.gif [changed mode: 0755->0644]
pix/t/backup.gif [changed mode: 0755->0644]
pix/t/email.gif [changed mode: 0755->0644]
pix/t/emailno.gif [changed mode: 0755->0644]
pix/t/go.gif [changed mode: 0755->0644]
pix/t/groupn.gif [changed mode: 0755->0644]
pix/t/groups.gif [changed mode: 0755->0644]
pix/t/groupv.gif [changed mode: 0755->0644]
pix/t/left.gif [changed mode: 0755->0644]
pix/t/lock.gif [changed mode: 0755->0644]
pix/t/log.gif [changed mode: 0755->0644]
pix/t/message.gif [changed mode: 0755->0644]
pix/t/move.gif [changed mode: 0755->0644]
pix/t/preview.gif [changed mode: 0755->0644]
pix/t/restore.gif [changed mode: 0755->0644]
pix/t/right.gif [changed mode: 0755->0644]
pix/t/stop.gif [changed mode: 0755->0644]
pix/t/unlock.gif [changed mode: 0755->0644]
pix/t/user.gif [changed mode: 0755->0644]
pix/t/usernot.gif [changed mode: 0755->0644]
pix/u/f1.png [changed mode: 0755->0644]
pix/u/f2.png [changed mode: 0755->0644]
pix/webding.png [changed mode: 0755->0644]
portfolio/download/simpletest/testportfolioplugindownload.php [changed mode: 0755->0644]
portfolio/flickr/lib.php [changed mode: 0755->0644]
portfolio/flickr/version.php [changed mode: 0755->0644]
question/format/examview/format.php [changed mode: 0755->0644]
question/format/gift/format.php [changed mode: 0755->0644]
question/format/learnwise/format.php [changed mode: 0755->0644]
question/format/qti_two/templates/choice.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/choiceMultiple.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/composite.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/extendedText.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/extendedText_simpleEssay.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/imsmanifest.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/mmchoiceMultiple.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/notimplemented.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/numerical.tpl [changed mode: 0755->0644]
question/format/qti_two/templates/textEntry.tpl [changed mode: 0755->0644]
question/format/xhtml/format.php [changed mode: 0755->0644]
question/format/xml/format.php [changed mode: 0755->0644]
question/type/calculated/pix/icon.gif [changed mode: 0755->0644]
question/type/match/backup/moodle2/restore_qtype_match_plugin.class.php
repository/alfresco/lib.php [changed mode: 0755->0644]
repository/boxnet/lib.php [changed mode: 0755->0644]
repository/boxnet/version.php [changed mode: 0755->0644]
repository/coursefiles/db/access.php [changed mode: 0755->0644]
repository/coursefiles/lang/en/repository_coursefiles.php [changed mode: 0755->0644]
repository/coursefiles/lib.php [changed mode: 0755->0644]
repository/coursefiles/pix/icon.png [changed mode: 0755->0644]
repository/coursefiles/version.php [changed mode: 0755->0644]
repository/draftfiles_ajax.php [changed mode: 0755->0644]
repository/draftfiles_manager.php [changed mode: 0755->0644]
repository/dropbox/db/access.php [changed mode: 0755->0644]
repository/dropbox/lang/en/repository_dropbox.php [changed mode: 0755->0644]
repository/dropbox/version.php [changed mode: 0755->0644]
repository/filepicker.php [changed mode: 0755->0644]
repository/flickr/lib.php [changed mode: 0755->0644]
repository/flickr_public/image.php [changed mode: 0755->0644]
repository/local/lib.php [changed mode: 0755->0644]
repository/merlot/db/access.php [changed mode: 0755->0644]
repository/merlot/lib.php [changed mode: 0755->0644]
repository/merlot/pix/icon.png [changed mode: 0755->0644]
repository/merlot/version.php [changed mode: 0755->0644]
repository/recent/lib.php [changed mode: 0755->0644]
repository/repository_ajax.php [changed mode: 0755->0644]
repository/repository_callback.php [changed mode: 0755->0644]
repository/upload/lib.php [changed mode: 0755->0644]
repository/upload/pix/icon.png [changed mode: 0755->0644]
repository/url/pix/icon.png [changed mode: 0755->0644]
repository/user/db/install.php [changed mode: 0755->0644]
repository/user/lang/en/repository_user.php [changed mode: 0755->0644]
repository/user/lib.php [changed mode: 0755->0644]
repository/user/pix/icon.png [changed mode: 0755->0644]
repository/user/version.php [changed mode: 0755->0644]
search/Zend/Exception.php [changed mode: 0755->0644]
theme/anomaly/pix/tab/right_last.gif [changed mode: 0755->0644]
theme/anomaly/pix/tab/rtlbg.gif [changed mode: 0755->0644]
theme/anomaly/pix/tab/tabrow1.gif [changed mode: 0755->0644]
theme/binarius/style/core.css
theme/boxxie/pix/tab/right_last.gif [changed mode: 0755->0644]
theme/boxxie/pix/tab/rtlbg.gif [changed mode: 0755->0644]
theme/boxxie/pix/tab/tabrow1.gif [changed mode: 0755->0644]
theme/boxxie/style/core.css
theme/fusion/pix/header-bg.jpg [changed mode: 0755->0644]
theme/fusion/pix/header-center.jpg [changed mode: 0755->0644]
theme/fusion/pix/main-bg.gif [changed mode: 0755->0644]
theme/fusion/pix/side-bg.png [changed mode: 0755->0644]
theme/fusion/pix/side-start.png [changed mode: 0755->0644]
theme/leatherbound/style/core.css
theme/nimble/config.php [new file with mode: 0644]
theme/nimble/lang/en/theme_nimble.php [new file with mode: 0644]
theme/nimble/layout/frontpage.php [new file with mode: 0644]
theme/nimble/layout/general.php [new file with mode: 0644]
theme/nimble/lib.php [new file with mode: 0644]
theme/nimble/pix/screenshot.png [new file with mode: 0644]
theme/nimble/settings.php [new file with mode: 0644]
theme/nimble/style/colors.css [new file with mode: 0644]
theme/nimble/style/core.css [new file with mode: 0644]
theme/nimble/style/menu.css [new file with mode: 0644]
theme/nimble/style/pagelayout.css [new file with mode: 0644]
theme/nonzero/lib.php [changed mode: 0755->0644]
theme/nonzero/settings.php [changed mode: 0755->0644]
theme/nonzero/style/core.css
theme/serenity/style/core.css
theme/standard/pix/tab/right_last.gif [changed mode: 0755->0644]
theme/standard/pix/tab/rtlbg.gif [changed mode: 0755->0644]
theme/standard/pix/tab/tabrow1.gif [changed mode: 0755->0644]
user/addnote.php
user/default/f1.jpg [changed mode: 0755->0644]
user/default/f2.jpg [changed mode: 0755->0644]
user/editadvanced.php
user/emailupdate.php [changed mode: 0755->0644]
user/filters/date.php [changed mode: 0755->0644]
version.php

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index cd55ecf..e211340 100644 (file)
@@ -780,8 +780,8 @@ class define_role_table_advanced extends capability_table_with_risks {
         global $OUTPUT;
         // Extra fields at the top of the page.
         echo '<div class="topfields clearfix">';
-        $this->print_field('name', get_string('name'), $this->get_name_field('name'));
-        $this->print_field('shortname', get_string('shortname'), $this->get_shortname_field('shortname'));
+        $this->print_field('name', get_string('rolefullname', 'role'), $this->get_name_field('name'));
+        $this->print_field('shortname', get_string('roleshortname', 'role'), $this->get_shortname_field('shortname'));
         $this->print_field('edit-description', get_string('description'), $this->get_description_field('description'));
         $this->print_field('menuarchetype', get_string('archetype', 'role').'&nbsp;'.$OUTPUT->help_icon('archetype', 'role'), $this->get_archetype_field('archetype'));
         $this->print_field('', get_string('maybeassignedin', 'role'), $this->get_assignable_levels_control());
old mode 100755 (executable)
new mode 100644 (file)
index 0473b83..411abc8
     $table->head = array(
         get_string('role') . ' ' . $OUTPUT->help_icon('roles', 'role'),
         get_string('description'),
-        get_string('shortname'),
+        get_string('roleshortname', 'role'),
         get_string('edit')
     );
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 5ee0e8a..1861a5d
@@ -1,40 +1,46 @@
 <?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
-/// Bulk user registration script from a comma separated file
-/// Returns list of users with their user ids
+/**
+ * Bulk user registration script from a comma separated file
+ *
+ * @package    core
+ * @subpackage admin
+ * @copyright  2004 onwards Martin Dougiamas (http://dougiamas.com)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 require('../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/csvlib.class.php');
 require_once($CFG->dirroot.'/user/profile/lib.php');
 require_once($CFG->dirroot.'/group/lib.php');
+require_once('uploaduserlib.php');
 require_once('uploaduser_form.php');
 
 $iid         = optional_param('iid', '', PARAM_INT);
 $previewrows = optional_param('previewrows', 10, PARAM_INT);
-$readcount   = optional_param('readcount', 0, PARAM_INT);
-$uploadtype  = optional_param('uutype', 0, PARAM_INT);
-
-define('UU_ADDNEW', 0);
-define('UU_ADDINC', 1);
-define('UU_ADD_UPDATE', 2);
-define('UU_UPDATE', 3);
 
-$choices = array(UU_ADDNEW    => get_string('uuoptype_addnew', 'admin'),
-                 UU_ADDINC    => get_string('uuoptype_addinc', 'admin'),
-                 UU_ADD_UPDATE => get_string('uuoptype_addupdate', 'admin'),
-                 UU_UPDATE     => get_string('uuoptype_update', 'admin'));
-
-@set_time_limit(3600); // 1 hour should be enough
-raise_memory_limit(MEMORY_EXTRA);
+@set_time_limit(60*60); // 1 hour should be enough
+raise_memory_limit(MEMORY_HUGE);
 
 require_login();
 admin_externalpage_setup('uploadusers');
 require_capability('moodle/site:uploadusers', get_context_instance(CONTEXT_SYSTEM));
 
-$textlib = textlib_get_instance();
-$systemcontext = get_context_instance(CONTEXT_SYSTEM);
-
 $struserrenamed             = get_string('userrenamed', 'admin');
 $strusernotrenamedexists    = get_string('usernotrenamedexists', 'error');
 $strusernotrenamedmissing   = get_string('usernotrenamedmissing', 'error');
@@ -46,6 +52,8 @@ $strusernotupdated          = get_string('usernotupdatederror', 'error');
 $strusernotupdatednotexists = get_string('usernotupdatednotexists', 'error');
 $strusernotupdatedadmin     = get_string('usernotupdatedadmin', 'error');
 
+$struseruptodate            = get_string('useraccountuptodate', 'admin');
+
 $struseradded               = get_string('newuser');
 $strusernotadded            = get_string('usernotaddedregistered', 'error');
 $strusernotaddederror       = get_string('usernotaddederror', 'error');
@@ -57,7 +65,6 @@ $strusernotdeletedoff       = get_string('usernotdeletedoff', 'error');
 $strusernotdeletedadmin     = get_string('usernotdeletedadmin', 'error');
 
 $strcannotassignrole        = get_string('cannotassignrole', 'error');
-$strduplicateusername       = get_string('duplicateusername', 'error');
 
 $struserauthunsupported     = get_string('userauthunsupported', 'error');
 $stremailduplicate          = get_string('useremailduplicate', 'error');
@@ -65,20 +72,23 @@ $stremailduplicate          = get_string('useremailduplicate', 'error');
 $strinvalidpasswordpolicy   = get_string('invalidpasswordpolicy', 'error');
 $errorstr                   = get_string('error');
 
-$returnurl = $CFG->wwwroot.'/'.$CFG->admin.'/uploaduser.php';
-$bulknurl  = $CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk.php';
+$returnurl = new moodle_url('/admin/uploaduser.php');
+$bulknurl  = new moodle_url('/admin/user/user_bulk.php');
 
 $today = time();
 $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
 
 // array of all valid fields for validation
 $STD_FIELDS = array('id', 'firstname', 'lastname', 'username', 'email',
-        'city', 'country', 'lang', 'auth', 'timezone', 'mailformat',
+        'city', 'country', 'lang', 'timezone', 'mailformat',
         'maildisplay', 'maildigest', 'htmleditor', 'ajax', 'autosubscribe',
-        'mnethostid', 'institution', 'department', 'idnumber', 'skype',
+        'institution', 'department', 'idnumber', 'skype',
         'msn', 'aim', 'yahoo', 'icq', 'phone1', 'phone2', 'address',
-        'url', 'description', 'descriptionformat', 'oldusername', 'deleted',
-        'password');
+        'url', 'description', 'descriptionformat', 'password',
+        'auth',        // watch out when changing auth type or using external auth plugins!
+        'oldusername', // use when renaming users - this is the original username
+        'deleted',     // 1 means delete user
+    );
 
 $PRF_FIELDS = array();
 
@@ -86,27 +96,28 @@ if ($prof_fields = $DB->get_records('user_info_field')) {
     foreach ($prof_fields as $prof_field) {
         $PRF_FIELDS[] = 'profile_field_'.$prof_field->shortname;
     }
-    unset($prof_fields);
 }
+unset($prof_fields);
 
 if (empty($iid)) {
-    $mform = new admin_uploaduser_form1();
+    $mform1 = new admin_uploaduser_form1();
 
-    if ($formdata = $mform->get_data()) {
+    if ($formdata = $mform1->get_data()) {
         $iid = csv_import_reader::get_new_iid('uploaduser');
         $cir = new csv_import_reader($iid, 'uploaduser');
 
-        $content = $mform->get_file_content('userfile');
-        $optype = $formdata->uutype;
-        $readcount = $cir->load_csv_content($content, $formdata->encoding, $formdata->delimiter_name, 'validate_user_upload_columns');
+        $content = $mform1->get_file_content('userfile');
+
+        $readcount = $cir->load_csv_content($content, $formdata->encoding, $formdata->delimiter_name);
         unset($content);
 
         if ($readcount === false) {
-            //TODO: need more detailed error info
             print_error('csvloaderror', '', $returnurl);
         } else if ($readcount == 0) {
             print_error('csvemptyfile', 'error', $returnurl);
         }
+        // test if columns ok
+        $filecolumns = uu_validate_user_upload_columns($cir, $STD_FIELDS, $PRF_FIELDS, $returnurl);
         // continue to form2
 
     } else {
@@ -114,61 +125,56 @@ if (empty($iid)) {
 
         echo $OUTPUT->heading_with_help(get_string('uploadusers', 'admin'), 'uploadusers', 'admin');
 
-        $mform->display();
+        $mform1->display();
         echo $OUTPUT->footer();
         die;
     }
 } else {
     $cir = new csv_import_reader($iid, 'uploaduser');
+    $filecolumns = uu_validate_user_upload_columns($cir, $STD_FIELDS, $PRF_FIELDS, $returnurl);
 }
 
-if (!$columns = $cir->get_columns()) {
-    print_error('cannotreadtmpfile', 'error', $returnurl);
-}
-$mform = new admin_uploaduser_form2(null, $columns);
-// get initial date from form1
-$mform->set_data(array('iid'=>$iid, 'previewrows'=>$previewrows, 'readcount'=>$readcount, 'uutypelabel'=>$choices[$uploadtype], 'uutype'=>$uploadtype));
+$mform2 = new admin_uploaduser_form2(null, array('columns'=>$filecolumns, 'data'=>array('iid'=>$iid, 'previewrows'=>$previewrows)));
 
 // If a file has been uploaded, then process it
-if ($formdata = $mform->is_cancelled()) {
+if ($formdata = $mform2->is_cancelled()) {
     $cir->cleanup(true);
     redirect($returnurl);
 
-} else if ($formdata = $mform->get_data()) {
+} else if ($formdata = $mform2->get_data()) {
     // Print the header
     echo $OUTPUT->header();
     echo $OUTPUT->heading(get_string('uploadusersresult', 'admin'));
 
     $optype = $formdata->uutype;
 
-    $createpasswords   = (!empty($formdata->uupasswordnew) and $optype != UU_UPDATE);
-    $updatepasswords   = (!empty($formdata->uupasswordold)  and $optype != UU_ADDNEW and $optype != UU_ADDINC);
-    $allowrenames      = (!empty($formdata->uuallowrenames) and $optype != UU_ADDNEW and $optype != UU_ADDINC);
-    $allowdeletes      = (!empty($formdata->uuallowdeletes) and $optype != UU_ADDNEW and $optype != UU_ADDINC);
     $updatetype        = isset($formdata->uuupdatetype) ? $formdata->uuupdatetype : 0;
+    $createpasswords   = (!empty($formdata->uupasswordnew) and $optype != UU_USER_UPDATE);
+    $updatepasswords   = (!empty($formdata->uupasswordold)  and $optype != UU_USER_ADDNEW and $optype != UU_USER_ADDINC and ($updatetype == UU_UPDATE_FILEOVERRIDE or $updatetype == UU_UPDATE_ALLOVERRIDE));
+    $allowrenames      = (!empty($formdata->uuallowrenames) and $optype != UU_USER_ADDNEW and $optype != UU_USER_ADDINC);
+    $allowdeletes      = (!empty($formdata->uuallowdeletes) and $optype != UU_USER_ADDNEW and $optype != UU_USER_ADDINC);
     $bulk              = $formdata->uubulk;
     $noemailduplicates = $formdata->uunoemailduplicates;
+    $standardusernames = $formdata->uustandardusernames;
+    $resetpasswords    = isset($formdata->uuforcepasswordchange) ? $formdata->uuforcepasswordchange : UU_PWRESET_NONE;
 
     // verification moved to two places: after upload and into form2
-    $usersnew     = 0;
-    $usersupdated = 0;
-    $userserrors  = 0;
-    $deletes      = 0;
-    $deleteerrors = 0;
-    $renames      = 0;
-    $renameerrors = 0;
-    $usersskipped = 0;
+    $usersnew      = 0;
+    $usersupdated  = 0;
+    $usersuptodate = 0; //not printed yet anywhere
+    $userserrors   = 0;
+    $deletes       = 0;
+    $deleteerrors  = 0;
+    $renames       = 0;
+    $renameerrors  = 0;
+    $usersskipped  = 0;
     $weakpasswords = 0;
 
     // caches
-    $ccache       = array(); // course cache - do not fetch all courses here, we  will not probably use them all anyway!
-    $rolecache    = uu_allowed_roles_cache(); // roles lookup cache
-    $manualcache  = array(); // cache of used manual enrol plugins in each course
-
-    $allowedauths   = uu_allowed_auths();
-    $allowedauths   = array_keys($allowedauths);
-    $availableauths = get_plugin_list('auth');
-    $availableauths = array_keys($availableauths);
+    $ccache         = array(); // course cache - do not fetch all courses here, we  will not probably use them all anyway!
+    $rolecache      = uu_allowed_roles_cache(); // roles lookup cache
+    $manualcache    = array(); // cache of used manual enrol plugins in each course
+    $supportedauths = uu_supported_auths(); // officially supported plugins that are enabled
 
     // we use only manual enrol plugin here, if it is disabled no enrol is done
     if (enrol_is_enabled('manual')) {
@@ -188,7 +194,7 @@ if ($formdata = $mform->is_cancelled()) {
 
     // init upload progress tracker
     $upt = new uu_progress_tracker();
-    $upt->init(); // start table
+    $upt->start(); // start table
 
     while ($line = $cir->next()) {
         $upt->flush();
@@ -196,37 +202,43 @@ if ($formdata = $mform->is_cancelled()) {
 
         $upt->track('line', $linenum);
 
-        $forcechangepassword = false;
-
         $user = new stdClass();
-        // by default, use the local mnet id (this may be changed in the file)
-        $user->mnethostid = $CFG->mnet_localhost_id;
+
         // add fields to user object
-        foreach ($line as $key => $value) {
-            if ($value !== '') {
-                $key = $columns[$key];
-                $user->$key = $value;
-                if (in_array($key, $upt->columns)) {
-                    $upt->track($key, $value);
+        foreach ($line as $keynum => $value) {
+            if (!isset($filecolumns[$keynum])) {
+                // this should not happen
+                continue;
+            }
+            $key = $filecolumns[$keynum];
+            if (strpos($key, 'profile_field_') === 0) {
+                //NOTE: bloody mega hack alert!!
+                if (isset($USER->$key) and is_array($USER->$key)) {
+                    // this must be some hacky field that is abusing arrays to store content and format
+                    $user->$key = array();
+                    $user->$key['text']   = $value;
+                    $user->$key['format'] = FORMAT_MOODLE;
+                } else {
+                    $user->$key = $value;
                 }
             } else {
-                $user->$columns[$key] = '';
+                $user->$key = $value;
             }
-        }
 
-        // get username, first/last name now - we need them in templates!!
-        if ($optype == UU_UPDATE) {
-            // when updating only username is required
-            if (!isset($user->username)) {
-                $upt->track('status', get_string('missingfield', 'error', 'username'), 'error');
-                $upt->track('username', $errorstr, 'error');
-                $userserrors++;
-                continue;
+            if (in_array($key, $upt->columns)) {
+                // default value in progress tracking table, can be changed later
+                $upt->track($key, s($value), 'normal');
             }
+        }
+        if (!isset($user->username)) {
+            // prevent warnings bellow
+            $user->username = '';
+        }
 
-        } else {
+        if ($optype == UU_USER_ADDNEW or $optype == UU_USER_ADDINC) {
+            // user creation is a special case - the username may be constructed from templates using firstname and lastname
+            // better never try this in mixed update types
             $error = false;
-            // when all other ops need firstname and lastname
             if (!isset($user->firstname) or $user->firstname === '') {
                 $upt->track('status', get_string('missingfield', 'error', 'firstname'), 'error');
                 $upt->track('firstname', $errorstr, 'error');
@@ -242,43 +254,50 @@ if ($formdata = $mform->is_cancelled()) {
                 continue;
             }
             // we require username too - we might use template for it though
-            if (!isset($user->username)) {
-                if (!isset($formdata->username) or $formdata->username === '') {
-                    $upt->track('status', get_string('missingfield', 'error', 'username'), 'error');
-                    $upt->track('username', $errorstr, 'error');
-                    $userserrors++;
-                    continue;
-                } else {
-                    $user->username = process_template($formdata->username, $user);
-                    $upt->track('username', $user->username);
-                }
+            if (empty($user->username) and !empty($formdata->username)) {
+                $user->username = uu_process_template($formdata->username, $user);
+                $upt->track('username', s($user->username));
             }
         }
 
         // normalize username
-        $user->username = clean_param($user->username, PARAM_USERNAME);
+        $originalusername = $user->username;
+        if ($standardusernames) {
+            $user->username = clean_param($user->username, PARAM_USERNAME);
+        }
 
+        // make sure we really have username
         if (empty($user->username)) {
             $upt->track('status', get_string('missingfield', 'error', 'username'), 'error');
             $upt->track('username', $errorstr, 'error');
             $userserrors++;
             continue;
+        } else if ($user->username === 'guest') {
+            $upt->track('status', get_string('guestnoeditprofileother', 'error'), 'error');
+            $userserrors++;
+            continue;
         }
 
-        if ($existinguser = $DB->get_record('user', array('username'=>$user->username, 'mnethostid'=>$user->mnethostid))) {
+        if ($existinguser = $DB->get_record('user', array('username'=>$user->username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
             $upt->track('id', $existinguser->id, 'normal', false);
         }
 
         // find out in username incrementing required
-        if ($existinguser and $optype == UU_ADDINC) {
-            $oldusername = $user->username;
-            $user->username = increment_username($user->username, $user->mnethostid);
-            $upt->track('username', '', 'normal', false); // clear previous
-            $upt->track('username', $oldusername.'-->'.$user->username, 'info');
+        if ($existinguser and $optype == UU_USER_ADDINC) {
+            $user->username = uu_increment_username($user->username);
             $existinguser = false;
         }
 
+        // notify about nay username changes
+        if ($originalusername !== $user->username) {
+            $upt->track('username', '', 'normal', false); // clear previous
+            $upt->track('username', s($originalusername).'-->'.s($user->username), 'info');
+        } else {
+            $upt->track('username', s($user->username), 'normal', false);
+        }
+
         // add default values for remaining fields
+        $formdefaults = array();
         foreach ($STD_FIELDS as $field) {
             if (isset($user->$field)) {
                 continue;
@@ -286,7 +305,8 @@ if ($formdata = $mform->is_cancelled()) {
             // all validation moved to form2
             if (isset($formdata->$field)) {
                 // process templates
-                $user->$field = process_template($formdata->$field, $user);
+                $user->$field = uu_process_template($formdata->$field, $user);
+                $formdefaults[$field] = true;
             }
         }
         foreach ($PRF_FIELDS as $field) {
@@ -295,13 +315,8 @@ if ($formdata = $mform->is_cancelled()) {
             }
             if (isset($formdata->$field)) {
                 // process templates
-                if (is_array($formdata->$field)) {
-                    foreach ($formdata->$field as $k=>$v) {
-                        $user->$field[$k] = process_template($v, $user);
-                    }
-                } else {
-                    $user->$field = process_template($formdata->$field, $user);
-                }
+                $user->$field = uu_process_template($formdata->$field, $user);
+                $formdefaults[$field] = true;
             }
         }
 
@@ -336,7 +351,6 @@ if ($formdata = $mform->is_cancelled()) {
 
         // renaming requested?
         if (!empty($user->oldusername) ) {
-            $oldusername = $textlib->strtolower($user->oldusername);
             if (!$allowrenames) {
                 $usersskipped++;
                 $upt->track('status', $strusernotrenamedoff, 'warning');
@@ -349,7 +363,20 @@ if ($formdata = $mform->is_cancelled()) {
                 continue;
             }
 
-            if ($olduser = $DB->get_record('user', array('username'=>$oldusername, 'mnethostid'=>$user->mnethostid))) {
+            if ($user->username === 'guest') {
+                $upt->track('status', get_string('guestnoeditprofileother', 'error'), 'error');
+                $renameerrors++;
+                continue;
+            }
+
+            if ($standardusernames) {
+                $oldusername = clean_param($user->oldusername, PARAM_USERNAME);
+            } else {
+                $oldusername = $user->oldusername;
+            }
+
+            // no guessing when looking for old username, it must be exact match
+            if ($olduser = $DB->get_record('user', array('username'=>$oldusername, 'mnethostid'=>$CFG->mnet_localhost_id))) {
                 $upt->track('id', $olduser->id, 'normal', false);
                 if (is_siteadmin($olduser->id)) {
                     $upt->track('status', $strusernotrenamedadmin, 'error');
@@ -358,7 +385,7 @@ if ($formdata = $mform->is_cancelled()) {
                 }
                 $DB->set_field('user', 'username', $user->username, array('id'=>$olduser->id));
                 $upt->track('username', '', 'normal', false); // clear previous
-                $upt->track('username', $oldusername.'-->'.$user->username, 'info');
+                $upt->track('username', s($oldusername).'-->'.s($user->username), 'info');
                 $upt->track('status', $struserrenamed);
                 $renames++;
             } else {
@@ -373,7 +400,7 @@ if ($formdata = $mform->is_cancelled()) {
         // can we process with update or insert?
         $skip = false;
         switch ($optype) {
-            case UU_ADDNEW:
+            case UU_USER_ADDNEW:
                 if ($existinguser) {
                     $usersskipped++;
                     $upt->track('status', $strusernotadded, 'warning');
@@ -381,25 +408,29 @@ if ($formdata = $mform->is_cancelled()) {
                 }
                 break;
 
-            case UU_ADDINC:
+            case UU_USER_ADDINC:
                 if ($existinguser) {
                     //this should not happen!
                     $upt->track('status', $strusernotaddederror, 'error');
                     $userserrors++;
-                    continue;
+                    $skip = true;
                 }
                 break;
 
-            case UU_ADD_UPDATE:
+            case UU_USER_ADD_UPDATE:
                 break;
 
-            case UU_UPDATE:
+            case UU_USER_UPDATE:
                 if (!$existinguser) {
                     $usersskipped++;
                     $upt->track('status', $strusernotupdatednotexists, 'warning');
                     $skip = true;
                 }
                 break;
+
+            default:
+                // unknown type
+                $skip = true;
         }
 
         if ($skip) {
@@ -409,201 +440,180 @@ if ($formdata = $mform->is_cancelled()) {
         if ($existinguser) {
             $user->id = $existinguser->id;
 
+            $upt->track('username', html_writer::link(new moodle_url('/user/profile.php', array('id'=>$existinguser->id)), s($existinguser->username)), 'normal', false);
+
             if (is_siteadmin($user->id)) {
                 $upt->track('status', $strusernotupdatedadmin, 'error');
                 $userserrors++;
                 continue;
             }
 
-            if (!$updatetype) {
-                // no updates of existing data at all
-            } else {
-                $existinguser->timemodified = time();
-                if (empty($existinguser->timecreated)) {
-                    if (empty($existinguser->firstaccess)) {
-                        $existinguser->timecreated = time();
-                    } else {
-                        $existinguser->timecreated = $existinguser->firstaccess;
-                    }
-                }
+            $existinguser->timemodified = time();
+            // do NOT mess with timecreated or firstaccess here!
+
+            //load existing profile data
+            profile_load_data($existinguser);
 
-                //load existing profile data
-                profile_load_data($existinguser);
+            $upt->track('auth', $existinguser->auth, 'normal', false);
 
-                $allowed = array();
-                if ($updatetype == 1) {
-                    $allowed = $columns;
-                } else if ($updatetype == 2 or $updatetype == 3) {
-                    $allowed = array_merge($STD_FIELDS, $PRF_FIELDS);
+            $doupdate = false;
+
+            if ($updatetype != UU_UPDATE_NOCHANGES) {
+                if (!empty($user->auth) and $user->auth !== $existinguser->auth) {
+                    $upt->track('auth', s($existinguser->auth).'-->'.s($user->auth), 'info', false);
+                    $existinguser->auth = $user->auth;
+                    if (!isset($supportedauths[$user->auth])) {
+                        $upt->track('auth', $struserauthunsupported, 'warning');
+                    }
                 }
-                foreach ($allowed as $column) {
-                    $temppasswordhandler = '';
-                    if ($column == 'username') {
+                $allcolumns = array_merge($STD_FIELDS, $PRF_FIELDS);
+                foreach ($allcolumns as $column) {
+                    if ($column === 'username' or $column === 'password' or $column === 'auth') {
+                        // these can not be changed here
                         continue;
                     }
-                    if ((property_exists($existinguser, $column) and property_exists($user, $column)) or in_array($column, $PRF_FIELDS)) {
-                        if ($updatetype == 3 && $existinguser->$column !== '') {
-                            //missing == non-empty only
+                    if (!property_exists($user, $column) or !property_exists($existinguser, $column)) {
+                        // this should never happen
+                        continue;
+                    }
+                    if ($updatetype == UU_UPDATE_MISSING) {
+                        if (!is_null($existinguser->$column) and $existinguser->$column !== '') {
                             continue;
                         }
-                        if ($existinguser->$column !== $user->$column) {
-                            if ($column == 'email') {
-                                if ($DB->record_exists('user', array('email'=>$user->email))) {
-                                    if ($noemailduplicates) {
-                                        $upt->track('email', $stremailduplicate, 'error');
-                                        $upt->track('status', $strusernotupdated, 'error');
-                                        $userserrors++;
-                                        continue 2;
-                                    } else {
-                                        $upt->track('email', $stremailduplicate, 'warning');
-                                    }
-                                }
-                            }
-
-                            if ($column == 'password') {
-                                $temppasswordhandler = $existinguser->password;
-                            }
+                    } else if ($updatetype == UU_UPDATE_ALLOVERRIDE) {
+                        // we override everything
 
-                            if ($column == 'auth') {
-                                if (isset($user->auth) && empty($user->auth)) {
-                                    $user->auth = 'manual';
-                                }
-
-                                $existinguserauth = get_auth_plugin($existinguser->auth);
-                                $existingisinternalauth = $existinguserauth->is_internal();
-
-                                $userauth = get_auth_plugin($user->auth);
-                                $isinternalauth = $userauth->is_internal();
-
-                                if ($isinternalauth === $existingisinternalauth) {
-                                    if ($updatepasswords) {
-                                        if (empty($user->password)) {
-                                            $forcechangepassword = true;
-                                        }
-                                    }
-                                } else if ($isinternalauth) {
-                                    $existinguser->password = '';
-                                    $forcechangepassword = true;
+                    } else if ($updatetype == UU_UPDATE_FILEOVERRIDE) {
+                        if (!empty($formdefaults[$column])) {
+                            // do not override with form defaults
+                            continue;
+                        }
+                    }
+                    if ($existinguser->$column !== $user->$column) {
+                        if ($column === 'email') {
+                            if ($DB->record_exists('user', array('email'=>$user->email))) {
+                                if ($noemailduplicates) {
+                                    $upt->track('email', $stremailduplicate, 'error');
+                                    $upt->track('status', $strusernotupdated, 'error');
+                                    $userserrors++;
+                                    continue 2;
+                                } else {
+                                    $upt->track('email', $stremailduplicate, 'warning');
                                 }
                             }
-
-                            $upt->track($column, '', 'normal', false); // clear previous
-                            if ($column != 'password' && in_array($column, $upt->columns)) {
-                                $upt->track($column, $existinguser->$column.'-->'.$user->$column, 'info');
+                            if (!validate_email($user->email)) {
+                                $upt->track('email', get_string('invalidemail'), 'warning');
                             }
-                            $existinguser->$column = $user->$column;
+                        }
 
-                            if (!isset($user->auth) && !$updatepasswords) {
-                                $existinguser->password = $temppasswordhandler;
-                            }
+                        if (in_array($column, $upt->columns)) {
+                            $upt->track($column, s($existinguser->$column).'-->'.s($user->$column), 'info', false);
                         }
+                        $existinguser->$column = $user->$column;
+                        $doupdate = true;
                     }
                 }
+            }
 
-                // do not update record if new auth plugin does not exist!
-                if (!in_array($existinguser->auth, $availableauths)) {
-                    $upt->track('auth', get_string('userautherror', 'error', $existinguser->auth), 'error');
-                    $upt->track('status', $strusernotupdated, 'error');
-                    $userserrors++;
-                    continue;
-                } else if (!in_array($existinguser->auth, $allowedauths)) {
-                    $upt->track('auth', $struserauthunsupported, 'warning');
-                }
-
+            try {
                 $auth = get_auth_plugin($existinguser->auth);
-                $isinternalauth = $auth->is_internal();
+            } catch (Exception $e) {
+                $upt->track('auth', get_string('userautherror', 'error', s($existinguser->auth)), 'error');
+                $upt->track('status', $strusernotupdated, 'error');
+                $userserrors++;
+                continue;
+            }
+            $isinternalauth = $auth->is_internal();
 
-                if ($isinternalauth && $updatepasswords && !check_password_policy($user->password, $errmsg)) {
-                    $upt->track('password', get_string('internalauthpassworderror', 'error', $existinguser->password), 'error');
-                    $upt->track('status', $strusernotupdated, 'error');
-                    $userserrors++;
-                    continue;
+            // changing of passwords is a special case
+            // do not force password changes for external auth plugins!
+            $oldpw = $existinguser->password;
+            if (!$isinternalauth) {
+                $existinguser->password = 'not cached';
+                $upt->track('password', '-', 'normal', false);
+                // clean up prefs
+                unset_user_preference('create_password', $existinguser);
+                unset_user_preference('auth_forcepasswordchange', $existinguser);
+
+            } else if (!empty($user->password)) {
+                if ($updatepasswords) {
+                    $errmsg = null;
+                    $weak = !check_password_policy($user->password, $errmsg);
+                    if ($resetpasswords == UU_PWRESET_ALL or ($resetpasswords == UU_PWRESET_WEAK and $weak)) {
+                        if ($weak) {
+                            $weakpasswords++;
+                            $upt->track('password', $strinvalidpasswordpolicy, 'warning');
+                        }
+                        set_user_preference('auth_forcepasswordchange', 1, $existinguser);
+                    } else {
+                        unset_user_preference('auth_forcepasswordchange', $existinguser);
+                    }
+                    unset_user_preference('create_password', $existinguser); // no need to create password any more
+                    $existinguser->password = hash_internal_user_password($user->password);
+                    $upt->track('password', $user->password, 'normal', false);
                 } else {
-                    $forcechangepassword = true;
+                    // do not print password when not changed
+                    $upt->track('password', '', 'normal', false);
                 }
+            }
 
-                if (!$isinternalauth) {
-                    $existinguser->password = 'not cached';
-                    $upt->track('password', 'not cached');
-                    $forcechangepassword = false;
-                } else if ($updatepasswords){
-                    $existinguser->password = hash_internal_user_password($existinguser->password);
-                } else {
-                    $existinguser->password = $temppasswordhandler;
-                }
+            if ($doupdate or $existinguser->password !== $oldpw) {
+                // we want only users that were really updated
 
                 $DB->update_record('user', $existinguser);
 
-                //remove user preference
-
-                if (get_user_preferences('create_password', false, $existinguser)) {
-                    unset_user_preference('create_password', $existinguser);
-                }
-                if (get_user_preferences('auth_forcepasswordchange', false, $existinguser)) {
-                    unset_user_preference('auth_forcepasswordchange', $existinguser);
-                }
-
-                if ($isinternalauth && $updatepasswords) {
-                    if (empty($existinguser->password)) {
-                        set_user_preference('create_password', 1, $existinguser->id);
-                        set_user_preference('auth_forcepasswordchange', 1, $existinguser->id);
-                        $upt->track('password', get_string('new'));
-                    } else if ($forcechangepassword) {
-                        set_user_preference('auth_forcepasswordchange', 1, $existinguser->id);
-                    }
-                }
                 $upt->track('status', $struserupdated);
                 $usersupdated++;
                 // save custom profile fields data from csv file
                 profile_save_data($existinguser);
 
                 events_trigger('user_updated', $existinguser);
-            }
 
-            if ($bulk == 2 or $bulk == 3) {
-                if (!in_array($user->id, $SESSION->bulk_users)) {
-                    $SESSION->bulk_users[] = $user->id;
+                if ($bulk == UU_BULK_UPDATED or $bulk == UU_BULK_ALL) {
+                    if (!in_array($user->id, $SESSION->bulk_users)) {
+                        $SESSION->bulk_users[] = $user->id;
+                    }
+                }
+
+            } else {
+                // no user information changed
+                $upt->track('status', $struseruptodate);
+                $usersuptodate++;
+
+                if ($bulk == UU_BULK_ALL) {
+                    if (!in_array($user->id, $SESSION->bulk_users)) {
+                        $SESSION->bulk_users[] = $user->id;
+                    }
                 }
             }
 
         } else {
-            // save the user to the database
-            $user->confirmed = 1;
+            // save the new user to the database
+            $user->confirmed    = 1;
             $user->timemodified = time();
-            $user->timecreated = time();
+            $user->timecreated  = time();
+            $user->mnethostid   = $CFG->mnet_localhost_id; // we support ONLY local accounts here, sorry
 
-            if (isset($user->auth) && empty($user->auth)) {
+            if (empty($user->auth)) {
                 $user->auth = 'manual';
             }
-            $auth = get_auth_plugin($user->auth);
-            $isinternalauth = $auth->is_internal();
+            $upt->track('auth', $user->auth, 'normal', false);
 
-            if (!$createpasswords && $isinternalauth) {
-                if (empty($user->password)) {
-                    $upt->track('password', get_string('missingfield', 'error', 'password'), 'error');
-                    $upt->track('status', $strusernotaddederror, 'error');
-                    $userserrors++;
-                    continue;
-                } else if ($forcechangepassword) {
-                    $upt->track('password', $strinvalidpasswordpolicy);
-                    $upt->track('status', $strusernotaddederror, 'error');
-                    $userserrors++;
-                    continue;
-                }
+            // do not insert record if new auth plugin does not exist!
+            try {
+                $auth = get_auth_plugin($user->auth);
+            } catch (Exception $e) {
+                $upt->track('auth', get_string('userautherror', 'error', s($user->auth)), 'error');
+                $upt->track('status', $strusernotaddederror, 'error');
+                $userserrors++;
+                continue;
             }
-
-            // do not insert record if new auth plguin does not exist!
-            if (isset($user->auth)) {
-                if (!in_array($user->auth, $availableauths)) {
-                    $upt->track('auth', get_string('userautherror', 'error', $user->auth), 'error');
-                    $upt->track('status', $strusernotaddederror, 'error');
-                    $userserrors++;
-                    continue;
-                } else if (!in_array($user->auth, $allowedauths)) {
-                    $upt->track('auth', $struserauthunsupported, 'warning');
-                }
+            if (!isset($supportedauths[$user->auth])) {
+                $upt->track('auth', $struserauthunsupported, 'warning');
             }
 
+            $isinternalauth = $auth->is_internal();
+
             if ($DB->record_exists('user', array('email'=>$user->email))) {
                 if ($noemailduplicates) {
                     $upt->track('email', $stremailduplicate, 'error');
@@ -614,38 +624,66 @@ if ($formdata = $mform->is_cancelled()) {
                     $upt->track('email', $stremailduplicate, 'warning');
                 }
             }
-            if (!$isinternalauth) {
-                $user->password = 'not cached';
-                $upt->track('password', 'not cached');
-            } else {
-                $user->password = hash_internal_user_password($user->password);
+            if (!validate_email($user->email)) {
+                $upt->track('email', get_string('invalidemail'), 'warning');
             }
 
-            $user->id = $DB->insert_record('user', $user);
-            $info = ': ' . $user->username .' (ID = ' . $user->id . ')';
-            $upt->track('status', $struseradded);
-            $upt->track('id', $user->id, 'normal', false);
-            $usersnew++;
-            if ($createpasswords && $isinternalauth) {
-                if (empty($user->password) || $forcechangepassword) {
-                    // passwords will be created and sent out on cron
-                    set_user_preference('create_password', 1, $user->id);
-                    set_user_preference('auth_forcepasswordchange', 1, $user->id);
-                    $upt->track('password', get_string('new'));
+            $forcechangepassword = false;
+
+            if ($isinternalauth) {
+                if (empty($user->password)) {
+                    if ($createpasswords) {
+                        $user->password = 'to be generated';
+                        $upt->track('password', '', 'normal', false);
+                        $upt->track('password', get_string('uupasswordcron', 'admin'), 'warning', false);
+                    } else {
+                        $upt->track('password', '', 'normal', false);
+                        $upt->track('password', get_string('missingfield', 'error', 'password'), 'error');
+                        $upt->track('status', $strusernotaddederror, 'error');
+                        $userserrors++;
+                        continue;
+                    }
                 } else {
-                    set_user_preference('auth_forcepasswordchange', 1, $user->id);
+                    $errmsg = null;
+                    $weak = !check_password_policy($user->password, $errmsg);
+                    if ($resetpasswords == UU_PWRESET_ALL or ($resetpasswords == UU_PWRESET_WEAK and $weak)) {
+                        if ($weak) {
+                            $weakpasswords++;
+                            $upt->track('password', $strinvalidpasswordpolicy, 'warning');
+                        }
+                        $forcechangepassword = true;
+                    }
+                    $user->password = hash_internal_user_password($user->password);
                 }
+            } else {
+                $user->password = 'not cached';
+                $upt->track('password', '-', 'normal', false);
             }
 
+            // create user - insert_record ignores any extra properties
+            $user->id = $DB->insert_record('user', $user);
+            $upt->track('username', html_writer::link(new moodle_url('/user/profile.php', array('id'=>$user->id)), s($user->username)), 'normal', false);
+
             // save custom profile fields data
             profile_save_data($user);
 
+            if ($forcechangepassword) {
+                set_user_preference('auth_forcepasswordchange', 1, $user);
+            }
+            if ($user->password === 'to be generated') {
+                set_user_preference('create_password', 1, $user);
+            }
+
+            $upt->track('status', $struseradded);
+            $upt->track('id', $user->id, 'normal', false);
+            $usersnew++;
+
             // make sure user context exists
             get_context_instance(CONTEXT_USER, $user->id);
 
             events_trigger('user_created', $user);
 
-            if ($bulk == 1 or $bulk == 3) {
+            if ($bulk == UU_BULK_NEW or $bulk == UU_BULK_ALL) {
                 if (!in_array($user->id, $SESSION->bulk_users)) {
                     $SESSION->bulk_users[] = $user->id;
                 }
@@ -653,7 +691,8 @@ if ($formdata = $mform->is_cancelled()) {
         }
 
         // find course enrolments, groups, roles/types and enrol periods
-        foreach ($columns as $column) {
+        // this is again a special case, we always do this for any updated or created users
+        foreach ($filecolumns as $column) {
             if (!preg_match('/^course\d+$/', $column)) {
                 continue;
             }
@@ -665,7 +704,7 @@ if ($formdata = $mform->is_cancelled()) {
             $shortname = $user->{'course'.$i};
             if (!array_key_exists($shortname, $ccache)) {
                 if (!$course = $DB->get_record('course', array('shortname'=>$shortname), 'id, shortname')) {
-                    $upt->track('enrolments', get_string('unknowncourse', 'error', $shortname), 'error');
+                    $upt->track('enrolments', get_string('unknowncourse', 'error', s($shortname)), 'error');
                     continue;
                 }
                 $ccache[$shortname] = $course;
@@ -696,7 +735,7 @@ if ($formdata = $mform->is_cancelled()) {
                     if (array_key_exists($addrole, $rolecache)) {
                         $rid = $rolecache[$addrole]->id;
                     } else {
-                        $upt->track('enrolments', get_string('unknownrole', 'error', $addrole), 'error');
+                        $upt->track('enrolments', get_string('unknownrole', 'error', s($addrole)), 'error');
                         continue;
                     }
 
@@ -720,9 +759,9 @@ if ($formdata = $mform->is_cancelled()) {
                     // find duration
                     $timeend   = 0;
                     if (!empty($user->{'enrolperiod'.$i})) {
-                        $duration = (int)$user->{'enrolperiod'.$i} * 86400; // convert days to seconds
+                        $duration = (int)$user->{'enrolperiod'.$i} * 60*60*24; // convert days to seconds
                         if ($duration > 0) { // sanity check
-                            $timeend   = $today + $duration;
+                            $timeend = $today + $duration;
                         }
                     }
 
@@ -751,9 +790,9 @@ if ($formdata = $mform->is_cancelled()) {
                             $ccache[$shortname]->groups[$gid]->id   = $gid;
                             $ccache[$shortname]->groups[$gid]->name = $group->name;
                             if (!is_numeric($group->name)) { // only non-numeric names are supported!!!
-                            $ccache[$shortname]->groups[$group->name] = new stdClass();
-                            $ccache[$shortname]->groups[$group->name]->id   = $gid;
-                            $ccache[$shortname]->groups[$group->name]->name = $group->name;
+                                $ccache[$shortname]->groups[$group->name] = new stdClass();
+                                $ccache[$shortname]->groups[$group->name]->id   = $gid;
+                                $ccache[$shortname]->groups[$group->name]->name = $group->name;
                             }
                         }
                     }
@@ -768,7 +807,7 @@ if ($formdata = $mform->is_cancelled()) {
                     if ($ccache[$shortname]->groups[$addgroup]->id = groups_create_group($newgroupdata)){
                         $ccache[$shortname]->groups[$addgroup]->name = $newgroupdata->name;
                     } else {
-                        $upt->track('enrolments', get_string('unknowngroup', 'error', $addgroup), 'error');
+                        $upt->track('enrolments', get_string('unknowngroup', 'error', s($addgroup)), 'error');
                         continue;
                     }
                 }
@@ -777,18 +816,17 @@ if ($formdata = $mform->is_cancelled()) {
 
                 try {
                     if (groups_add_member($gid, $user->id)) {
-                        $upt->track('enrolments', get_string('addedtogroup', '', $gname));
+                        $upt->track('enrolments', get_string('addedtogroup', '', s($gname)));
                     }  else {
-                        $upt->track('enrolments', get_string('addedtogroupnot', '', $gname), 'error');
+                        $upt->track('enrolments', get_string('addedtogroupnot', '', s($gname)), 'error');
                     }
                 } catch (moodle_exception $e) {
-                    $upt->track('enrolments', get_string('addedtogroupnot', '', $gname), 'error');
+                    $upt->track('enrolments', get_string('addedtogroupnot', '', s($gname)), 'error');
                     continue;
                 }
             }
         }
     }
-    $upt->flush();
     $upt->close(); // close table
 
     $cir->close();
@@ -796,10 +834,10 @@ if ($formdata = $mform->is_cancelled()) {
 
     echo $OUTPUT->box_start('boxwidthnarrow boxaligncenter generalbox', 'uploadresults');
     echo '<p>';
-    if ($optype != UU_UPDATE) {
+    if ($optype != UU_USER_UPDATE) {
         echo get_string('userscreated', 'admin').': '.$usersnew.'<br />';
     }
-    if ($optype == UU_UPDATE or $optype == UU_ADD_UPDATE) {
+    if ($optype == UU_USER_UPDATE or $optype == UU_USER_ADD_UPDATE) {
         echo get_string('usersupdated', 'admin').': '.$usersupdated.'<br />';
     }
     if ($allowdeletes) {
@@ -829,123 +867,50 @@ if ($formdata = $mform->is_cancelled()) {
 // Print the header
 echo $OUTPUT->header();
 
-/// Print the form
-
 echo $OUTPUT->heading(get_string('uploaduserspreview', 'admin'));
 
+// NOTE: this is JUST csv processing preview, we must not prevent import from here if there is something in the file!!
+//       this was intended for validation of csv formatting and encoding, not filtering the data!!!!
+//       we definitely must not process the whole file!
+
+// preview table data
+$data = array();
 $cir->init();
-$availableauths = get_plugin_list('auth');
-$availableauths = array_keys($availableauths);
-$contents = array();
-while ($fields = $cir->next()) {
-    $errormsg = array();
+$linenum = 1; //column header is first line
+while ($linenum <= $previewrows and $fields = $cir->next()) {
+    $linenum++;
     $rowcols = array();
-    foreach($fields as $key =>$field) {
-        $rowcols[$columns[$key]] = $field;
+    $rowcols['line'] = $linenum;
+    foreach($fields as $key => $field) {
+        $rowcols[$filecolumns[$key]] = s($field);
     }
+    $rowcols['status'] = array();
 
-    $usernameexist = $DB->record_exists('user', array('username'=>$rowcols['username']));
-    $emailexist    = $DB->record_exists('user', array('email'=>$rowcols['email']));
-    $cleanusername = clean_param($rowcols['username'], PARAM_USERNAME);
-    $validusername = strcmp($rowcols['username'], $cleanusername);
-    $validemail = validate_email($rowcols['email']);
-
-    if ($validusername != 0 || !$validemail) {
-        if ($validusername != 0) {
-            $errormsg['username'] = get_string('invalidusernameupload');
+    if (isset($rowcols['username'])) {
+        $stdusername = clean_param($rowcols['username'], PARAM_USERNAME);
+        if ($rowcols['username'] !== $stdusername) {
+            $rowcols['status'][] = get_string('invalidusernameupload');
         }
-        if (!$validemail) {
-            $errormsg['email'] = get_string('invalidemail');
+        if ($userid = $DB->get_field('user', 'id', array('username'=>$stdusername, 'mnethostid'=>$CFG->mnet_localhost_id))) {
+            $rowcols['username'] = html_writer::link(new moodle_url('/user/profile.php', array('id'=>$userid)), $rowcols['username']);
         }
+    } else {
+        $rowcols['status'][] = get_string('missingusername');
     }
 
-    //check password column
-    if (array_key_exists('auth', $rowcols)) {
-        if (isset($rowcols['auth']) && empty($rowcols['auth'])) {
-                $rowcols['auth'] = 'manual';
-        }
-        $rowauth = get_auth_plugin($rowcols['auth']);
-        $rowisinternalauth = $rowauth->is_internal();
-        if (!$rowisinternalauth) {
-            if (array_key_exists('password', $rowcols) && !empty($rowcols['password'])) {
-                $errormsg['password'] = get_string('externalauthpassworderror', 'error');
-            }
-        }
-
-        if (!in_array($rowcols['auth'], $availableauths)) {
-            $errormsg['auth'] = get_string('userautherror', 'error');
-        }
-    }
-
-    if (empty($optype) ) {
-        $optype = $uploadtype;
-    }
-
-    switch($optype) {
-        case UU_ADDNEW:
-            if ($usernameexist || $emailexist ) {
-               $rowcols['action'] = 'skipped';
-            } else {
-                $rowcols['action'] = 'create';
-            }
-            break;
-
-        case UU_ADDINC:
-            if (!$usernameexist && !$emailexist) {
-                $rowcols['action'] = 'create';
-            } else if ($usernameexist && !$emailexist) {
-                $rowcols['action'] = 'addcountertousername';
-                $rowcols['username'] = increment_username($rowcols['username'], $CFG->mnet_localhost_id);
-            } else {
-                $rowcols['action'] = 'skipped';
-            }
-            break;
-
-        case UU_ADD_UPDATE:
-            $oldusernameexist = '';
-            if (isset($rowcols['oldusername'])) {
-                $oldusernameexist = $DB->record_exists('user', array('username'=>$rowcols['oldusername']));
-            }
-            if ($usernameexist || $emailexist || $oldusernameexist ) {
-                $rowcols['action'] = 'update';
-            } else {
-                $rowcols['action'] = 'create';
-            }
-            break;
-
-        case UU_UPDATE:
-             $oldusernameexist = '';
-            if (isset($rowcols['oldusername'])) {
-                $oldusernameexist = $DB->record_exists('user', array('username'=>$rowcols['oldusername']));
-            }
-
-            if ($usernameexist || $emailexist || !empty($oldusernameexist)) {
-                $rowcols['action'] = 'update';
-            } else {
-                $rowcols['action'] = "skipped";
-            }
-            break;
-    }
-
-    if (!empty($errormsg)){
-        $rowcols['error'] = array();
-        $rowcols['error'] = $errormsg;
+    if (!validate_email($rowcols['email'])) {
+        $rowcols['status'][] = get_string('invalidemail');
     }
-    if ($rowcols['action'] != 'skipped') {
-        $contents[] = $rowcols;
+    if ($DB->record_exists('user', array('email'=>$rowcols['email']))) {
+        $rowcols['status'][] = $stremailduplicate;
     }
+    $rowcols['status'] = implode('<br />', $rowcols['status']);
+    $data[] = $rowcols;
 }
-$cir->close();
-
-//get heading
-$headings = array();
-foreach ($contents as $content) {
-    foreach($content as $key => $value) {
-        if (!in_array($key, $headings)) {
-            $headings[] = $key;
-        }
-    }
+if ($fields = $cir->next()) {
+    $data[] = array_fill(0, count($fields) + 2, '...');
 }
+$cir->close();
 
 $table = new html_table();
 $table->id = "uupreview";
@@ -953,327 +918,19 @@ $table->attributes['class'] = 'generaltable';
 $table->tablealign = 'center';
 $table->summary = get_string('uploaduserspreview', 'admin');
 $table->head = array();
-$table->data = array();
+$table->data = $data;
 
-//print heading
-foreach ($headings as $heading) {
-    $table->head[] = s($heading);
+$table->head[] = get_string('uucsvline', 'admin');
+foreach ($filecolumns as $column) {
+    $table->head[] = $column;
 }
+$table->head[] = get_string('status');
 
-$haserror = false;
-$countcontent = 0;
-if (in_array('error', $headings)) {
-    //print error
-    $haserror = true;
-
-    foreach ($contents as $content) {
-        if (array_key_exists('error', $content)) {
-            $rows = new html_table_row();
-            foreach ($content as $key => $value) {
-                $cells = new html_table_cell();
-                $errclass = '';
-                if (array_key_exists($key, $content['error'])) {
-                    $errclass = 'uuerror';
-                }
-                if ($key == 'error') {
-                    $value = join('<br />', $content['error']);
-                }
-                if ($key == 'action') {
-                    $value = get_string($content[$key]);
-                }
-                $cells->text = $value;
-                $cells->attributes['class'] = $errclass;
-                $rows->cells[] = $cells;
-            }
-            $countcontent++;
-            $table->data[] = $rows;
-        }
-    }
-    $mform = new admin_uploaduser_form3();
-    $mform->set_data(array('uutype'=>$uploadtype));
-} else if (empty($contents)) {
-    $mform = new admin_uploaduser_form3();
-    $mform->set_data(array('uutype'=>$uploadtype));
-} else {
-    //print content
-    foreach ($contents as $content) {
-        $rows = new html_table_row();
-        if ($countcontent >= $previewrows) {
-            foreach ($content as $con) {
-                $cells = new html_table_cell();
-                $cells->text = '...';
-            }
-            $rows->cells[] = $cells;
-            $table->data[] = $rows;
-            break;
-        }
-        foreach ($headings as $heading) {
-            $cells = new html_table_cell();
-            if(array_key_exists($heading, $content)) {
-                if ($heading == 'action') {
-                    $content[$heading] = get_string($content[$heading]);
-                }
-                $cells->text = $content[$heading];
-            } else {
-                $cells->text = '';
-            }
-            $rows->cells[] = $cells;
-        }
-        $table->data[] = $rows;
-        $countcontent++;
-    }
-}
 echo html_writer::tag('div', html_writer::table($table), array('class'=>'flexible-wrap'));
 
-if ($haserror) {
-    echo $OUTPUT->container(get_string('useruploadtype', 'moodle', $choices[$uploadtype]), 'centerpara');
-    echo $OUTPUT->container(get_string('uploadinvalidpreprocessedcount', 'moodle', $countcontent), 'centerpara');
-    echo $OUTPUT->container(get_string('invalidusername', 'moodle'), 'centerpara');
-    echo $OUTPUT->container(get_string('uploadfilecontainerror', 'moodle'), 'centerpara');
-} else if (empty($contents)) {
-    echo $OUTPUT->container(get_string('uupreprocessedcount', 'admin', $countcontent), 'centerpara');
-    echo $OUTPUT->container(get_string('uploadfilecontentsnovaliddata'), 'centerpara');
-} else {
-    echo $OUTPUT->container(get_string('uupreprocessedcount', 'admin', $countcontent), 'centerpara');
-}
+/// Print the form
 
-$mform->display();
+$mform2->display();
 echo $OUTPUT->footer();
 die;
 
-/////////////////////////////////////
-/// Utility functions and classes ///
-/////////////////////////////////////
-
-class uu_progress_tracker {
-    var $_row;
-    var $columns = array('status', 'line', 'id', 'username', 'firstname', 'lastname', 'email', 'password', 'auth', 'enrolments', 'deleted');
-
-    function uu_progress_tracker() {
-    }
-
-    function init() {
-        $ci = 0;
-        echo '<table id="uuresults" class="generaltable boxaligncenter flexible-wrap" summary="'.get_string('uploadusersresult', 'admin').'">';
-        echo '<tr class="heading r0">';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('status').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('uucsvline', 'admin').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">ID</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('username').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('firstname').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('lastname').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('email').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('password').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('authentication').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('enrolments', 'enrol').'</th>';
-        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('delete').'</th>';
-        echo '</tr>';
-        $this->_row = null;
-    }
-
-    function flush() {
-        if (empty($this->_row) or empty($this->_row['line']['normal'])) {
-            $this->_row = array();
-            foreach ($this->columns as $col) {
-                $this->_row[$col] = array('normal'=>'', 'info'=>'', 'warning'=>'', 'error'=>'');
-            }
-            return;
-        }
-        $ci = 0;
-        $ri = 1;
-        echo '<tr class="r'.$ri.'">';
-        foreach ($this->_row as $key=>$field) {
-            foreach ($field as $type=>$content) {
-                if ($field[$type] !== '') {
-                    if ($key == 'username' && $type == 'normal') {
-                        $field[$type] = clean_param($field[$type], PARAM_USERNAME);
-                    }
-                    $field[$type] = '<span class="uu'.$type.'">'.$field[$type].'</span>';
-                } else {
-                    unset($field[$type]);
-                }
-            }
-            echo '<td class="cell c'.$ci++.'">';
-            if (!empty($field)) {
-                echo implode('<br />', $field);
-            } else {
-                echo '&nbsp;';
-            }
-            echo '</td>';
-        }
-        echo '</tr>';
-        foreach ($this->columns as $col) {
-            $this->_row[$col] = array('normal'=>'', 'info'=>'', 'warning'=>'', 'error'=>'');
-        }
-    }
-
-    function track($col, $msg, $level='normal', $merge=true) {
-        if (empty($this->_row)) {
-            $this->flush(); //init arrays
-        }
-        if (!in_array($col, $this->columns)) {
-            debugging('Incorrect column:'.$col);
-            return;
-        }
-        if ($merge) {
-            if ($this->_row[$col][$level] != '') {
-                $this->_row[$col][$level] .='<br />';
-            }
-            $this->_row[$col][$level] .= s($msg);
-        } else {
-            $this->_row[$col][$level] = s($msg);
-        }
-    }
-
-    function close() {
-        echo '</table>';
-    }
-}
-
-/**
- * Validation callback function - verified the column line of csv file.
- * Converts column names to lowercase too.
- */
-function validate_user_upload_columns(&$columns) {
-    global $STD_FIELDS, $PRF_FIELDS;
-
-    if (count($columns) < 2) {
-        return get_string('csvfewcolumns', 'error');
-    }
-
-    // test columns
-    $processed = array();
-    foreach ($columns as $key=>$unused) {
-        $columns[$key] = strtolower($columns[$key]); // no unicode expected here, ignore case
-        $field = $columns[$key];
-        if (!in_array($field, $STD_FIELDS) && !in_array($field, $PRF_FIELDS) &&// if not a standard field and not an enrolment field, then we have an error
-            !preg_match('/^course\d+$/', $field) && !preg_match('/^group\d+$/', $field) &&
-            !preg_match('/^type\d+$/', $field) && !preg_match('/^role\d+$/', $field) &&
-            !preg_match('/^enrolperiod\d+$/', $field)) {
-            return get_string('invalidfieldname', 'error', $field);
-        }
-        if (in_array($field, $processed)) {
-            return get_string('csvcolumnduplicates', 'error');
-        }
-        $processed[] = $field;
-    }
-    return true;
-}
-
-/**
- * Increments username - increments trailing number or adds it if not present.
- * Varifies that the new username does not exist yet
- * @param string $username
- * @return incremented username which does not exist yet
- */
-function increment_username($username, $mnethostid) {
-    global $DB;
-
-    if (!preg_match_all('/(.*?)([0-9]+)$/', $username, $matches)) {
-        $username = $username.'2';
-    } else {
-        $username = $matches[1][0].($matches[2][0]+1);
-    }
-
-    if ($DB->record_exists('user', array('username'=>$username, 'mnethostid'=>$mnethostid))) {
-        return increment_username($username, $mnethostid);
-    } else {
-        return $username;
-    }
-}
-
-/**
- * Check if default field contains templates and apply them.
- * @param string template - potential tempalte string
- * @param object user object- we need username, firstname and lastname
- * @return string field value
- */
-function process_template($template, $user) {
-    if (strpos($template, '%') === false) {
-        return $template;
-    }
-
-    // very very ugly hack!
-    global $template_globals;
-    $template_globals = new stdClass();
-    $template_globals->username  = isset($user->username)  ? $user->username  : '';
-    $template_globals->firstname = isset($user->firstname) ? $user->firstname : '';
-    $template_globals->lastname  = isset($user->lastname)  ? $user->lastname  : '';
-
-    $result = preg_replace_callback('/(?<!%)%([+-~])?(\d)*([flu])/', 'process_template_callback', $template);
-
-    $template_globals = null;
-
-    if (is_null($result)) {
-        return $template; //error during regex processing??
-    } else {
-        return $result;
-    }
-}
-
-/**
- * Internal callback function.
- */
-function process_template_callback($block) {
-    global $template_globals;
-    $textlib = textlib_get_instance();
-    $repl = $block[0];
-
-    switch ($block[3]) {
-        case 'u': $repl = $template_globals->username; break;
-        case 'f': $repl = $template_globals->firstname; break;
-        case 'l': $repl = $template_globals->lastname; break;
-    }
-    switch ($block[1]) {
-        case '+': $repl = $textlib->strtoupper($repl); break;
-        case '-': $repl = $textlib->strtolower($repl); break;
-        case '~': $repl = $textlib->strtotitle($repl); break;
-    }
-    if (!empty($block[2])) {
-        $repl = $textlib->substr($repl, 0 , $block[2]);
-    }
-
-    return $repl;
-}
-
-/**
- * Returns list of auth plugins that are enabled and known to work.
- */
-function uu_allowed_auths() {
-    global $CFG;
-
-    // only following plugins are guaranteed to work properly
-    // TODO: add support for more plugins in 2.0
-    $whitelist = array('manual', 'nologin', 'none', 'email');
-    $plugins = get_enabled_auth_plugins();
-    $choices = array();
-    foreach ($plugins as $plugin) {
-        $choices[$plugin] = get_string('pluginname', "auth_{$plugin}");
-    }
-
-    return $choices;
-}
-
-/**
- * Returns list of roles that are assignable in courses
- */
-function uu_allowed_roles() {
-    // let's cheat a bit, frontpage is guaranteed to exist and has the same list of roles ;-)
-    $roles = get_assignable_roles(get_context_instance(CONTEXT_COURSE, SITEID), ROLENAME_ORIGINALANDSHORT);
-    return array_reverse($roles, true);
-}
-
-function uu_allowed_roles_cache() {
-    $allowedroles = get_assignable_roles(get_context_instance(CONTEXT_COURSE, SITEID), ROLENAME_SHORT);
-    foreach ($allowedroles as $rid=>$rname) {
-        $rolecache[$rid] = new stdClass();
-        $rolecache[$rid]->id   = $rid;
-        $rolecache[$rid]->name = $rname;
-        if (!is_numeric($rname)) { // only non-numeric shortnames are supported!!!
-            $rolecache[$rname] = new stdClass();
-            $rolecache[$rname]->id   = $rid;
-            $rolecache[$rname]->name = $rname;
-        }
-    }
-    return $rolecache;
-}
index 956ecdb..fe53116 100644 (file)
@@ -1,16 +1,44 @@
 <?php
-
-if (!defined('MOODLE_INTERNAL')) {
-    die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
-}
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Bulk user upload forms
+ *
+ * @package    core
+ * @subpackage admin
+ * @copyright  2007 Dan Poltawski
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
 
 require_once $CFG->libdir.'/formslib.php';
 
-class admin_uploaduser_form1 extends moodleform {
-    function definition (){
-        global $CFG, $USER;
 
-        $mform =& $this->_form;
+/**
+ * Upload a file CVS file with user information.
+ *
+ * @package    core
+ * @subpackage admin
+ * @copyright  2007 Petr Skoda  {@link http://skodak.org}
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class admin_uploaduser_form1 extends moodleform {
+    function definition () {
+        $mform = $this->_form;
 
         $mform->addElement('header', 'settingsheader', get_string('upload'));
 
@@ -36,69 +64,90 @@ class admin_uploaduser_form1 extends moodleform {
         $mform->addElement('select', 'previewrows', get_string('rowpreviewnum', 'admin'), $choices);
         $mform->setType('previewrows', PARAM_INT);
 
-        $choices = array(UU_ADDNEW    => get_string('uuoptype_addnew', 'admin'),
-                         UU_ADDINC    => get_string('uuoptype_addinc', 'admin'),
-                         UU_ADD_UPDATE => get_string('uuoptype_addupdate', 'admin'),
-                         UU_UPDATE     => get_string('uuoptype_update', 'admin'));
-        $mform->addElement('select', 'uutype', get_string('uuoptype', 'admin'), $choices);
-
         $this->add_action_buttons(false, get_string('uploadusers', 'admin'));
     }
 }
 
+
+/**
+ * Specify user upload details
+ *
+ * @package    core
+ * @subpackage admin
+ * @copyright  2007 Petr Skoda  {@link http://skodak.org}
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 class admin_uploaduser_form2 extends moodleform {
-    function definition (){
+    function definition () {
         global $CFG, $USER;
 
-        $mform   =& $this->_form;
-        $columns =& $this->_customdata;
+        $mform   = $this->_form;
+        $columns = $this->_customdata['columns'];
+        $data    = $this->_customdata['data'];
 
         // I am the template user, why should it be the administrator? we have roles now, other ppl may use this script ;-)
         $templateuser = $USER;
 
         // upload settings and file
         $mform->addElement('header', 'settingsheader', get_string('settings'));
-        $mform->addElement('static', 'uutypelabel', get_string('uuoptype', 'admin') );
+
+        $choices = array(UU_USER_ADDNEW     => get_string('uuoptype_addnew', 'admin'),
+                         UU_USER_ADDINC     => get_string('uuoptype_addinc', 'admin'),
+                         UU_USER_ADD_UPDATE => get_string('uuoptype_addupdate', 'admin'),
+                         UU_USER_UPDATE     => get_string('uuoptype_update', 'admin'));
+        $mform->addElement('select', 'uutype', get_string('uuoptype', 'admin'), $choices);
 
         $choices = array(0 => get_string('infilefield', 'auth'), 1 => get_string('createpasswordifneeded', 'auth'));
         $mform->addElement('select', 'uupasswordnew', get_string('uupasswordnew', 'admin'), $choices);
         $mform->setDefault('uupasswordnew', 1);
-        $mform->disabledIf('uupasswordnew', 'uutype', 'eq', UU_UPDATE);
+        $mform->disabledIf('uupasswordnew', 'uutype', 'eq', UU_USER_UPDATE);
 
-        $choices = array(0 => get_string('nochanges', 'admin'),
-                         1 => get_string('uuupdatefromfile', 'admin'),
-                         2 => get_string('uuupdateall', 'admin'),
-                         3 => get_string('uuupdatemissing', 'admin'));
+        $choices = array(UU_UPDATE_NOCHANGES    => get_string('nochanges', 'admin'),
+                         UU_UPDATE_FILEOVERRIDE => get_string('uuupdatefromfile', 'admin'),
+                         UU_UPDATE_ALLOVERRIDE  => get_string('uuupdateall', 'admin'),
+                         UU_UPDATE_MISSING      => get_string('uuupdatemissing', 'admin'));
         $mform->addElement('select', 'uuupdatetype', get_string('uuupdatetype', 'admin'), $choices);
-        $mform->setDefault('uuupdatetype', 0);
-        $mform->disabledIf('uuupdatetype', 'uutype', 'eq', UU_ADDNEW);
-        $mform->disabledIf('uuupdatetype', 'uutype', 'eq', UU_ADDINC);
+        $mform->setDefault('uuupdatetype', UU_UPDATE_NOCHANGES);
+        $mform->disabledIf('uuupdatetype', 'uutype', 'eq', UU_USER_ADDNEW);
+        $mform->disabledIf('uuupdatetype', 'uutype', 'eq', UU_USER_ADDINC);
 
         $choices = array(0 => get_string('nochanges', 'admin'), 1 => get_string('update'));
         $mform->addElement('select', 'uupasswordold', get_string('uupasswordold', 'admin'), $choices);
         $mform->setDefault('uupasswordold', 0);
-        $mform->disabledIf('uupasswordold', 'uutype', 'eq', UU_ADDNEW);
-        $mform->disabledIf('uupasswordold', 'uutype', 'eq', UU_ADDINC);
+        $mform->disabledIf('uupasswordold', 'uutype', 'eq', UU_USER_ADDNEW);
+        $mform->disabledIf('uupasswordold', 'uutype', 'eq', UU_USER_ADDINC);
         $mform->disabledIf('uupasswordold', 'uuupdatetype', 'eq', 0);
         $mform->disabledIf('uupasswordold', 'uuupdatetype', 'eq', 3);
 
+        $choices = array(UU_PWRESET_WEAK => get_string('usersweakpassword', 'admin'),
+                         UU_PWRESET_NONE => get_string('none'),
+                         UU_PWRESET_ALL  => get_string('all'));
+        if (empty($CFG->passwordpolicy)) {
+            unset($choices[UU_PWRESET_WEAK]);
+        }
+        $mform->addElement('select', 'uuforcepasswordchange', get_string('forcepasswordchange', 'core'), $choices);
+
+
         $mform->addElement('selectyesno', 'uuallowrenames', get_string('allowrenames', 'admin'));
         $mform->setDefault('uuallowrenames', 0);
-        $mform->disabledIf('uuallowrenames', 'uutype', 'eq', UU_ADDNEW);
-        $mform->disabledIf('uuallowrenames', 'uutype', 'eq', UU_ADDINC);
+        $mform->disabledIf('uuallowrenames', 'uutype', 'eq', UU_USER_ADDNEW);
+        $mform->disabledIf('uuallowrenames', 'uutype', 'eq', UU_USER_ADDINC);
 
         $mform->addElement('selectyesno', 'uuallowdeletes', get_string('allowdeletes', 'admin'));
         $mform->setDefault('uuallowdeletes', 0);
-        $mform->disabledIf('uuallowdeletes', 'uutype', 'eq', UU_ADDNEW);
-        $mform->disabledIf('uuallowdeletes', 'uutype', 'eq', UU_ADDINC);
+        $mform->disabledIf('uuallowdeletes', 'uutype', 'eq', UU_USER_ADDNEW);
+        $mform->disabledIf('uuallowdeletes', 'uutype', 'eq', UU_USER_ADDINC);
 
         $mform->addElement('selectyesno', 'uunoemailduplicates', get_string('uunoemailduplicates', 'admin'));
         $mform->setDefault('uunoemailduplicates', 1);
 
-        $choices = array(0 => get_string('no'),
-                         1 => get_string('uubulknew', 'admin'),
-                         2 => get_string('uubulkupdated', 'admin'),
-                         3 => get_string('uubulkall', 'admin'));
+        $mform->addElement('selectyesno', 'uustandardusernames', get_string('uustandardusernames', 'admin'));
+        $mform->setDefault('uustandardusernames', 1);
+
+        $choices = array(UU_BULK_NONE    => get_string('no'),
+                         UU_BULK_NEW     => get_string('uubulknew', 'admin'),
+                         UU_BULK_UPDATED => get_string('uubulkupdated', 'admin'),
+                         UU_BULK_ALL     => get_string('uubulkall', 'admin'));
         $mform->addElement('select', 'uubulk', get_string('uubulk', 'admin'), $choices);
         $mform->setDefault('uubulk', 0);
 
@@ -152,18 +201,22 @@ class admin_uploaduser_form2 extends moodleform {
         // default values
         $mform->addElement('header', 'defaultheader', get_string('defaultvalues', 'admin'));
 
-        $mform->addElement('text', 'username', get_string('username'), 'size="20"');
+        $mform->addElement('text', 'username', get_string('uuusernametemplate', 'admin'), 'size="20"');
         $mform->addRule('username', get_string('requiredtemplate', 'admin'), 'required', null, 'client');
+        $mform->disabledIf('username', 'uutype', 'eq', UU_USER_ADD_UPDATE);
+        $mform->disabledIf('username', 'uutype', 'eq', UU_USER_UPDATE);
+
+        $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"');
+        $mform->disabledIf('email', 'uutype', 'eq', UU_USER_ADD_UPDATE);
+        $mform->disabledIf('email', 'uutype', 'eq', UU_USER_UPDATE);
 
         // only enabled and known to work plugins
-        $choices = uu_allowed_auths();
+        $choices = uu_supported_auths();
         $mform->addElement('select', 'auth', get_string('chooseauthmethod','auth'), $choices);
         $mform->setDefault('auth', 'manual'); // manual is a sensible backwards compatible default
         $mform->addHelpButton('auth', 'chooseauthmethod', 'auth');
         $mform->setAdvanced('auth');
 
-        $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"');
-
         $choices = array(0 => get_string('emaildisplayno'), 1 => get_string('emaildisplayyes'), 2 => get_string('emaildisplaycourse'));
         $mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
         $mform->setDefault('maildisplay', 2);
@@ -272,27 +325,30 @@ class admin_uploaduser_form2 extends moodleform {
         $mform->addElement('hidden', 'previewrows');
         $mform->setType('previewrows', PARAM_INT);
 
-        $mform->addElement('hidden', 'readcount');
-        $mform->setType('readcount', PARAM_INT);
-
-        $mform->addElement('hidden', 'uutype');
-        $mform->setType('uutype', PARAM_INT);
-
         $this->add_action_buttons(true, get_string('uploadusers', 'admin'));
+
+        $this->set_data($data);
     }
 
     /**
      * Form tweaks that depend on current data.
      */
     function definition_after_data() {
-        $mform   =& $this->_form;
-        $columns =& $this->_customdata;
+        $mform   = $this->_form;
+        $columns = $this->_customdata['columns'];
 
         foreach ($columns as $column) {
             if ($mform->elementExists($column)) {
                 $mform->removeElement($column);
             }
         }
+
+        if (!in_array('password', $columns)) {
+            // password resetting makes sense only if password specified in csv file
+            if ($mform->elementExists('uuforcepasswordchange')) {
+                $mform->removeElement('uuforcepasswordchange');
+            }
+        }
     }
 
     /**
@@ -300,19 +356,19 @@ class admin_uploaduser_form2 extends moodleform {
      */
     function validation($data, $files) {
         $errors = parent::validation($data, $files);
-        $columns =& $this->_customdata;
+        $columns = $this->_customdata['columns'];
         $optype  = $data['uutype'];
 
         // detect if password column needed in file
         if (!in_array('password', $columns)) {
             switch ($optype) {
-                case UU_UPDATE:
+                case UU_USER_UPDATE:
                     if (!empty($data['uupasswordold'])) {
                         $errors['uupasswordold'] = get_string('missingfield', 'error', 'password');
                     }
                     break;
 
-                case UU_ADD_UPDATE:
+                case UU_USER_ADD_UPDATE:
                     if (empty($data['uupasswordnew'])) {
                         $errors['uupasswordnew'] = get_string('missingfield', 'error', 'password');
                     }
@@ -321,12 +377,12 @@ class admin_uploaduser_form2 extends moodleform {
                     }
                     break;
 
-                case UU_ADDNEW:
+                case UU_USER_ADDNEW:
                     if (empty($data['uupasswordnew'])) {
                         $errors['uupasswordnew'] = get_string('missingfield', 'error', 'password');
                     }
                     break;
-                case UU_ADDINC:
+                case UU_USER_ADDINC:
                     if (empty($data['uupasswordnew'])) {
                         $errors['uupasswordnew'] = get_string('missingfield', 'error', 'password');
                     }
@@ -335,7 +391,7 @@ class admin_uploaduser_form2 extends moodleform {
         }
 
         // look for other required data
-        if ($optype != UU_UPDATE) {
+        if ($optype != UU_USER_UPDATE) {
             if (!in_array('firstname', $columns)) {
                 $errors['uutype'] = get_string('missingfield', 'error', 'firstname');
             }
@@ -369,7 +425,7 @@ class admin_uploaduser_form2 extends moodleform {
     function get_data() {
         $data = parent::get_data();
 
-        if ($data !== null) {
+        if ($data !== null and isset($data->description)) {
             $data->descriptionformat = $data->description['format'];
             $data->description = $data->description['text'];
         }
@@ -377,11 +433,3 @@ class admin_uploaduser_form2 extends moodleform {
         return $data;
     }
 }
-
-class admin_uploaduser_form3 extends moodleform {
-    function definition (){
-        global $CFG, $USER;
-        $mform =& $this->_form;
-        $this->add_action_buttons(false, get_string('uploadnewfile'));
-    }
-}
diff --git a/admin/uploaduserlib.php b/admin/uploaduserlib.php
new file mode 100644 (file)
index 0000000..7df9290
--- /dev/null
@@ -0,0 +1,335 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Bulk user registration functions
+ *
+ * @package    core
+ * @subpackage admin
+ * @copyright  2004 onwards Martin Dougiamas (http://dougiamas.com)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+define('UU_USER_ADDNEW', 0);
+define('UU_USER_ADDINC', 1);
+define('UU_USER_ADD_UPDATE', 2);
+define('UU_USER_UPDATE', 3);
+
+define('UU_UPDATE_NOCHANGES', 0);
+define('UU_UPDATE_FILEOVERRIDE', 1);
+define('UU_UPDATE_ALLOVERRIDE', 2);
+define('UU_UPDATE_MISSING', 3);
+
+define('UU_BULK_NONE', 0);
+define('UU_BULK_NEW', 1);
+define('UU_BULK_UPDATED', 2);
+define('UU_BULK_ALL', 3);
+
+define('UU_PWRESET_NONE', 0);
+define('UU_PWRESET_WEAK', 1);
+define('UU_PWRESET_ALL', 2);
+
+/**
+ * Tracking of processed users.
+ *
+ * This class prints user information into a html table.
+ *
+ * @package    core
+ * @subpackage admin
+ * @copyright  2007 Petr Skoda  {@link http://skodak.org}
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class uu_progress_tracker {
+    private $_row;
+    public $columns = array('status', 'line', 'id', 'username', 'firstname', 'lastname', 'email', 'password', 'auth', 'enrolments', 'deleted');
+
+    /**
+     * Print table header.
+     * @return void
+     */
+    public function start() {
+        $ci = 0;
+        echo '<table id="uuresults" class="generaltable boxaligncenter flexible-wrap" summary="'.get_string('uploadusersresult', 'admin').'">';
+        echo '<tr class="heading r0">';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('status').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('uucsvline', 'admin').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">ID</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('username').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('firstname').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('lastname').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('email').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('password').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('authentication').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('enrolments', 'enrol').'</th>';
+        echo '<th class="header c'.$ci++.'" scope="col">'.get_string('delete').'</th>';
+        echo '</tr>';
+        $this->_row = null;
+    }
+
+    /**
+     * Flush previous line and start a new one.
+     * @return void
+     */
+    public function flush() {
+        if (empty($this->_row) or empty($this->_row['line']['normal'])) {
+            // Nothing to print - each line has to have at least number
+            $this->_row = array();
+            foreach ($this->columns as $col) {
+                $this->_row[$col] = array('normal'=>'', 'info'=>'', 'warning'=>'', 'error'=>'');
+            }
+            return;
+        }
+        $ci = 0;
+        $ri = 1;
+        echo '<tr class="r'.$ri.'">';
+        foreach ($this->_row as $key=>$field) {
+            foreach ($field as $type=>$content) {
+                if ($field[$type] !== '') {
+                    $field[$type] = '<span class="uu'.$type.'">'.$field[$type].'</span>';
+                } else {
+                    unset($field[$type]);
+                }
+            }
+            echo '<td class="cell c'.$ci++.'">';
+            if (!empty($field)) {
+                echo implode('<br />', $field);
+            } else {
+                echo '&nbsp;';
+            }
+            echo '</td>';
+        }
+        echo '</tr>';
+        foreach ($this->columns as $col) {
+            $this->_row[$col] = array('normal'=>'', 'info'=>'', 'warning'=>'', 'error'=>'');
+        }
+    }
+
+    /**
+     * Add tracking info
+     * @param string $col name of column
+     * @param string $msg message
+     * @param string $level 'normal', 'warning' or 'error'
+     * @param bool $merge true means add as new line, false means override all previous text of the same type
+     * @return void
+     */
+    public function track($col, $msg, $level = 'normal', $merge = true) {
+        if (empty($this->_row)) {
+            $this->flush(); //init arrays
+        }
+        if (!in_array($col, $this->columns)) {
+            debugging('Incorrect column:'.$col);
+            return;
+        }
+        if ($merge) {
+            if ($this->_row[$col][$level] != '') {
+                $this->_row[$col][$level] .='<br />';
+            }
+            $this->_row[$col][$level] .= $msg;
+        } else {
+            $this->_row[$col][$level] = $msg;
+        }
+    }
+
+    /**
+     * Print the table end
+     * @return void
+     */
+    public function close() {
+        $this->flush();
+        echo '</table>';
+    }
+}
+
+/**
+ * Validation callback function - verified the column line of csv file.
+ * Converts column names to lowercase too.
+ * @param csv_import_reader $cir
+ * @param array standard user fields
+ * @param array custom profile fields
+ * @param moodle_url $returnurl return url in case of any error
+ * @return array list of fields
+ */
+function uu_validate_user_upload_columns(csv_import_reader $cir, $stdfields, $frofilefields, moodle_url $returnurl) {
+    $columns = $cir->get_columns();
+
+    if (empty($columns)) {
+        $cir->close();
+        $cir->cleanup();
+        print_error('cannotreadtmpfile', 'error', $returnurl);
+    }
+    if (count($columns) < 2) {
+        $cir->close();
+        $cir->cleanup();
+        print_error('csvfewcolumns', 'error', $returnurl);
+    }
+
+    // test columns
+    $processed = array();
+    foreach ($columns as $key=>$unused) {
+        $field = strtolower($columns[$key]); // no unicode expected here, ignore case
+        if (!in_array($field, $stdfields) && !in_array($field, $frofilefields) &&// if not a standard field and not an enrolment field, then we have an error
+            !preg_match('/^course\d+$/', $field) && !preg_match('/^group\d+$/', $field) &&
+            !preg_match('/^type\d+$/', $field) && !preg_match('/^role\d+$/', $field) &&
+            !preg_match('/^enrolperiod\d+$/', $field)) {
+            print_error('invalidfieldname', 'error', $returnurl, $field);
+        }
+        if (in_array($field, $processed)) {
+            $cir->close();
+            $cir->cleanup();
+            print_error('duplicatefieldname', 'error', $returnurl, $field);
+        }
+        $processed[$key] = $field;
+    }
+
+    return $processed;
+}
+
+/**
+ * Increments username - increments trailing number or adds it if not present.
+ * Varifies that the new username does not exist yet
+ * @param string $username
+ * @return incremented username which does not exist yet
+ */
+function uu_increment_username($username) {
+    global $DB, $CFG;
+
+    if (!preg_match_all('/(.*?)([0-9]+)$/', $username, $matches)) {
+        $username = $username.'2';
+    } else {
+        $username = $matches[1][0].($matches[2][0]+1);
+    }
+
+    if ($DB->record_exists('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
+        return uu_increment_username($username);
+    } else {
+        return $username;
+    }
+}
+
+/**
+ * Check if default field contains templates and apply them.
+ * @param string template - potential tempalte string
+ * @param object user object- we need username, firstname and lastname
+ * @return string field value
+ */
+function uu_process_template($template, $user) {
+    if (is_array($template)) {
+        // hack for for support of text editors with format
+        $t = $template['text'];
+    } else {
+        $t = $template;
+    }
+    if (strpos($t, '%') === false) {
+        return $template;
+    }
+
+    $username  = isset($user->username)  ? $user->username  : '';
+    $firstname = isset($user->firstname) ? $user->firstname : '';
+    $lastname  = isset($user->lastname)  ? $user->lastname  : '';
+
+    $callback = partial('uu_process_template_callback', $username, $firstname, $lastname);
+
+    $result = preg_replace_callback('/(?<!%)%([+-~])?(\d)*([flu])/', $callback, $t);
+
+    if (is_null($result)) {
+        return $template; //error during regex processing??
+    } else {
+        if (array($template)) {
+            $template['text'] = $t;
+            return $t;
+        } else {
+            return $t;
+        }
+    }
+}
+
+/**
+ * Internal callback function.
+ */
+function uu_process_template_callback($block, $username, $firstname, $lastname) {
+    $textlib = textlib_get_instance();
+    $repl = $block[0];
+
+    switch ($block[3]) {
+        case 'u': $repl = $username; break;
+        case 'f': $repl = $firstname; break;
+        case 'l': $repl = $lastname; break;
+    }
+    switch ($block[1]) {
+        case '+': $repl = $textlib->strtoupper($repl); break;
+        case '-': $repl = $textlib->strtolower($repl); break;
+        case '~': $repl = $textlib->strtotitle($repl); break;
+    }
+    if (!empty($block[2])) {
+        $repl = $textlib->substr($repl, 0 , $block[2]);
+    }
+
+    return $repl;
+}
+
+/**
+ * Returns list of auth plugins that are enabled and known to work.
+ *
+ * If ppl want to use some other auth type they have to include it
+ * in the CSV file next on each line.
+ *
+ * @return array type=>name
+ */
+function uu_supported_auths() {
+    // only following plugins are guaranteed to work properly
+    $whitelist = array('manual', 'nologin', 'none', 'email');
+    $plugins = get_enabled_auth_plugins();
+    $choices = array();
+    foreach ($plugins as $plugin) {
+        if (!in_array($plugin, $whitelist)) {
+            continue;
+        }
+        $choices[$plugin] = get_string('pluginname', "auth_{$plugin}");
+    }
+
+    return $choices;
+}
+
+/**
+ * Returns list of roles that are assignable in courses
+ * @return array
+ */
+function uu_allowed_roles() {
+    // let's cheat a bit, frontpage is guaranteed to exist and has the same list of roles ;-)
+    $roles = get_assignable_roles(get_context_instance(CONTEXT_COURSE, SITEID), ROLENAME_ORIGINALANDSHORT);
+    return array_reverse($roles, true);
+}
+
+/**
+ * Returns mapping of all roles using short role name as index.
+ * @return array
+ */
+function uu_allowed_roles_cache() {
+    $allowedroles = get_assignable_roles(get_context_instance(CONTEXT_COURSE, SITEID), ROLENAME_SHORT);
+    foreach ($allowedroles as $rid=>$rname) {
+        $rolecache[$rid] = new stdClass();
+        $rolecache[$rid]->id   = $rid;
+        $rolecache[$rid]->name = $rname;
+        if (!is_numeric($rname)) { // only non-numeric shortnames are supported!!!
+            $rolecache[$rname] = new stdClass();
+            $rolecache[$rname]->id   = $rid;
+            $rolecache[$rname]->name = $rname;
+        }
+    }
+    return $rolecache;
+}
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/auth/manual/db/upgrade.php b/auth/manual/db/upgrade.php
new file mode 100644 (file)
index 0000000..dcfe7bd
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Manual authentication plugin upgrade code
+ *
+ * @package    auth
+ * @subpackage manual
+ * @copyright  2011 Petr Skoda (http://skodak.org)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+/**
+ * @param int $oldversion the version we are upgrading from
+ * @return bool result
+ */
+function xmldb_auth_manual_upgrade($oldversion) {
+    global $CFG, $DB, $OUTPUT;
+
+    if ($oldversion < 2011022700) {
+        // force creation of missing passwords
+        $createpassword = hash_internal_user_password('');
+        $rs = $DB->get_recordset('user', array('password'=>$createpassword, 'auth'=>'manual'));
+        foreach ($rs as $user) {
+            if (validate_email($user->email)) {
+                $DB->set_field('user', 'password', 'to be created', array('id'=>$user->id));
+                unset_user_preference('auth_forcepasswordchange', $user);
+                set_user_preference('create_password', 1, $user);
+            }
+        }
+        $rs->close();
+        upgrade_plugin_savepoint(true, 2011022700, 'auth', 'manual');
+    }
+
+    return true;
+}
diff --git a/auth/manual/version.php b/auth/manual/version.php
new file mode 100644 (file)
index 0000000..a8edb8e
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Manual authentication plugin version information
+ *
+ * @package    auth
+ * @subpackage manual
+ * @copyright  2011 Petr Skoda (http://skodak.org)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->version   = 2011022700;
+$plugin->component = 'auth_manual';
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 89c8654..4c9e876 100644 (file)
@@ -35,6 +35,7 @@ require_once($CFG->dirroot . '/backup/moodle2/backup_xml_transformer.class.php')
 require_once($CFG->dirroot . '/backup/moodle2/backup_plugin.class.php');
 require_once($CFG->dirroot . '/backup/moodle2/backup_qtype_plugin.class.php');
 require_once($CFG->dirroot . '/backup/moodle2/backup_format_plugin.class.php');
+require_once($CFG->dirroot . '/backup/moodle2/backup_theme_plugin.class.php');
 require_once($CFG->dirroot . '/backup/moodle2/backup_subplugin.class.php');
 require_once($CFG->dirroot . '/backup/moodle2/backup_settingslib.php');
 require_once($CFG->dirroot . '/backup/moodle2/backup_stepslib.php');