Merge branch 'MDL-51536-master' of git://github.com/damyon/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 12 Oct 2015 10:47:45 +0000 (11:47 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 12 Oct 2015 10:47:45 +0000 (11:47 +0100)
795 files changed:
admin/auth_config.php
admin/cli/install.php
admin/index.php
admin/renderer.php
admin/settings/courses.php
admin/settings/plugins.php
admin/tool/generator/cli/maketestcourse.php
auth/cas/auth.php
auth/cas/config.html
auth/cas/lang/en/auth_cas.php
auth/radius/config.html
availability/tests/info_test.php
backup/moodle2/tests/moodle2_course_format_test.php
backup/upgrade.txt
backup/util/helper/backup_cron_helper.class.php
backup/util/helper/tests/cronhelper_test.php
badges/backpack_form.php
badges/backpackconnect.php
badges/criteria/award_criteria_profile.php
badges/tests/badgeslib_test.php
blocks/html/block_html.php
blocks/tags/tests/behat/tagcloud.feature
cohort/lib.php
completion/classes/external.php
composer.json
composer.lock
config-dist.php
course/edit_form.php
course/editsection.php
course/editsection_form.php
course/externallib.php
course/format/lib.php
course/format/renderer.php
course/format/topics/format.js
course/format/topics/lang/en/format_topics.php
course/format/topics/lib.php
course/format/topics/renderer.php
course/format/topics/styles.css
course/format/topics/tests/behat/edit_delete_sections.feature
course/format/topics/tests/format_topics_test.php
course/format/upgrade.txt
course/format/weeks/format.js
course/format/weeks/lang/en/format_weeks.php
course/format/weeks/lib.php
course/format/weeks/styles.css
course/format/weeks/tests/behat/edit_delete_sections.feature
course/format/weeks/tests/format_weeks_test.php
course/lib.php
course/tests/behat/behat_course.php
course/tests/courselib_test.php
course/tests/externallib_test.php
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop-debug.js
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop-min.js
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-min.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js
course/yui/src/dragdrop/js/section.js
course/yui/src/toolboxes/js/section.js
enrol/cohort/edit.php
enrol/guest/lib.php
enrol/locallib.php
enrol/manual/edit.php
enrol/manual/locallib.php
enrol/meta/classes/observer.php
enrol/meta/db/events.php
enrol/meta/tests/plugin_test.php
enrol/meta/version.php
enrol/otherusers.php
enrol/paypal/edit.php
enrol/self/edit.php
enrol/self/lang/en/enrol_self.php
enrol/self/lib.php
enrol/tests/behat/filter_enrolled_users.feature [new file with mode: 0644]
enrol/tests/enrollib_test.php
enrol/upgrade.txt
enrol/users.php
files/renderer.php
grade/import/direct/index.php
grade/lib.php
grade/report/user/externallib.php
group/externallib.php
index.php
install/lang/en/admin.php
install/lang/es_mx/admin.php
install/lang/fr/admin.php
install/lang/hu/admin.php
install/lang/ja/admin.php
install/lang/no/install.php
install/lang/sk/install.php
install/stringnames.txt
lang/en/admin.php
lang/en/backup.php
lang/en/enrol.php
lang/en/message.php
lang/en/moodle.php
lang/en/plugin.php
lib/accesslib.php
lib/adminlib.php
lib/amd/build/localstorage.min.js
lib/amd/build/loglevel.min.js
lib/amd/src/localstorage.js
lib/amd/src/loglevel.js
lib/badgeslib.php
lib/classes/event/enrol_instance_created.php [new file with mode: 0644]
lib/classes/event/enrol_instance_deleted.php [new file with mode: 0644]
lib/classes/event/enrol_instance_updated.php [new file with mode: 0644]
lib/classes/event/manager.php
lib/classes/event/message_deleted.php [new file with mode: 0644]
lib/classes/plugin_manager.php
lib/classes/task/send_failed_login_notifications_task.php
lib/classes/user.php
lib/coursecatlib.php
lib/db/caches.php
lib/db/install.xml
lib/db/services.php
lib/db/upgrade.php
lib/dml/mssql_native_moodle_database.php
lib/dml/sqlsrv_native_moodle_database.php
lib/editor/atto/plugins/backcolor/yui/build/moodle-atto_backcolor-button/moodle-atto_backcolor-button-debug.js
lib/editor/atto/plugins/backcolor/yui/build/moodle-atto_backcolor-button/moodle-atto_backcolor-button-min.js
lib/editor/atto/plugins/backcolor/yui/build/moodle-atto_backcolor-button/moodle-atto_backcolor-button.js
lib/editor/atto/plugins/backcolor/yui/src/button/js/button.js
lib/editor/atto/plugins/fontcolor/yui/build/moodle-atto_fontcolor-button/moodle-atto_fontcolor-button-debug.js
lib/editor/atto/plugins/fontcolor/yui/build/moodle-atto_fontcolor-button/moodle-atto_fontcolor-button-min.js
lib/editor/atto/plugins/fontcolor/yui/build/moodle-atto_fontcolor-button/moodle-atto_fontcolor-button.js
lib/editor/atto/plugins/fontcolor/yui/src/button/js/button.js
lib/editor/atto/plugins/noautolink/yui/build/moodle-atto_noautolink-button/moodle-atto_noautolink-button-debug.js
lib/editor/atto/plugins/noautolink/yui/build/moodle-atto_noautolink-button/moodle-atto_noautolink-button-min.js
lib/editor/atto/plugins/noautolink/yui/build/moodle-atto_noautolink-button/moodle-atto_noautolink-button.js
lib/editor/atto/plugins/noautolink/yui/src/button/js/button.js
lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-debug.js
lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js
lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button.js
lib/editor/atto/plugins/rtl/yui/src/button/js/button.js
lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-debug.js
lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-min.js
lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button.js
lib/editor/atto/plugins/subscript/yui/src/button/js/button.js
lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-debug.js
lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-min.js
lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button.js
lib/editor/atto/plugins/superscript/yui/src/button/js/button.js
lib/editor/atto/readme_moodle.txt
lib/editor/atto/thirdpartylibs.xml
lib/editor/atto/upgrade.txt
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js
lib/editor/atto/yui/build/moodle-editor_atto-rangy/moodle-editor_atto-rangy-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-rangy/moodle-editor_atto-rangy-min.js
lib/editor/atto/yui/build/moodle-editor_atto-rangy/moodle-editor_atto-rangy.js
lib/editor/atto/yui/src/editor/js/commands.js
lib/editor/atto/yui/src/editor/js/editor-plugin-buttons.js
lib/editor/atto/yui/src/editor/js/styling.js
lib/editor/atto/yui/src/rangy/build.json
lib/editor/atto/yui/src/rangy/js/rangy-classapplier.js [new file with mode: 0644]
lib/editor/atto/yui/src/rangy/js/rangy-core.js
lib/editor/atto/yui/src/rangy/js/rangy-cssclassapplier.js [deleted file]
lib/editor/atto/yui/src/rangy/js/rangy-highlighter.js [new file with mode: 0644]
lib/editor/atto/yui/src/rangy/js/rangy-selectionsaverestore.js
lib/editor/atto/yui/src/rangy/js/rangy-serializer.js
lib/editor/atto/yui/src/rangy/js/rangy-textrange.js [new file with mode: 0644]
lib/enrollib.php
lib/google/README.md
lib/google/autoload.php
lib/google/lib.php
lib/google/readme_moodle.txt
lib/google/src/Google/Auth/Abstract.php
lib/google/src/Google/Auth/AppIdentity.php
lib/google/src/Google/Auth/AssertionCredentials.php
lib/google/src/Google/Auth/ComputeEngine.php [new file with mode: 0644]
lib/google/src/Google/Auth/Exception.php
lib/google/src/Google/Auth/LoginTicket.php
lib/google/src/Google/Auth/OAuth2.php
lib/google/src/Google/Auth/Simple.php
lib/google/src/Google/Cache/Apc.php
lib/google/src/Google/Cache/Exception.php
lib/google/src/Google/Cache/File.php
lib/google/src/Google/Cache/Memcache.php
lib/google/src/Google/Cache/Null.php
lib/google/src/Google/Client.php
lib/google/src/Google/Collection.php
lib/google/src/Google/Config.php
lib/google/src/Google/Http/Batch.php
lib/google/src/Google/Http/CacheParser.php
lib/google/src/Google/Http/MediaFileUpload.php
lib/google/src/Google/Http/REST.php
lib/google/src/Google/Http/Request.php
lib/google/src/Google/IO/Abstract.php
lib/google/src/Google/IO/Curl.php
lib/google/src/Google/IO/Exception.php
lib/google/src/Google/IO/Stream.php
lib/google/src/Google/Logger/Abstract.php
lib/google/src/Google/Logger/Exception.php
lib/google/src/Google/Logger/File.php
lib/google/src/Google/Logger/Null.php
lib/google/src/Google/Logger/Psr.php
lib/google/src/Google/Model.php
lib/google/src/Google/Service.php
lib/google/src/Google/Service/AdExchangeBuyer.php
lib/google/src/Google/Service/AdExchangeSeller.php
lib/google/src/Google/Service/AdSense.php
lib/google/src/Google/Service/AdSenseHost.php
lib/google/src/Google/Service/Admin.php
lib/google/src/Google/Service/Analytics.php
lib/google/src/Google/Service/AndroidEnterprise.php [new file with mode: 0644]
lib/google/src/Google/Service/AndroidPublisher.php
lib/google/src/Google/Service/AppState.php
lib/google/src/Google/Service/Appsactivity.php
lib/google/src/Google/Service/Autoscaler.php
lib/google/src/Google/Service/Bigquery.php
lib/google/src/Google/Service/Blogger.php
lib/google/src/Google/Service/Books.php
lib/google/src/Google/Service/Calendar.php
lib/google/src/Google/Service/CivicInfo.php
lib/google/src/Google/Service/Classroom.php [new file with mode: 0644]
lib/google/src/Google/Service/CloudMonitoring.php
lib/google/src/Google/Service/CloudUserAccounts.php [new file with mode: 0644]
lib/google/src/Google/Service/Cloudlatencytest.php [new file with mode: 0644]
lib/google/src/Google/Service/Cloudresourcemanager.php [new file with mode: 0644]
lib/google/src/Google/Service/Cloudsearch.php [new file with mode: 0644]
lib/google/src/Google/Service/Compute.php
lib/google/src/Google/Service/Computeaccounts.php [new file with mode: 0644]
lib/google/src/Google/Service/Container.php
lib/google/src/Google/Service/Coordinate.php
lib/google/src/Google/Service/Customsearch.php
lib/google/src/Google/Service/Dataflow.php [new file with mode: 0644]
lib/google/src/Google/Service/Datastore.php
lib/google/src/Google/Service/DeploymentManager.php [new file with mode: 0644]
lib/google/src/Google/Service/Dfareporting.php
lib/google/src/Google/Service/Directory.php
lib/google/src/Google/Service/Dns.php
lib/google/src/Google/Service/DoubleClickBidManager.php
lib/google/src/Google/Service/Doubleclicksearch.php
lib/google/src/Google/Service/Drive.php
lib/google/src/Google/Service/Exception.php
lib/google/src/Google/Service/Fitness.php
lib/google/src/Google/Service/Freebase.php
lib/google/src/Google/Service/Fusiontables.php
lib/google/src/Google/Service/Games.php
lib/google/src/Google/Service/GamesConfiguration.php [new file with mode: 0644]
lib/google/src/Google/Service/GamesManagement.php
lib/google/src/Google/Service/Genomics.php
lib/google/src/Google/Service/Gmail.php
lib/google/src/Google/Service/GroupsMigration.php
lib/google/src/Google/Service/Groupssettings.php
lib/google/src/Google/Service/IdentityToolkit.php
lib/google/src/Google/Service/Licensing.php
lib/google/src/Google/Service/Logging.php [new file with mode: 0644]
lib/google/src/Google/Service/Manager.php
lib/google/src/Google/Service/MapsEngine.php
lib/google/src/Google/Service/Mirror.php
lib/google/src/Google/Service/Oauth2.php
lib/google/src/Google/Service/Pagespeedonline.php
lib/google/src/Google/Service/Playmoviespartner.php [new file with mode: 0644]
lib/google/src/Google/Service/Plus.php
lib/google/src/Google/Service/PlusDomains.php
lib/google/src/Google/Service/Prediction.php
lib/google/src/Google/Service/Pubsub.php
lib/google/src/Google/Service/QPXExpress.php
lib/google/src/Google/Service/Replicapool.php
lib/google/src/Google/Service/Replicapoolupdater.php
lib/google/src/Google/Service/Reports.php
lib/google/src/Google/Service/Reseller.php
lib/google/src/Google/Service/Resource.php
lib/google/src/Google/Service/Resourceviews.php
lib/google/src/Google/Service/SQLAdmin.php
lib/google/src/Google/Service/Script.php [new file with mode: 0644]
lib/google/src/Google/Service/ShoppingContent.php
lib/google/src/Google/Service/SiteVerification.php
lib/google/src/Google/Service/Spectrum.php
lib/google/src/Google/Service/Storage.php
lib/google/src/Google/Service/TagManager.php
lib/google/src/Google/Service/Taskqueue.php
lib/google/src/Google/Service/Tasks.php
lib/google/src/Google/Service/Translate.php
lib/google/src/Google/Service/Urlshortener.php
lib/google/src/Google/Service/Webfonts.php
lib/google/src/Google/Service/Webmasters.php
lib/google/src/Google/Service/YouTube.php
lib/google/src/Google/Service/YouTubeAnalytics.php
lib/google/src/Google/Signer/P12.php
lib/google/src/Google/Task/Exception.php [new file with mode: 0644]
lib/google/src/Google/Task/Retryable.php [new file with mode: 0644]
lib/google/src/Google/Task/Runner.php [new file with mode: 0644]
lib/google/src/Google/Utils.php
lib/google/src/Google/Utils/URITemplate.php
lib/google/src/Google/Verifier/Pem.php
lib/google/src/Google/autoload.php [new file with mode: 0644]
lib/grade/grade_category.php
lib/grade/grade_item.php
lib/horde/locale/pt_BR/LC_MESSAGES/Horde_Mime.mo
lib/horde/locale/pt_BR/LC_MESSAGES/Horde_Mime.po
lib/horde/readme_moodle.txt
lib/html2text.php [deleted file]
lib/html2text/Html2Text.php [new file with mode: 0644]
lib/html2text/lib.php [new file with mode: 0644]
lib/html2text/readme_moodle.txt [new file with mode: 0644]
lib/html2text_readme.txt [deleted file]
lib/htmlpurifier/HTMLPurifier.php
lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/Multiple.php
lib/htmlpurifier/HTMLPurifier/AttrDef/HTML/Bool.php
lib/htmlpurifier/HTMLPurifier/CSSDefinition.php
lib/htmlpurifier/HTMLPurifier/Config.php
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema.ser
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt [new file with mode: 0644]
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php
lib/htmlpurifier/HTMLPurifier/Filter/YouTube.php
lib/htmlpurifier/HTMLPurifier/Injector/RemoveEmpty.php
lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php
lib/htmlpurifier/HTMLPurifier/Lexer/PH5P.php
lib/htmlpurifier/LICENSE [new file with mode: 0644]
lib/htmlpurifier/readme_moodle.txt
lib/installlib.php
lib/javascript-static.js
lib/jquery/jquery-1.11.2.min.js [deleted file]
lib/jquery/jquery-1.11.3.js [moved from lib/jquery/jquery-1.11.2.js with 99% similarity]
lib/jquery/jquery-1.11.3.min.js [new file with mode: 0644]
lib/jquery/plugins.php
lib/lessphp/Cache.php
lib/lessphp/Exception/Parser.php
lib/lessphp/Functions.php
lib/lessphp/LICENSE [new file with mode: 0644]
lib/lessphp/Parser.php
lib/lessphp/SourceMap/Generator.php
lib/lessphp/Tree/Import.php
lib/lessphp/Version.php
lib/lessphp/moodle_readme.txt
lib/minify/lib/CSSmin.php
lib/minify/lib/Minify.php
lib/minify/lib/Minify/CSS/UriRewriter.php
lib/minify/lib/Minify/CSSmin.php [new file with mode: 0644]
lib/minify/lib/Minify/Cache/File.php
lib/minify/lib/Minify/Cache/WinCache.php [new file with mode: 0644]
lib/minify/lib/Minify/ClosureCompiler.php
lib/minify/lib/Minify/Controller/MinApp.php
lib/minify/lib/Minify/HTML.php
lib/minify/lib/Minify/JS/ClosureCompiler.php
lib/minify/lib/Minify/YUICompressor.php
lib/moodlelib.php
lib/outputcomponents.php
lib/outputrenderers.php
lib/outputrequirementslib.php
lib/pear/Auth/RADIUS.php
lib/pear/README.txt
lib/pear/README_MOODLE.txt
lib/phpexcel/PHPExcel.php
lib/phpexcel/PHPExcel/Autoloader.php
lib/phpexcel/PHPExcel/CachedObjectStorage/APC.php
lib/phpexcel/PHPExcel/CachedObjectStorage/CacheBase.php
lib/phpexcel/PHPExcel/CachedObjectStorage/DiscISAM.php
lib/phpexcel/PHPExcel/CachedObjectStorage/ICache.php
lib/phpexcel/PHPExcel/CachedObjectStorage/Igbinary.php
lib/phpexcel/PHPExcel/CachedObjectStorage/Memcache.php
lib/phpexcel/PHPExcel/CachedObjectStorage/Memory.php
lib/phpexcel/PHPExcel/CachedObjectStorage/MemoryGZip.php
lib/phpexcel/PHPExcel/CachedObjectStorage/MemorySerialized.php
lib/phpexcel/PHPExcel/CachedObjectStorage/PHPTemp.php
lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite.php
lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite3.php
lib/phpexcel/PHPExcel/CachedObjectStorage/Wincache.php
lib/phpexcel/PHPExcel/CachedObjectStorageFactory.php
lib/phpexcel/PHPExcel/CalcEngine/CyclicReferenceStack.php
lib/phpexcel/PHPExcel/CalcEngine/Logger.php
lib/phpexcel/PHPExcel/Calculation.php
lib/phpexcel/PHPExcel/Calculation/Database.php
lib/phpexcel/PHPExcel/Calculation/DateTime.php
lib/phpexcel/PHPExcel/Calculation/Engineering.php
lib/phpexcel/PHPExcel/Calculation/Exception.php
lib/phpexcel/PHPExcel/Calculation/ExceptionHandler.php
lib/phpexcel/PHPExcel/Calculation/Financial.php
lib/phpexcel/PHPExcel/Calculation/FormulaParser.php
lib/phpexcel/PHPExcel/Calculation/FormulaToken.php
lib/phpexcel/PHPExcel/Calculation/Function.php
lib/phpexcel/PHPExcel/Calculation/Functions.php
lib/phpexcel/PHPExcel/Calculation/Logical.php
lib/phpexcel/PHPExcel/Calculation/LookupRef.php
lib/phpexcel/PHPExcel/Calculation/MathTrig.php
lib/phpexcel/PHPExcel/Calculation/Statistical.php
lib/phpexcel/PHPExcel/Calculation/TextData.php
lib/phpexcel/PHPExcel/Calculation/Token/Stack.php
lib/phpexcel/PHPExcel/Cell.php
lib/phpexcel/PHPExcel/Cell/AdvancedValueBinder.php
lib/phpexcel/PHPExcel/Cell/DataType.php
lib/phpexcel/PHPExcel/Cell/DataValidation.php
lib/phpexcel/PHPExcel/Cell/DefaultValueBinder.php
lib/phpexcel/PHPExcel/Cell/Hyperlink.php
lib/phpexcel/PHPExcel/Cell/IValueBinder.php
lib/phpexcel/PHPExcel/Chart.php
lib/phpexcel/PHPExcel/Chart/Axis.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Chart/DataSeries.php
lib/phpexcel/PHPExcel/Chart/DataSeriesValues.php
lib/phpexcel/PHPExcel/Chart/Exception.php
lib/phpexcel/PHPExcel/Chart/GridLines.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Chart/Layout.php
lib/phpexcel/PHPExcel/Chart/Legend.php
lib/phpexcel/PHPExcel/Chart/PlotArea.php
lib/phpexcel/PHPExcel/Chart/Properties.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Chart/Renderer/jpgraph.php
lib/phpexcel/PHPExcel/Chart/Title.php
lib/phpexcel/PHPExcel/Comment.php
lib/phpexcel/PHPExcel/DocumentProperties.php
lib/phpexcel/PHPExcel/DocumentSecurity.php
lib/phpexcel/PHPExcel/Exception.php
lib/phpexcel/PHPExcel/HashTable.php
lib/phpexcel/PHPExcel/Helper/HTML.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/IComparable.php
lib/phpexcel/PHPExcel/IOFactory.php
lib/phpexcel/PHPExcel/NamedRange.php
lib/phpexcel/PHPExcel/Reader/Abstract.php
lib/phpexcel/PHPExcel/Reader/CSV.php
lib/phpexcel/PHPExcel/Reader/DefaultReadFilter.php
lib/phpexcel/PHPExcel/Reader/Excel2003XML.php
lib/phpexcel/PHPExcel/Reader/Excel2007.php
lib/phpexcel/PHPExcel/Reader/Excel2007/Chart.php
lib/phpexcel/PHPExcel/Reader/Excel2007/Theme.php
lib/phpexcel/PHPExcel/Reader/Excel5.php
lib/phpexcel/PHPExcel/Reader/Excel5/Escher.php
lib/phpexcel/PHPExcel/Reader/Excel5/MD5.php
lib/phpexcel/PHPExcel/Reader/Excel5/RC4.php
lib/phpexcel/PHPExcel/Reader/Exception.php
lib/phpexcel/PHPExcel/Reader/Gnumeric.php
lib/phpexcel/PHPExcel/Reader/HTML.php
lib/phpexcel/PHPExcel/Reader/IReadFilter.php
lib/phpexcel/PHPExcel/Reader/IReader.php
lib/phpexcel/PHPExcel/Reader/OOCalc.php
lib/phpexcel/PHPExcel/Reader/SYLK.php
lib/phpexcel/PHPExcel/ReferenceHelper.php
lib/phpexcel/PHPExcel/RichText.php
lib/phpexcel/PHPExcel/RichText/ITextElement.php
lib/phpexcel/PHPExcel/RichText/Run.php
lib/phpexcel/PHPExcel/RichText/TextElement.php
lib/phpexcel/PHPExcel/Settings.php
lib/phpexcel/PHPExcel/Shared/CodePage.php
lib/phpexcel/PHPExcel/Shared/Date.php
lib/phpexcel/PHPExcel/Shared/Drawing.php
lib/phpexcel/PHPExcel/Shared/Escher.php
lib/phpexcel/PHPExcel/Shared/Escher/DgContainer.php
lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php
lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
lib/phpexcel/PHPExcel/Shared/Escher/DggContainer.php
lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php
lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php
lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
lib/phpexcel/PHPExcel/Shared/File.php
lib/phpexcel/PHPExcel/Shared/Font.php
lib/phpexcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php
lib/phpexcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php
lib/phpexcel/PHPExcel/Shared/JAMA/LUDecomposition.php
lib/phpexcel/PHPExcel/Shared/JAMA/Matrix.php
lib/phpexcel/PHPExcel/Shared/JAMA/QRDecomposition.php
lib/phpexcel/PHPExcel/Shared/JAMA/SingularValueDecomposition.php
lib/phpexcel/PHPExcel/Shared/JAMA/utils/Error.php
lib/phpexcel/PHPExcel/Shared/JAMA/utils/Maths.php
lib/phpexcel/PHPExcel/Shared/OLE/ChainedBlockStream.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Shared/OLE/PPS.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Shared/OLE/PPS/File.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Shared/OLE/PPS/Root.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Shared/PCLZip/pclzip.lib.php
lib/phpexcel/PHPExcel/Shared/PasswordHasher.php
lib/phpexcel/PHPExcel/Shared/String.php
lib/phpexcel/PHPExcel/Shared/TimeZone.php
lib/phpexcel/PHPExcel/Shared/XMLWriter.php
lib/phpexcel/PHPExcel/Shared/ZipArchive.php
lib/phpexcel/PHPExcel/Shared/ZipStreamWrapper.php
lib/phpexcel/PHPExcel/Shared/trend/bestFitClass.php
lib/phpexcel/PHPExcel/Shared/trend/exponentialBestFitClass.php
lib/phpexcel/PHPExcel/Shared/trend/linearBestFitClass.php
lib/phpexcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php
lib/phpexcel/PHPExcel/Shared/trend/polynomialBestFitClass.php
lib/phpexcel/PHPExcel/Shared/trend/powerBestFitClass.php
lib/phpexcel/PHPExcel/Shared/trend/trendClass.php
lib/phpexcel/PHPExcel/Style.php
lib/phpexcel/PHPExcel/Style/Alignment.php
lib/phpexcel/PHPExcel/Style/Border.php
lib/phpexcel/PHPExcel/Style/Borders.php
lib/phpexcel/PHPExcel/Style/Color.php
lib/phpexcel/PHPExcel/Style/Conditional.php
lib/phpexcel/PHPExcel/Style/Fill.php
lib/phpexcel/PHPExcel/Style/Font.php
lib/phpexcel/PHPExcel/Style/NumberFormat.php
lib/phpexcel/PHPExcel/Style/Protection.php
lib/phpexcel/PHPExcel/Style/Supervisor.php
lib/phpexcel/PHPExcel/Worksheet.php
lib/phpexcel/PHPExcel/Worksheet/AutoFilter.php
lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column.php
lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
lib/phpexcel/PHPExcel/Worksheet/BaseDrawing.php
lib/phpexcel/PHPExcel/Worksheet/CellIterator.php
lib/phpexcel/PHPExcel/Worksheet/Column.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Worksheet/ColumnCellIterator.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Worksheet/ColumnDimension.php
lib/phpexcel/PHPExcel/Worksheet/ColumnIterator.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Worksheet/Dimension.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Worksheet/Drawing.php
lib/phpexcel/PHPExcel/Worksheet/Drawing/Shadow.php
lib/phpexcel/PHPExcel/Worksheet/HeaderFooter.php
lib/phpexcel/PHPExcel/Worksheet/HeaderFooterDrawing.php
lib/phpexcel/PHPExcel/Worksheet/MemoryDrawing.php
lib/phpexcel/PHPExcel/Worksheet/PageMargins.php
lib/phpexcel/PHPExcel/Worksheet/PageSetup.php
lib/phpexcel/PHPExcel/Worksheet/Protection.php
lib/phpexcel/PHPExcel/Worksheet/Row.php
lib/phpexcel/PHPExcel/Worksheet/RowCellIterator.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Worksheet/RowDimension.php
lib/phpexcel/PHPExcel/Worksheet/RowIterator.php
lib/phpexcel/PHPExcel/Worksheet/SheetView.php
lib/phpexcel/PHPExcel/WorksheetIterator.php
lib/phpexcel/PHPExcel/Writer/Abstract.php
lib/phpexcel/PHPExcel/Writer/CSV.php
lib/phpexcel/PHPExcel/Writer/Excel2007.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Chart.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Comments.php
lib/phpexcel/PHPExcel/Writer/Excel2007/ContentTypes.php
lib/phpexcel/PHPExcel/Writer/Excel2007/DocProps.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Drawing.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php
lib/phpexcel/PHPExcel/Writer/Excel2007/RelsRibbon.php
lib/phpexcel/PHPExcel/Writer/Excel2007/RelsVBA.php
lib/phpexcel/PHPExcel/Writer/Excel2007/StringTable.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Theme.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Workbook.php
lib/phpexcel/PHPExcel/Writer/Excel2007/Worksheet.php
lib/phpexcel/PHPExcel/Writer/Excel2007/WriterPart.php
lib/phpexcel/PHPExcel/Writer/Exception.php
lib/phpexcel/PHPExcel/Writer/HTML.php
lib/phpexcel/PHPExcel/Writer/IWriter.php
lib/phpexcel/PHPExcel/Writer/OpenDocument.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/Content.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/Meta.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/MetaInf.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/Mimetype.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/Settings.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/Styles.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/Thumbnails.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/OpenDocument/WriterPart.php [new file with mode: 0644]
lib/phpexcel/PHPExcel/Writer/PDF.php
lib/phpexcel/PHPExcel/Writer/PDF/Core.php
lib/phpexcel/PHPExcel/Writer/PDF/DomPDF.php
lib/phpexcel/PHPExcel/Writer/PDF/mPDF.php
lib/phpexcel/PHPExcel/Writer/PDF/tcPDF.php
lib/phpexcel/readme_moodle.txt
lib/phpmailer/README.md
lib/phpmailer/README_MOODLE.txt
lib/phpmailer/VERSION [new file with mode: 0644]
lib/phpmailer/changelog.md
lib/phpmailer/class.phpmailer.php
lib/phpmailer/class.smtp.php
lib/phpmailer/language/phpmailer.lang-am.php [new file with mode: 0644]
lib/phpmailer/language/phpmailer.lang-ar.php
lib/phpmailer/language/phpmailer.lang-az.php [new file with mode: 0644]
lib/phpmailer/language/phpmailer.lang-be.php
lib/phpmailer/language/phpmailer.lang-bg.php [new file with mode: 0644]
lib/phpmailer/language/phpmailer.lang-br.php
lib/phpmailer/language/phpmailer.lang-ca.php
lib/phpmailer/language/phpmailer.lang-ch.php
lib/phpmailer/language/phpmailer.lang-cz.php
lib/phpmailer/language/phpmailer.lang-de.php
lib/phpmailer/language/phpmailer.lang-dk.php
lib/phpmailer/language/phpmailer.lang-el.php
lib/phpmailer/language/phpmailer.lang-eo.php
lib/phpmailer/language/phpmailer.lang-es.php
lib/phpmailer/language/phpmailer.lang-et.php
lib/phpmailer/language/phpmailer.lang-fa.php
lib/phpmailer/language/phpmailer.lang-fi.php
lib/phpmailer/language/phpmailer.lang-fo.php
lib/phpmailer/language/phpmailer.lang-fr.php
lib/phpmailer/language/phpmailer.lang-gl.php
lib/phpmailer/language/phpmailer.lang-hr.php
lib/phpmailer/language/phpmailer.lang-hu.php
lib/phpmailer/language/phpmailer.lang-id.php [new file with mode: 0644]
lib/phpmailer/language/phpmailer.lang-it.php
lib/phpmailer/language/phpmailer.lang-ja.php
lib/phpmailer/language/phpmailer.lang-ka.php
lib/phpmailer/language/phpmailer.lang-ko.php [new file with mode: 0644]
lib/phpmailer/language/phpmailer.lang-lt.php
lib/phpmailer/language/phpmailer.lang-lv.php
lib/phpmailer/language/phpmailer.lang-ms.php [new file with mode: 0644]
lib/phpmailer/language/phpmailer.lang-nl.php
lib/phpmailer/language/phpmailer.lang-no.php
lib/phpmailer/language/phpmailer.lang-pl.php
lib/phpmailer/language/phpmailer.lang-pt.php
lib/phpmailer/language/phpmailer.lang-ro.php
lib/phpmailer/language/phpmailer.lang-ru.php
lib/phpmailer/language/phpmailer.lang-se.php
lib/phpmailer/language/phpmailer.lang-sk.php
lib/phpmailer/language/phpmailer.lang-sl.php [new file with mode: 0644]
lib/phpmailer/language/phpmailer.lang-sr.php
lib/phpmailer/language/phpmailer.lang-tr.php
lib/phpmailer/language/phpmailer.lang-uk.php
lib/phpmailer/language/phpmailer.lang-vi.php
lib/phpmailer/language/phpmailer.lang-zh.php
lib/phpmailer/language/phpmailer.lang-zh_cn.php
lib/phpunit/classes/advanced_testcase.php
lib/phpunit/classes/database_driver_testcase.php
lib/phpunit/classes/util.php
lib/phpunit/tests/advanced_test.php
lib/requirejs/moodle-config.js
lib/requirejs/readme_moodle.txt [new file with mode: 0644]
lib/requirejs/require.js
lib/requirejs/require.min.js
lib/tablelib.php
lib/tcpdf/CHANGELOG.TXT
lib/tcpdf/README.TXT
lib/tcpdf/composer.json
lib/tcpdf/fonts/freefont-20120503/ChangeLog
lib/tcpdf/fonts/freemono.php
lib/tcpdf/fonts/freemonob.php
lib/tcpdf/fonts/freemonobi.php
lib/tcpdf/fonts/freemonoi.php
lib/tcpdf/fonts/freesans.php
lib/tcpdf/fonts/freesansb.php
lib/tcpdf/fonts/freesansbi.php
lib/tcpdf/fonts/freesansi.php
lib/tcpdf/fonts/freeserif.php
lib/tcpdf/fonts/freeserifb.php
lib/tcpdf/fonts/freeserifbi.php
lib/tcpdf/fonts/freeserifi.php
lib/tcpdf/include/barcodes/qrcode.php
lib/tcpdf/include/sRGB.icc
lib/tcpdf/include/tcpdf_fonts.php
lib/tcpdf/include/tcpdf_images.php
lib/tcpdf/include/tcpdf_static.php
lib/tcpdf/readme_moodle.txt
lib/tcpdf/tcpdf.php
lib/tcpdf/tcpdf_parser.php
lib/testing/generator/data_generator.php
lib/testing/tests/generator_test.php
lib/tests/coursecatlib_test.php
lib/tests/event_test.php
lib/tests/fixtures/messageinbound/ios.test
lib/tests/fixtures/messageinbound/outlook.test
lib/tests/html2text_test.php
lib/tests/messagelib_test.php
lib/tests/user_test.php
lib/tests/weblib_test.php
lib/thirdpartylibs.xml
lib/upgrade.txt
lib/upgradelib.php
lib/weblib.php
lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js
lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-min.js
lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js
lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-debug.js
lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-min.js
lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js
lib/yui/src/formchangechecker/js/formchangechecker.js
lib/yui/src/lockscroll/js/lockscroll.js
lib/yui/src/notification/js/dialogue.js
message/externallib.php
message/lib.php
message/tests/events_test.php
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-min.js
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger.js
message/yui/src/messenger/js/sendmessage.js
mod/assign/lang/en/assign.php
mod/assign/lib.php
mod/assign/locallib.php
mod/assign/renderable.php
mod/assign/renderer.php
mod/assign/tests/behat/submit_without_group.feature
mod/assign/tests/lib_test.php
mod/assign/upgrade.txt
mod/book/classes/external.php
mod/book/upgrade.txt
mod/chat/classes/external.php
mod/choice/classes/external.php
mod/choice/db/services.php
mod/choice/lang/en/deprecated.txt [new file with mode: 0644]
mod/choice/lib.php
mod/choice/renderer.php
mod/choice/tests/externallib_test.php
mod/choice/upgrade.txt
mod/choice/version.php
mod/data/field/file/field.class.php
mod/data/field/picture/field.class.php
mod/forum/classes/output/email/renderer.php [new file with mode: 0644]
mod/forum/classes/output/email/renderer_textemail.php [new file with mode: 0644]
mod/forum/classes/output/emaildigestbasic/renderer.php [new file with mode: 0644]
mod/forum/classes/output/emaildigestbasic/renderer_textemail.php [new file with mode: 0644]
mod/forum/classes/output/emaildigestfull/renderer.php [new file with mode: 0644]
mod/forum/classes/output/emaildigestfull/renderer_textemail.php [new file with mode: 0644]
mod/forum/classes/output/forum_post.php [new file with mode: 0644]
mod/forum/classes/output/forum_post_email.php [new file with mode: 0644]
mod/forum/deprecatedlib.php
mod/forum/discuss.php
mod/forum/externallib.php
mod/forum/lang/en/forum.php
mod/forum/lib.php
mod/forum/renderer.php
mod/forum/styles.css
mod/forum/templates/forum_post_email_htmlemail.mustache [new file with mode: 0644]
mod/forum/templates/forum_post_email_textemail.mustache [new file with mode: 0644]
mod/forum/templates/forum_post_emaildigestbasic_htmlemail.mustache [new file with mode: 0644]
mod/forum/templates/forum_post_emaildigestbasic_textemail.mustache [new file with mode: 0644]
mod/forum/templates/forum_post_emaildigestfull_htmlemail.mustache [new file with mode: 0644]
mod/forum/templates/forum_post_emaildigestfull_textemail.mustache [new file with mode: 0644]
mod/forum/tests/behat/discussion_navigation.feature
mod/forum/tests/behat/posts_ordering_blog.feature [new file with mode: 0644]
mod/forum/tests/behat/posts_ordering_general.feature [new file with mode: 0644]
mod/forum/tests/behat/timed_discussions.feature [new file with mode: 0644]
mod/forum/tests/externallib_test.php
mod/forum/tests/lib_test.php
mod/forum/tests/subscriptions_test.php
mod/forum/upgrade.txt
mod/forum/version.php
mod/forum/view.php
mod/imscp/classes/external.php
mod/imscp/upgrade.txt [new file with mode: 0644]
mod/lti/classes/external.php [new file with mode: 0644]
mod/lti/db/services.php [new file with mode: 0644]
mod/lti/launch.php
mod/lti/lib.php
mod/lti/locallib.php
mod/lti/service/memberships/classes/local/resource/contextmemberships.php [new file with mode: 0644]
mod/lti/service/memberships/classes/local/resource/linkmemberships.php [new file with mode: 0644]
mod/lti/service/memberships/classes/local/service/memberships.php [new file with mode: 0644]
mod/lti/service/memberships/lang/en/ltiservice_memberships.php [new file with mode: 0644]
mod/lti/service/memberships/version.php [new file with mode: 0644]
mod/lti/tests/externallib_test.php [new file with mode: 0644]
mod/lti/tests/lib_test.php [new file with mode: 0644]
mod/lti/tests/locallib_test.php
mod/lti/upgrade.txt
mod/lti/version.php
mod/lti/view.php
mod/quiz/locallib.php
mod/scorm/classes/external.php
mod/scorm/lang/en/scorm.php
mod/scorm/lib.php
mod/scorm/settings.php
mod/scorm/tests/externallib_test.php
mod/scorm/upgrade.txt
mod/scorm/version.php
mod/upgrade.txt
mod/wiki/lang/en/wiki.php
mod/wiki/lib.php
notes/externallib.php
pix/i/delete.png [new file with mode: 0644]
pix/i/delete.svg [new file with mode: 0644]
question/behaviour/manualgraded/tests/walkthrough_test.php
question/engine/lib.php
question/engine/tests/questionengine_test.php
question/type/ddimageortext/tests/behat/add.feature
question/type/ddimageortext/tests/behat/preview.feature
question/type/ddmarker/tests/behat/add.feature
question/type/ddmarker/tests/behat/behat_qtype_ddmarker.php
question/type/ddmarker/tests/behat/preview.feature
question/type/ddwtos/tests/behat/preview.feature
question/type/gapselect/tests/behat/basic_test.feature
question/type/gapselect/tests/behat/import_test.feature
rating/classes/external.php
repository/filepicker.php
tag/tests/behat/delete_tag.feature
tag/tests/behat/edit_tag.feature
tag/tests/behat/flag_tags.feature
theme/base/style/core.css
theme/base/style/course.css
theme/bootstrapbase/javascript/html5shiv.js
theme/bootstrapbase/less/bootstrap/bootstrap.less
theme/bootstrapbase/less/bootstrap/dropdowns.less
theme/bootstrapbase/less/bootstrap/mixins.less
theme/bootstrapbase/less/bootstrap/navs.less
theme/bootstrapbase/less/bootstrap/responsive.less
theme/bootstrapbase/less/bootstrap/type.less
theme/bootstrapbase/less/moodle/core.less
theme/bootstrapbase/less/moodle/course.less
theme/bootstrapbase/style/moodle.css
theme/bootstrapbase/thirdpartylibs.xml
theme/bootstrapbase/upgrade.txt
user/editlib.php
user/editor_form.php
user/externallib.php
user/lib.php
version.php
webservice/amf/db/access.php
webservice/amf/version.php
webservice/externallib.php
webservice/pluginfile.php
webservice/rest/db/access.php
webservice/rest/version.php
webservice/soap/db/access.php
webservice/soap/version.php
webservice/upgrade.txt
webservice/xmlrpc/db/access.php
webservice/xmlrpc/version.php

index e1a0fb0..0c955f4 100644 (file)
@@ -64,6 +64,8 @@ echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
 echo "<div>\n";
 echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
 echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
+// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
+echo prevent_form_autofill_password();
 
 // auth plugin description
 echo $OUTPUT->box_start();
index 51364b9..523f9e8 100644 (file)
@@ -74,6 +74,7 @@ Options:
 --adminpass=PASSWORD  Password for the moodle admin account,
                       required in non-interactive mode.
 --adminemail=STRING   Email address for the moodle admin account.
+--upgradekey=STRING   The upgrade key to be set in the config.php, leave empty to not set it.
 --non-interactive     No interactive questions, installation fails if any
                       problem encountered.
 --agree-license       Indicates agreement with software license,
@@ -258,6 +259,7 @@ list($options, $unrecognized) = cli_get_params(
         'adminuser'         => 'admin',
         'adminpass'         => '',
         'adminemail'        => '',
+        'upgradekey'        => '',
         'non-interactive'   => false,
         'agree-license'     => false,
         'allow-unstable'    => false,
@@ -722,6 +724,24 @@ if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
     cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
 }
 
+// Ask for the upgrade key.
+if ($interactive) {
+    cli_separator();
+    cli_heading(get_string('upgradekeyset', 'admin'));
+    if ($options['upgradekey'] !== '') {
+        $prompt = get_string('clitypevaluedefault', 'admin', $options['upgradekey']);
+        $options['upgradekey'] = cli_input($prompt, $options['upgradekey']);
+    } else {
+        $prompt = get_string('clitypevalue', 'admin');
+        $options['upgradekey'] = cli_input($prompt);
+    }
+}
+
+// Set the upgrade key if it was provided.
+if ($options['upgradekey'] !== '') {
+    $CFG->upgradekey = $options['upgradekey'];
+}
+
 if ($interactive) {
     if (!$options['agree-license']) {
         cli_separator();
index 1cea8f8..3e73aa4 100644 (file)
@@ -54,6 +54,16 @@ if (!function_exists('json_encode') || !function_exists('json_decode')) {
 
 define('NO_OUTPUT_BUFFERING', true);
 
+if (isset($_POST['upgradekey'])) {
+    // Before you start reporting issues about the collision attacks against
+    // SHA-1, you should understand that we are not actually attempting to do
+    // any cryptography here. This is hashed purely so that the key is not
+    // that apparent in the address bar itself. Anyone who catches the HTTP
+    // traffic can immediately use it as a valid admin key.
+    header('Location: index.php?cache=0&upgradekeyhash='.sha1($_POST['upgradekey']));
+    die();
+}
+
 if ((isset($_GET['cache']) and $_GET['cache'] === '0')
         or (isset($_POST['cache']) and $_POST['cache'] === '0')
         or (!isset($_POST['cache']) and !isset($_GET['cache']) and empty($_GET['sesskey']) and empty($_POST['sesskey']))) {
@@ -95,10 +105,14 @@ $showallplugins = optional_param('showallplugins', 0, PARAM_BOOL);
 $agreelicense   = optional_param('agreelicense', 0, PARAM_BOOL);
 $fetchupdates   = optional_param('fetchupdates', 0, PARAM_BOOL);
 $newaddonreq    = optional_param('installaddonrequest', null, PARAM_RAW);
+$upgradekeyhash = optional_param('upgradekeyhash', null, PARAM_ALPHANUM);
 
 // Set up PAGE.
 $url = new moodle_url('/admin/index.php');
 $url->param('cache', $cache);
+if (isset($upgradekeyhash)) {
+    $url->param('upgradekeyhash', $upgradekeyhash);
+}
 $PAGE->set_url($url);
 unset($url);
 
@@ -203,7 +217,7 @@ if (!core_tables_exist()) {
         $PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
 
         $output = $PAGE->get_renderer('core', 'admin');
-        $url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
+        $url = new moodle_url($PAGE->url, array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
         echo $output->unsatisfied_dependencies_page($version, $failed, $url);
         die();
     }
@@ -253,11 +267,13 @@ if (empty($CFG->version)) {
 // Detect config cache inconsistency, this happens when you switch branches on dev servers.
 if ($CFG->version != $DB->get_field('config', 'value', array('name'=>'version'))) {
     purge_all_caches();
-    redirect(new moodle_url('/admin/index.php'), 'Config cache inconsistency detected, resetting caches...');
+    redirect(new moodle_url($PAGE->url), 'Config cache inconsistency detected, resetting caches...');
 }
 
 if (!$cache and $version > $CFG->version) {  // upgrade
 
+    check_upgrade_key($upgradekeyhash);
+
     // Warning about upgrading a test site.
     $testsite = false;
     if (defined('BEHAT_SITE_RUNNING')) {
@@ -318,7 +334,7 @@ if (!$cache and $version > $CFG->version) {  // upgrade
         $PAGE->set_heading($strplugincheck);
         $PAGE->set_cacheable(false);
 
-        $reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
+        $reloadurl = new moodle_url($PAGE->url, array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
 
         if ($fetchupdates) {
             // No sesskey support guaranteed here, because sessions might not work yet.
@@ -342,15 +358,15 @@ if (!$cache and $version > $CFG->version) {  // upgrade
         }
 
         echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
-                $version, $showallplugins, $reloadurl,
-                new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1, 'cache'=>0)));
+                $version, $showallplugins, $reloadurl, new moodle_url($PAGE->url, array(
+                'confirmupgrade' => 1, 'confirmrelease' => 1, 'confirmplugincheck' => 1, 'cache' => 0)));
         die();
 
     } else {
         // Always verify plugin dependencies!
         $failed = array();
         if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
-            $reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
+            $reloadurl = new moodle_url($PAGE->url, array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
             echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
             die();
         }
@@ -374,6 +390,9 @@ if (!$cache and $branch <> $CFG->branch) {  // Update the branch
 }
 
 if (!$cache and moodle_needs_upgrading()) {
+
+    check_upgrade_key($upgradekeyhash);
+
     if (!$PAGE->headerprinted) {
         // means core upgrade or installation was not already done
 
@@ -413,7 +432,7 @@ if (!$cache and moodle_needs_upgrading()) {
             echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
                     $version, $showallplugins,
                     new moodle_url($PAGE->url),
-                    new moodle_url('/admin/index.php', array('confirmplugincheck'=>1, 'cache'=>0)));
+                    new moodle_url($PAGE->url, array('confirmplugincheck' => 1, 'cache' => 0)));
             die();
         }
 
@@ -422,7 +441,7 @@ if (!$cache and moodle_needs_upgrading()) {
         if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
             /** @var core_admin_renderer $output */
             $output = $PAGE->get_renderer('core', 'admin');
-            $reloadurl = new moodle_url('/admin/index.php', array('cache' => 0));
+            $reloadurl = new moodle_url($PAGE->url, array('cache' => 0));
             echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
             die();
         }
index 5d75e70..40036da 100644 (file)
@@ -43,7 +43,8 @@ class core_admin_renderer extends plugin_renderer_base {
         $copyrightnotice = text_to_html(get_string('gpl3'));
         $copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack
 
-        $continue = new single_button(new moodle_url('/admin/index.php', array('lang'=>$CFG->lang, 'agreelicense'=>1)), get_string('continue'), 'get');
+        $continue = new single_button(new moodle_url($this->page->url, array(
+            'lang' => $CFG->lang, 'agreelicense' => 1)), get_string('continue'), 'get');
 
         $output .= $this->header();
         $output .= $this->heading('<a href="http://moodle.org">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment');
@@ -96,10 +97,11 @@ class core_admin_renderer extends plugin_renderer_base {
         $output .= $this->environment_check_table($envstatus, $environment_results);
 
         if (!$envstatus) {
-            $output .= $this->upgrade_reload(new moodle_url('/admin/index.php', array('agreelicense' => 1, 'lang' => $CFG->lang)));
+            $output .= $this->upgrade_reload(new moodle_url($this->page->url, array('agreelicense' => 1, 'lang' => $CFG->lang)));
         } else {
             $output .= $this->notification(get_string('environmentok', 'admin'), 'notifysuccess');
-            $output .= $this->continue_button(new moodle_url('/admin/index.php', array('agreelicense'=>1, 'confirmrelease'=>1, 'lang'=>$CFG->lang)));
+            $output .= $this->continue_button(new moodle_url($this->page->url, array(
+                'agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang)));
         }
 
         $output .= $this->footer();
@@ -140,7 +142,7 @@ class core_admin_renderer extends plugin_renderer_base {
     public function upgrade_confirm_page($strnewversion, $maturity, $testsite) {
         $output = '';
 
-        $continueurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'cache' => 0));
+        $continueurl = new moodle_url($this->page->url, array('confirmupgrade' => 1, 'cache' => 0));
         $continue = new single_button($continueurl, get_string('continue'), 'get');
         $cancelurl = new moodle_url('/admin/index.php');
 
@@ -170,7 +172,7 @@ class core_admin_renderer extends plugin_renderer_base {
         $output .= $this->environment_check_table($envstatus, $environment_results);
 
         if (!$envstatus) {
-            $output .= $this->upgrade_reload(new moodle_url('/admin/index.php'), array('confirmupgrade' => 1, 'cache' => 0));
+            $output .= $this->upgrade_reload(new moodle_url($this->page->url, array('confirmupgrade' => 1, 'cache' => 0)));
 
         } else {
             $output .= $this->notification(get_string('environmentok', 'admin'), 'notifysuccess');
@@ -179,7 +181,8 @@ class core_admin_renderer extends plugin_renderer_base {
                 $output .= $this->box(get_string('langpackwillbeupdated', 'admin'), 'generalbox', 'notice');
             }
 
-            $output .= $this->continue_button(new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0)));
+            $output .= $this->continue_button(new moodle_url($this->page->url, array(
+                'confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0)));
         }
 
         $output .= $this->footer();
@@ -991,7 +994,7 @@ class core_admin_renderer extends plugin_renderer_base {
             $out  = $this->output->container_start('nonehighlighted', 'plugins-check-info');
             $out .= $this->output->heading(get_string('nonehighlighted', 'core_plugin'));
             if (empty($options['full'])) {
-                $out .= html_writer::link(new moodle_url('/admin/index.php',
+                $out .= html_writer::link(new moodle_url($this->page->url,
                     array('confirmupgrade' => 1, 'confirmrelease' => 1, 'showallplugins' => 1, 'cache' => 0)),
                     get_string('nonehighlightedinfo', 'core_plugin'));
             }
@@ -999,13 +1002,14 @@ class core_admin_renderer extends plugin_renderer_base {
 
         } else {
             $out  = $this->output->container_start('somehighlighted', 'plugins-check-info');
-            $out .= $this->output->heading(get_string('somehighlighted', 'core_plugin', $sumofhighlighted));
             if (empty($options['full'])) {
-                $out .= html_writer::link(new moodle_url('/admin/index.php',
+                $out .= $this->output->heading(get_string('somehighlighted', 'core_plugin', $sumofhighlighted));
+                $out .= html_writer::link(new moodle_url($this->page->url,
                     array('confirmupgrade' => 1, 'confirmrelease' => 1, 'showallplugins' => 1, 'cache' => 0)),
                     get_string('somehighlightedinfo', 'core_plugin'));
             } else {
-                $out .= html_writer::link(new moodle_url('/admin/index.php',
+                $out .= $this->output->heading(get_string('somehighlightedall', 'core_plugin', $sumofhighlighted));
+                $out .= html_writer::link(new moodle_url($this->page->url,
                     array('confirmupgrade' => 1, 'confirmrelease' => 1, 'showallplugins' => 0, 'cache' => 0)),
                     get_string('somehighlightedonly', 'core_plugin'));
             }
@@ -1571,4 +1575,26 @@ class core_admin_renderer extends plugin_renderer_base {
 
         return $output;
     }
+
+    /**
+     * Render a simple page for providing the upgrade key.
+     *
+     * @param moodle_url|string $url
+     * @return string
+     */
+    public function upgradekey_form_page($url) {
+
+        $output = '';
+        $output .= $this->header();
+        $output .= $this->container_start('upgradekeyreq');
+        $output .= $this->heading(get_string('upgradekeyreq', 'core_admin'));
+        $output .= html_writer::start_tag('form', array('method' => 'POST', 'action' => $url));
+        $output .= html_writer::empty_tag('input', array('name' => 'upgradekey', 'type' => 'password'));
+        $output .= html_writer::empty_tag('input', array('value' => get_string('submit'), 'type' => 'submit'));
+        $output .= html_writer::end_tag('form');
+        $output .= $this->container_end();
+        $output .= $this->footer();
+
+        return $output;
+    }
 }
index 1442ab8..bd88630 100644 (file)
@@ -226,7 +226,8 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
     );
     $temp->add(new admin_setting_configselect('backup/backup_auto_storage', new lang_string('automatedstorage', 'backup'), new lang_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
     $temp->add(new admin_setting_special_backup_auto_destination());
-    $keepoptoins = array(
+
+    $maxkeptoptions = array(
         0 => new lang_string('all'), 1 => '1',
         2 => '2',
         5 => '5',
@@ -240,7 +241,44 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
         300 => '300',
         400 => '400',
         500 => '500');
-    $temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
+    $temp->add(new admin_setting_configselect('backup/backup_auto_max_kept', new lang_string('automatedmaxkept', 'backup'),
+            new lang_string('automatedmaxkepthelp', 'backup'), 1, $maxkeptoptions));
+
+    $automateddeletedaysoptions = array(
+        0 => new lang_string('never'),
+        1000 => new lang_string('numdays', '', 1000),
+        365  => new lang_string('numdays', '', 365),
+        180  => new lang_string('numdays', '', 180),
+        150  => new lang_string('numdays', '', 150),
+        120  => new lang_string('numdays', '', 120),
+        90   => new lang_string('numdays', '', 90),
+        60   => new lang_string('numdays', '', 60),
+        35   => new lang_string('numdays', '', 35),
+        10   => new lang_string('numdays', '', 10),
+        5    => new lang_string('numdays', '', 5),
+        2    => new lang_string('numdays', '', 2)
+    );
+    $temp->add(new admin_setting_configselect('backup/backup_auto_delete_days', new lang_string('automateddeletedays', 'backup'),
+            '', 0, $automateddeletedaysoptions));
+
+    $minkeptoptions = array(
+        0 => new lang_string('none'),
+        1 => '1',
+        2 => '2',
+        5 => '5',
+        10 => '10',
+        20 => '20',
+        30 => '30',
+        40 => '40',
+        50 => '50',
+        100 => '100',
+        200 => '200',
+        300 => '300',
+        400 => '400'
+    );
+    $temp->add(new admin_setting_configselect('backup/backup_auto_min_kept', new lang_string('automatedminkept', 'backup'),
+            new lang_string('automatedminkepthelp', 'backup'), 0, $minkeptoptions));
+
     $temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
     $temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_hidden', new lang_string('skiphidden', 'backup'), new lang_string('skiphiddenhelp', 'backup'), 1));
     $temp->add(new admin_setting_configselect('backup/backup_auto_skip_modif_days', new lang_string('skipmodifdays', 'backup'), new lang_string('skipmodifdayshelp', 'backup'), 30, array(
index 820d25b..f5ea9e3 100644 (file)
@@ -277,11 +277,18 @@ if ($hassiteconfig) {
     $ADMIN->add('modules', new admin_category('webservicesettings', new lang_string('webservices', 'webservice')));
     // Mobile
     $temp = new admin_settingpage('mobile', new lang_string('mobile','admin'), 'moodle/site:config', false);
-    $enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
-    $enablemobiledoclink = html_writer::link($enablemobiledocurl, new lang_string('documentation'));
-    $temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
-            new lang_string('enablemobilewebservice', 'admin'),
-            new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
+
+    // We should wait to the installation to finish since we depend on some configuration values that are set once
+    // the admin user profile is configured.
+    if (!during_initial_install()) {
+        $enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
+        $enablemobiledoclink = html_writer::link($enablemobiledocurl, new lang_string('documentation'));
+        $default = is_https() ? 1 : 0;
+        $temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
+                new lang_string('enablemobilewebservice', 'admin'),
+                new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), $default));
+    }
+
     $temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'admin'), new lang_string('configmobilecssurl','admin'), '', PARAM_URL));
     $ADMIN->add('webservicesettings', $temp);
     /// overview page
index a8bc76e..cbd43e1 100644 (file)
@@ -113,3 +113,7 @@ $backend = new tool_generator_course_backend(
     FORMAT_HTML
 );
 $id = $backend->make();
+
+if (empty($options['quiet'])) {
+    echo PHP_EOL.'Generated course: '.course_get_url($id).PHP_EOL;
+}
index 22733b2..afa87dd 100644 (file)
@@ -183,6 +183,11 @@ class auth_plugin_cas extends auth_plugin_ldap {
             } else {
                 phpCAS::client($this->config->casversion, $this->config->hostname, (int) $this->config->port, $this->config->baseuri, false);
             }
+            // Some CAS installs require SSLv3 that should be explicitly set.
+            if (!empty($this->config->curl_ssl_version)) {
+                phpCAS::setExtraCurlOption(CURLOPT_SSLVERSION, $this->config->curl_ssl_version);
+            }
+
             $connected = true;
         }
 
@@ -302,6 +307,9 @@ class auth_plugin_cas extends auth_plugin_ldap {
         if (!isset($config->certificate_path)) {
             $config->certificate_path = '';
         }
+        if (!isset($config->curl_ssl_version)) {
+            $config->curl_ssl_version = '';
+        }
         if (!isset($config->logout_return_url)) {
             $config->logout_return_url = '';
         }
@@ -374,6 +382,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
         set_config('multiauth', $config->multiauth, $this->pluginconfig);
         set_config('certificate_check', $config->certificate_check, $this->pluginconfig);
         set_config('certificate_path', $config->certificate_path, $this->pluginconfig);
+        set_config('curl_ssl_version', $config->curl_ssl_version, $this->pluginconfig);
         set_config('logout_return_url', $config->logout_return_url, $this->pluginconfig);
 
         // save LDAP settings
index 13c2989..c0ea85b 100644 (file)
@@ -33,6 +33,9 @@ if (!isset ($config->certificate_check)) {
 if (!isset ($config->certificate_path)) {
     $config->certificate_path = '';
 }
+if (!isset($config->curl_ssl_version)) {
+    $config->curl_ssl_version = '';
+}
 if (!isset($config->logout_return_url)) {
     $config->logout_return_url = '';
 }
@@ -216,6 +219,38 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
         <?php print_string('auth_cas_certificate_path', 'auth_cas') ?>
     </td>
 </tr>
+<tr valign="top" class="required">
+    <td align="right"><label for="curl_ ssl_version"><?php print_string('auth_cas_curl_ssl_version_key', 'auth_cas') ?>: </label></td>
+    <td>
+        <?php
+            $sslversions = array();
+            $sslversions[''] = get_string('auth_cas_curl_ssl_version_default', 'auth_cas');
+            if (defined('CURL_SSLVERSION_TLSv1')) {
+                $sslversions[CURL_SSLVERSION_TLSv1] = get_string('auth_cas_curl_ssl_version_TLSv1x', 'auth_cas');
+            }
+            if (defined('CURL_SSLVERSION_TLSv1_0')) {
+                $sslversions[CURL_SSLVERSION_TLSv1_0] = get_string('auth_cas_curl_ssl_version_TLSv10', 'auth_cas');
+            }
+            if (defined('CURL_SSLVERSION_TLSv1_1')) {
+                $sslversions[CURL_SSLVERSION_TLSv1_1] = get_string('auth_cas_curl_ssl_version_TLSv11', 'auth_cas');
+            }
+            if (defined('CURL_SSLVERSION_TLSv1_2')) {
+                $sslversions[CURL_SSLVERSION_TLSv1_2] = get_string('auth_cas_curl_ssl_version_TLSv12', 'auth_cas');
+            }
+            if (defined('CURL_SSLVERSION_SSLv2')) {
+                $sslversions[CURL_SSLVERSION_SSLv2] = get_string('auth_cas_curl_ssl_version_SSLv2', 'auth_cas');
+            }
+            if (defined('CURL_SSLVERSION_SSLv3')) {
+                $sslversions[CURL_SSLVERSION_SSLv3] = get_string('auth_cas_curl_ssl_version_SSLv3', 'auth_cas');
+            }
+            echo html_writer::select($sslversions, 'curl_ssl_version', $config->curl_ssl_version, false);
+            if (isset($err['curl_ssl_version'])) echo $OUTPUT->error_text($err['curl_ssl_version']);
+        ?>
+    </td>
+    <td>
+        <?php print_string('auth_cas_curl_ssl_version', 'auth_cas') ?>
+    </td>
+</tr>
 <tr valign="top" class="required">
     <td align="right"><?php print_string('auth_cas_logout_return_url_key', 'auth_cas') ?>:</td>
     <td>
index c30522c..e9990d8 100644 (file)
@@ -37,6 +37,15 @@ $string['auth_cas_certificate_path'] = 'Path of the CA chain file (PEM Format) t
 $string['auth_cas_certificate_path_key'] = 'Certificate path';
 $string['auth_cas_create_user'] = 'Turn this on if you want to insert CAS-authenticated users in Moodle database. If not then only users who already exist in the Moodle database can log in.';
 $string['auth_cas_create_user_key'] = 'Create user';
+$string['auth_cas_curl_ssl_version'] = 'The SSL version (2 or 3) to use. By default PHP will try to determine this itself, although in some cases this must be set manually.';
+$string['auth_cas_curl_ssl_version_default'] = 'Default';
+$string['auth_cas_curl_ssl_version_key'] = 'cURL SSL Version';
+$string['auth_cas_curl_ssl_version_SSLv2'] = 'SSLv2';
+$string['auth_cas_curl_ssl_version_SSLv3'] = 'SSLv3';
+$string['auth_cas_curl_ssl_version_TLSv1x'] = 'TLSv1.x';
+$string['auth_cas_curl_ssl_version_TLSv10'] = 'TLSv1.0';
+$string['auth_cas_curl_ssl_version_TLSv11'] = 'TLSv1.1';
+$string['auth_cas_curl_ssl_version_TLSv12'] = 'TLSv1.2';
 $string['auth_casdescription'] = 'This method uses a CAS server (Central Authentication Service) to authenticate users in a Single Sign On environment (SSO). You can also use a simple LDAP authentication. If the given username and password are valid according to CAS, Moodle creates a new user entry in its database, taking user attributes from LDAP if required. On following logins only the username and password are checked.';
 $string['auth_cas_enabled'] = 'Turn this on if you want to use CAS authentication.';
 $string['auth_cas_hostname'] = 'Hostname of the CAS server <br />eg: host.domain.fr';
index 103bb20..3ae3f26 100644 (file)
@@ -60,7 +60,7 @@ if (!isset($config->changepasswordurl)) {
 </tr>
 
 <tr valign="top" >
-    <td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius'), 'menuradiustype'); ?>: </td>
+    <td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius') . ':', 'menuradiustype'); ?> </td>
     <td>
 <?php
 
index 13091ec..1477978 100644 (file)
@@ -35,7 +35,7 @@ use core_availability\info_section;
  * @copyright 2014 The Open University
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-class info_testcase extends \advanced_testcase {
+class info_testcase extends advanced_testcase {
     public function setUp() {
         // Load the mock condition so that it can be used.
         require_once(__DIR__ . '/fixtures/mock_condition.php');
@@ -87,8 +87,8 @@ class info_testcase extends \advanced_testcase {
         // Check invalid one.
         $info = new info_module($cm3);
         $this->assertFalse($info->is_available($information));
-        $debugging = phpunit_util::get_debugging_messages();
-        phpunit_util::reset_debugging();
+        $debugging = $this->getDebuggingMessages();
+        $this->resetDebugging();
         $this->assertEquals(1, count($debugging));
         $this->assertContains('Invalid availability', $debugging[0]->message);
 
@@ -141,8 +141,8 @@ class info_testcase extends \advanced_testcase {
         // Check invalid one.
         $info = new info_section($sections[3]);
         $this->assertFalse($info->is_available($information));
-        $debugging = phpunit_util::get_debugging_messages();
-        phpunit_util::reset_debugging();
+        $debugging = $this->getDebuggingMessages();
+        $this->resetDebugging();
         $this->assertEquals(1, count($debugging));
         $this->assertContains('Invalid availability', $debugging[0]->message);
 
index 787db96..47b9971 100644 (file)
@@ -220,6 +220,21 @@ class core_backup_moodle2_course_format_testcase extends advanced_testcase {
  * Test course format that has 1 option.
  */
 class format_test_cs_options extends format_topics {
+    /**
+     * Override method format_topics::get_default_section_name to prevent PHPUnit errors related to the nonexistent
+     * format_test_cs_options lang file.
+     *
+     * @param stdClass $section The section in question.
+     * @return string The section's name for display.
+     */
+    public function get_default_section_name($section) {
+        if ($section->section == 0) {
+            return parent::get_default_section_name($section);
+        } else {
+            return get_string('sectionname', 'format_topics') . ' ' . $section->section;
+        }
+    }
+
     public function section_format_options($foreditform = false) {
         return array(
             'numdaystocomplete' => array(
index 26e2e00..31e7f03 100644 (file)
@@ -1,6 +1,11 @@
 This files describes API changes in /backup/*,
 information provided here is intended especially for developers.
 
+=== 3.0 ===
+
+* The backup_auto_keep setting, in automated backups configuration, is now
+  renamed to backup_auto_max_kept as part of a rationalise of naming (see MDL-50602)
+
 === 2.6 ===
 
 * The backup_controller_dbops::create_temptable_from_real_table()
index 1188bf7..8b6eeb8 100644 (file)
@@ -61,6 +61,13 @@ abstract class backup_cron_automated_helper {
     const AUTO_BACKUP_ENABLED = 1;
     const AUTO_BACKUP_MANUAL = 2;
 
+    /** Automated backup storage in course backup filearea */
+    const STORAGE_COURSE = 0;
+    /** Automated backup storage in specified directory */
+    const STORAGE_DIRECTORY = 1;
+    /** Automated backup storage in course backup filearea and specified directory */
+    const STORAGE_COURSE_AND_DIRECTORY = 2;
+
     /**
      * Runs the automated backups if required
      *
@@ -174,42 +181,42 @@ abstract class backup_cron_automated_helper {
                     $backupcourse->nextstarttime = $nextstarttime;
                     $DB->update_record('backup_courses', $backupcourse);
                     mtrace('Skipping ' . $course->fullname . ' (Not scheduled for backup until ' . $showtime . ')');
-                } else if ($skipped) { // Must have been skipped for a reason.
-                    $backupcourse->laststatus = self::BACKUP_STATUS_SKIPPED;
-                    $backupcourse->nextstarttime = $nextstarttime;
-                    $DB->update_record('backup_courses', $backupcourse);
-                    mtrace('Skipping ' . $course->fullname . ' (' . $skippedmessage . ')');
-                    mtrace('Backup of \'' . $course->fullname . '\' is scheduled on ' . $showtime);
                 } else {
-                    // Backup every non-skipped courses.
-                    mtrace('Backing up '.$course->fullname.'...');
+                    if ($skipped) { // Must have been skipped for a reason.
+                        $backupcourse->laststatus = self::BACKUP_STATUS_SKIPPED;
+                        $backupcourse->nextstarttime = $nextstarttime;
+                        $DB->update_record('backup_courses', $backupcourse);
+                        mtrace('Skipping ' . $course->fullname . ' (' . $skippedmessage . ')');
+                        mtrace('Backup of \'' . $course->fullname . '\' is scheduled on ' . $showtime);
+                    } else {
+                        // Backup every non-skipped courses.
+                        mtrace('Backing up '.$course->fullname.'...');
 
-                    // We have to send an email because we have included at least one backup.
-                    $emailpending = true;
+                        // We have to send an email because we have included at least one backup.
+                        $emailpending = true;
 
-                    // Only make the backup if laststatus isn't 2-UNFINISHED (uncontrolled error).
-                    if ($backupcourse->laststatus != self::BACKUP_STATUS_UNFINISHED) {
-                        // Set laststarttime.
-                        $starttime = time();
+                        // Only make the backup if laststatus isn't 2-UNFINISHED (uncontrolled error).
+                        if ($backupcourse->laststatus != self::BACKUP_STATUS_UNFINISHED) {
+                            // Set laststarttime.
+                            $starttime = time();
 
-                        $backupcourse->laststarttime = time();
-                        $backupcourse->laststatus = self::BACKUP_STATUS_UNFINISHED;
-                        $DB->update_record('backup_courses', $backupcourse);
+                            $backupcourse->laststarttime = time();
+                            $backupcourse->laststatus = self::BACKUP_STATUS_UNFINISHED;
+                            $DB->update_record('backup_courses', $backupcourse);
 
-                        $backupcourse->laststatus = backup_cron_automated_helper::launch_automated_backup($course, $backupcourse->laststarttime, $admin->id);
-                        $backupcourse->lastendtime = time();
-                        $backupcourse->nextstarttime = $nextstarttime;
+                            $backupcourse->laststatus = self::launch_automated_backup($course, $backupcourse->laststarttime,
+                                    $admin->id);
+                            $backupcourse->lastendtime = time();
+                            $backupcourse->nextstarttime = $nextstarttime;
 
-                        $DB->update_record('backup_courses', $backupcourse);
+                            $DB->update_record('backup_courses', $backupcourse);
 
-                        if ($backupcourse->laststatus === self::BACKUP_STATUS_OK) {
-                            // Clean up any excess course backups now that we have
-                            // taken a successful backup.
-                            $removedcount = backup_cron_automated_helper::remove_excess_backups($course);
+                            mtrace("complete - next execution: $showtime");
                         }
                     }
 
-                    mtrace("complete - next execution: $showtime");
+                    // Remove excess backups.
+                    $removedcount = self::remove_excess_backups($course, $now);
                 }
             }
             $rs->close();
@@ -537,98 +544,177 @@ abstract class backup_cron_automated_helper {
     }
 
     /**
-     * Removes excess backups from the external system and the local file system.
+     * Removes excess backups from a specified course.
      *
-     * The number of backups keep comes from $config->backup_auto_keep.
-     *
-     * @param stdClass $course object
-     * @return bool
+     * @param stdClass $course Course object
+     * @param int $now Starting time of the process
+     * @return bool Whether or not backups is being removed
      */
-    public static function remove_excess_backups($course) {
+    public static function remove_excess_backups($course, $now = null) {
         $config = get_config('backup');
-        $keep =     (int)$config->backup_auto_keep;
-        $storage =  $config->backup_auto_storage;
-        $dir =      $config->backup_auto_destination;
+        $maxkept = (int)$config->backup_auto_max_kept;
+        $storage = $config->backup_auto_storage;
+        $deletedays = (int)$config->backup_auto_delete_days;
 
-        if ($keep == 0) {
-            // Means keep all backup files.
+        if ($maxkept == 0 && $deletedays == 0) {
+            // Means keep all backup files and never delete backup after x days.
             return true;
         }
 
-        if (!file_exists($dir) || !is_dir($dir) || !is_writable($dir)) {
-            $dir = null;
+        if (!isset($now)) {
+            $now = time();
         }
 
         // Clean up excess backups in the course backup filearea.
-        if ($storage == 0 || $storage == 2) {
-            $fs = get_file_storage();
-            $context = context_course::instance($course->id);
-            $component = 'backup';
-            $filearea = 'automated';
-            $itemid = 0;
-            $files = array();
-            // Store all the matching files into timemodified => stored_file array.
-            foreach ($fs->get_area_files($context->id, $component, $filearea, $itemid) as $file) {
-                $files[$file->get_timemodified()] = $file;
+        $deletedcoursebackups = false;
+        if ($storage == self::STORAGE_COURSE || $storage == self::STORAGE_COURSE_AND_DIRECTORY) {
+            $deletedcoursebackups = self::remove_excess_backups_from_course($course, $now);
+        }
+
+        // Clean up excess backups in the specified external directory.
+        $deleteddirectorybackups = false;
+        if ($storage == self::STORAGE_DIRECTORY || $storage == self::STORAGE_COURSE_AND_DIRECTORY) {
+            $deleteddirectorybackups = self::remove_excess_backups_from_directory($course, $now);
+        }
+
+        if ($deletedcoursebackups || $deleteddirectorybackups) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Removes excess backups in the course backup filearea from a specified course.
+     *
+     * @param stdClass $course Course object
+     * @param int $now Starting time of the process
+     * @return bool Whether or not backups are being removed
+     */
+    protected static function remove_excess_backups_from_course($course, $now) {
+        $fs = get_file_storage();
+        $context = context_course::instance($course->id);
+        $component = 'backup';
+        $filearea = 'automated';
+        $itemid = 0;
+        $backupfiles = array();
+        $backupfilesarea = $fs->get_area_files($context->id, $component, $filearea, $itemid, 'timemodified DESC', false);
+        // Store all the matching files into timemodified => stored_file array.
+        foreach ($backupfilesarea as $backupfile) {
+            $backupfiles[$backupfile->get_timemodified()] = $backupfile;
+        }
+
+        $backupstodelete = self::get_backups_to_delete($backupfiles, $now);
+        if ($backupstodelete) {
+            foreach ($backupstodelete as $backuptodelete) {
+                $backuptodelete->delete();
             }
-            if (count($files) <= $keep) {
-                // There are less matching files than the desired number to keep there is nothing to clean up.
-                return 0;
+            mtrace('Deleted ' . count($backupstodelete) . ' old backup file(s) from the automated filearea');
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Removes excess backups in the specified external directory from a specified course.
+     *
+     * @param stdClass $course Course object
+     * @param int $now Starting time of the process
+     * @return bool Whether or not backups are being removed
+     */
+    protected static function remove_excess_backups_from_directory($course, $now) {
+        $config = get_config('backup');
+        $dir = $config->backup_auto_destination;
+
+        $isnotvaliddir = !file_exists($dir) || !is_dir($dir) || !is_writable($dir);
+        if ($isnotvaliddir) {
+            mtrace('Error: ' . $dir . ' does not appear to be a valid directory');
+            return false;
+        }
+
+        // Calculate backup filename regex, ignoring the date/time/info parts that can be
+        // variable, depending of languages, formats and automated backup settings.
+        $filename = backup::FORMAT_MOODLE . '-' . backup::TYPE_1COURSE . '-' . $course->id . '-';
+        $regex = '#' . preg_quote($filename, '#') . '.*\.mbz$#';
+
+        // Store all the matching files into filename => timemodified array.
+        $backupfiles = array();
+        foreach (scandir($dir) as $backupfile) {
+            // Skip files not matching the naming convention.
+            if (!preg_match($regex, $backupfile)) {
+                continue;
             }
-            // Sort by keys descending (newer to older filemodified).
-            krsort($files);
-            $remove = array_splice($files, $keep);
-            foreach ($remove as $file) {
-                $file->delete();
+
+            // Read the information contained in the backup itself.
+            try {
+                $bcinfo = backup_general_helper::get_backup_information_from_mbz($dir . '/' . $backupfile);
+            } catch (backup_helper_exception $e) {
+                mtrace('Error: ' . $backupfile . ' does not appear to be a valid backup (' . $e->errorcode . ')');
+                continue;
             }
-            //mtrace('Removed '.count($remove).' old backup file(s) from the automated filearea');
-        }
 
-        // Clean up excess backups in the specified external directory.
-        if (!empty($dir) && ($storage == 1 || $storage == 2)) {
-            // Calculate backup filename regex, ignoring the date/time/info parts that can be
-            // variable, depending of languages, formats and automated backup settings.
-            $filename = backup::FORMAT_MOODLE . '-' . backup::TYPE_1COURSE . '-' . $course->id . '-';
-            $regex = '#' . preg_quote($filename, '#') . '.*\.mbz$#';
-
-            // Store all the matching files into filename => timemodified array.
-            $files = array();
-            foreach (scandir($dir) as $file) {
-                // Skip files not matching the naming convention.
-                if (!preg_match($regex, $file, $matches)) {
-                    continue;
-                }
+            // Make sure this backup concerns the course and site we are looking for.
+            if ($bcinfo->format === backup::FORMAT_MOODLE &&
+                    $bcinfo->type === backup::TYPE_1COURSE &&
+                    $bcinfo->original_course_id == $course->id &&
+                    backup_general_helper::backup_is_samesite($bcinfo)) {
+                $backupfiles[$bcinfo->backup_date] = $backupfile;
+            }
+        }
 
-                // Read the information contained in the backup itself.
-                try {
-                    $bcinfo = backup_general_helper::get_backup_information_from_mbz($dir . '/' . $file);
-                } catch (backup_helper_exception $e) {
-                    mtrace('Error: ' . $file . ' does not appear to be a valid backup (' . $e->errorcode . ')');
-                    continue;
-                }
+        $backupstodelete = self::get_backups_to_delete($backupfiles, $now);
+        if ($backupstodelete) {
+            foreach ($backupstodelete as $backuptodelete) {
+                unlink($dir . '/' . $backuptodelete);
+            }
+            mtrace('Deleted ' . count($backupstodelete) . ' old backup file(s) from external directory');
+            return true;
+        } else {
+            return false;
+        }
+    }
 
-                // Make sure this backup concerns the course and site we are looking for.
-                if ($bcinfo->format === backup::FORMAT_MOODLE &&
-                        $bcinfo->type === backup::TYPE_1COURSE &&
-                        $bcinfo->original_course_id == $course->id &&
-                        backup_general_helper::backup_is_samesite($bcinfo)) {
-                    $files[$file] = $bcinfo->backup_date;
+    /**
+     * Get the list of backup files to delete depending on the automated backup settings.
+     *
+     * @param array $backupfiles Existing backup files
+     * @param int $now Starting time of the process
+     * @return array Backup files to delete
+     */
+    protected static function get_backups_to_delete($backupfiles, $now) {
+        $config = get_config('backup');
+        $maxkept = (int)$config->backup_auto_max_kept;
+        $deletedays = (int)$config->backup_auto_delete_days;
+        $minkept = (int)$config->backup_auto_min_kept;
+
+        // Sort by keys descending (newer to older filemodified).
+        krsort($backupfiles);
+        $tokeep = $maxkept;
+        if ($deletedays > 0) {
+            $deletedayssecs = $deletedays * DAYSECS;
+            $tokeep = 0;
+            $backupfileskeys = array_keys($backupfiles);
+            foreach ($backupfileskeys as $timemodified) {
+                $mustdeletebackup = $timemodified < ($now - $deletedayssecs);
+                if ($mustdeletebackup || $tokeep >= $maxkept) {
+                    break;
                 }
+                $tokeep++;
             }
-            if (count($files) <= $keep) {
-                // There are less matching files than the desired number to keep there is nothing to clean up.
-                return 0;
-            }
-            // Sort by values descending (newer to older filemodified).
-            arsort($files);
-            $remove = array_splice($files, $keep);
-            foreach (array_keys($remove) as $file) {
-                unlink($dir . '/' . $file);
+
+            if ($tokeep < $minkept) {
+                $tokeep = $minkept;
             }
-            //mtrace('Removed '.count($remove).' old backup file(s) from external directory');
         }
 
-        return true;
+        if (count($backupfiles) <= $tokeep) {
+            // There are less or equal matching files than the desired number to keep, there is nothing to clean up.
+            return false;
+        } else {
+            $backupstodelete = array_splice($backupfiles, $tokeep);
+            return $backupstodelete;
+        }
     }
 
     /**
index cb88d53..320daac 100644 (file)
@@ -244,4 +244,100 @@ class backup_cron_helper_testcase extends advanced_testcase {
         $next = backup_cron_automated_helper::calculate_next_automated_backup($timezone, $now);
         $this->assertEquals(date('w-20:00'), date('w-H:i', $next));
     }
+
+    /**
+     * Test {@link backup_cron_automated_helper::get_backups_to_delete}.
+     */
+    public function test_get_backups_to_delete() {
+        $this->resetAfterTest();
+        // Active only backup_auto_max_kept config to 2 days.
+        set_config('backup_auto_max_kept', '2', 'backup');
+        set_config('backup_auto_delete_days', '0', 'backup');
+        set_config('backup_auto_min_kept', '0', 'backup');
+
+        // No backups to delete.
+        $backupfiles = array(
+            '1000000000' => 'file1.mbz',
+            '1000432000' => 'file3.mbz'
+        );
+        $deletedbackups = testable_backup_cron_automated_helper::testable_get_backups_to_delete($backupfiles, 1000432000);
+        $this->assertFalse($deletedbackups);
+
+        // Older backup to delete.
+        $backupfiles['1000172800'] = 'file2.mbz';
+        $deletedbackups = testable_backup_cron_automated_helper::testable_get_backups_to_delete($backupfiles, 1000432000);
+        $this->assertEquals(1, count($deletedbackups));
+        $this->assertArrayHasKey('1000000000', $backupfiles);
+        $this->assertEquals('file1.mbz', $backupfiles['1000000000']);
+
+        // Activate backup_auto_max_kept to 5 days and backup_auto_delete_days to 10 days.
+        set_config('backup_auto_max_kept', '5', 'backup');
+        set_config('backup_auto_delete_days', '10', 'backup');
+        set_config('backup_auto_min_kept', '0', 'backup');
+
+        // No backups to delete. Timestamp is 1000000000 + 10 days.
+        $backupfiles['1000432001'] = 'file4.mbz';
+        $backupfiles['1000864000'] = 'file5.mbz';
+        $deletedbackups = testable_backup_cron_automated_helper::testable_get_backups_to_delete($backupfiles, 1000864000);
+        $this->assertFalse($deletedbackups);
+
+        // One old backup to delete. Timestamp is 1000000000 + 10 days + 1 second.
+        $deletedbackups = testable_backup_cron_automated_helper::testable_get_backups_to_delete($backupfiles, 1000864001);
+        $this->assertEquals(1, count($deletedbackups));
+        $this->assertArrayHasKey('1000000000', $backupfiles);
+        $this->assertEquals('file1.mbz', $backupfiles['1000000000']);
+
+        // Two old backups to delete. Timestamp is 1000000000 + 12 days + 1 second.
+        $deletedbackups = testable_backup_cron_automated_helper::testable_get_backups_to_delete($backupfiles, 1001036801);
+        $this->assertEquals(2, count($deletedbackups));
+        $this->assertArrayHasKey('1000000000', $backupfiles);
+        $this->assertEquals('file1.mbz', $backupfiles['1000000000']);
+        $this->assertArrayHasKey('1000172800', $backupfiles);
+        $this->assertEquals('file2.mbz', $backupfiles['1000172800']);
+
+        // Activate backup_auto_max_kept to 5 days, backup_auto_delete_days to 10 days and backup_auto_min_kept to 2.
+        set_config('backup_auto_max_kept', '5', 'backup');
+        set_config('backup_auto_delete_days', '10', 'backup');
+        set_config('backup_auto_min_kept', '2', 'backup');
+
+        // Three instead of four old backups are deleted. Timestamp is 1000000000 + 16 days.
+        $deletedbackups = testable_backup_cron_automated_helper::testable_get_backups_to_delete($backupfiles, 1001382400);
+        $this->assertEquals(3, count($deletedbackups));
+        $this->assertArrayHasKey('1000000000', $backupfiles);
+        $this->assertEquals('file1.mbz', $backupfiles['1000000000']);
+        $this->assertArrayHasKey('1000172800', $backupfiles);
+        $this->assertEquals('file2.mbz', $backupfiles['1000172800']);
+        $this->assertArrayHasKey('1000432000', $backupfiles);
+        $this->assertEquals('file3.mbz', $backupfiles['1000432000']);
+
+        // Three instead of all five backups are deleted. Timestamp is 1000000000 + 60 days.
+        $deletedbackups = testable_backup_cron_automated_helper::testable_get_backups_to_delete($backupfiles, 1005184000);
+        $this->assertEquals(3, count($deletedbackups));
+        $this->assertArrayHasKey('1000000000', $backupfiles);
+        $this->assertEquals('file1.mbz', $backupfiles['1000000000']);
+        $this->assertArrayHasKey('1000172800', $backupfiles);
+        $this->assertEquals('file2.mbz', $backupfiles['1000172800']);
+        $this->assertArrayHasKey('1000432000', $backupfiles);
+        $this->assertEquals('file3.mbz', $backupfiles['1000432000']);
+    }
+}
+
+/**
+ * Provides access to protected methods we want to explicitly test
+ *
+ * @copyright 2015 Jean-Philippe Gaudreau <jp.gaudreau@umontreal.ca>
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class testable_backup_cron_automated_helper extends backup_cron_automated_helper {
+
+    /**
+     * Provides access to protected method get_backups_to_remove.
+     *
+     * @param array $backupfiles Existing backup files
+     * @param int $now Starting time of the process
+     * @return array Backup files to remove
+     */
+    public static function testable_get_backups_to_delete($backupfiles, $now) {
+        return parent::get_backups_to_delete($backupfiles, $now);
+    }
 }
index 1941738..ad9d427 100644 (file)
@@ -45,7 +45,7 @@ class edit_backpack_form extends moodleform {
         $mform->addElement('html', html_writer::tag('span', '', array('class' => 'notconnected', 'id' => 'connection-error')));
         $mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
         $mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
-        $mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
+        $mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
         $status = html_writer::tag('span', get_string('notconnected', 'badges'),
             array('class' => 'notconnected', 'id' => 'connection-status'));
         $mform->addElement('static', 'status', get_string('status'), $status);
@@ -67,7 +67,7 @@ class edit_backpack_form extends moodleform {
         $mform->addElement('hidden', 'userid', $USER->id);
         $mform->setType('userid', PARAM_INT);
 
-        $mform->addElement('hidden', 'backpackurl', 'http://' . BADGE_BACKPACKURL);
+        $mform->addElement('hidden', 'backpackurl', BADGE_BACKPACKURL);
         $mform->setType('backpackurl', PARAM_URL);
 
     }
@@ -118,7 +118,7 @@ class edit_collections_form extends moodleform {
 
         $mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
         $mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
-        $mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
+        $mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
 
         $status = html_writer::tag('span', get_string('connected', 'badges'), array('class' => 'connected'));
         $mform->addElement('static', 'status', get_string('status'), $status);
index 382749a..9365afe 100644 (file)
@@ -87,7 +87,7 @@ if (!isset($data->status) || $data->status != 'okay') {
 
 // Make sure email matches a backpack.
 $check = new stdClass();
-$check->backpackurl = 'http://' . BADGE_BACKPACKURL;
+$check->backpackurl = BADGE_BACKPACKURL;
 $check->email = $data->email;
 
 $bp = new OpenBadgesBackpackHandler($check);
@@ -106,7 +106,7 @@ if (isset($request->status) && $request->status == 'missing') {
 $obj = new stdClass();
 $obj->userid = $USER->id;
 $obj->email = $data->email;
-$obj->backpackurl = 'http://' . BADGE_BACKPACKURL;
+$obj->backpackurl = BADGE_BACKPACKURL;
 $obj->backpackuid = $backpackuid;
 $obj->autosync = 0;
 $obj->password = '';
index 18915a0..65c2dda 100644 (file)
@@ -170,33 +170,31 @@ class award_criteria_profile extends award_criteria {
         }
 
         $join = '';
-        $where = '';
+        $whereparts = array();
         $sqlparams = array();
         $rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
 
         foreach ($this->params as $param) {
             if (is_numeric($param['field'])) {
-                $infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
-                $sqlparams["fieldid{$param['field']}"] = $param['field'];
+                // This is a custom field.
+                $idx = count($whereparts) + 1;
+                $join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
+                $sqlparams["fieldid{$idx}"] = $param['field'];
+                $whereparts[] = "uid{$idx}.id IS NOT NULL";
             } else {
-                $userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
+                // This is a field from {user} table.
+                $whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
             }
         }
 
-        // Add user custom field parameters if there are any.
-        if (!empty($infodata)) {
-            $extraon = implode($rule, $infodata);
-            $join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
-        }
+        $sqlparams['userid'] = $userid;
 
-        // Add user table field parameters if there are any.
-        if (!empty($userdata)) {
-            $extraon = implode($rule, $userdata);
-            $where = " AND ({$extraon})";
+        if ($whereparts) {
+            $where = " AND (" . implode($rule, $whereparts) . ")";
+        } else {
+            $where = '';
         }
-
-        $sqlparams['userid'] = $userid;
-        $sql = "SELECT u.* FROM {user} u " . $join . " WHERE u.id = :userid " . $where;
+        $sql = "SELECT 1 FROM {user} u " . $join . " WHERE u.id = :userid $where";
         $overall = $DB->record_exists_sql($sql, $sqlparams);
 
         return $overall;
@@ -212,29 +210,26 @@ class award_criteria_profile extends award_criteria {
         global $DB;
 
         $join = '';
-        $where = '';
+        $whereparts = array();
         $params = array();
         $rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
 
         foreach ($this->params as $param) {
             if (is_numeric($param['field'])) {
-                $infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
-                $params["fieldid{$param['field']}"] = $param['field'];
+                // This is a custom field.
+                $idx = count($whereparts);
+                $join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
+                $params["fieldid{$idx}"] = $param['field'];
+                $whereparts[] = "uid{$idx}.id IS NOT NULL";
             } else {
-                $userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
+                $whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
             }
         }
 
-        // Add user custom fields if there are any.
-        if (!empty($infodata)) {
-            $extraon = implode($rule, $infodata);
-            $join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
-        }
-
-        // Add user table fields if there are any.
-        if (!empty($userdata)) {
-            $extraon = implode($rule, $userdata);
-            $where = " AND ({$extraon})";
+        if ($whereparts) {
+            $where = " AND (" . implode($rule, $whereparts) . ")";
+        } else {
+            $where = '';
         }
         return array($join, $where, $params);
     }
index b628431..2de1122 100644 (file)
@@ -344,6 +344,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
         $criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_ACTIVITY, 'badgeid' => $badge->id));
         $criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY, 'module_'.$this->module->cmid => $this->module->cmid));
 
+        // Assert the badge will not be issued to the user as is.
+        $badge = new badge($this->coursebadge);
+        $badge->review_all_criteria();
+        $this->assertFalse($badge->is_issued($this->user->id));
+
         // Set completion for forum activity.
         $c = new completion_info($this->course);
         $activities = $c->get_activities();
@@ -379,6 +384,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
 
         $ccompletion = new completion_completion(array('course' => $this->course->id, 'userid' => $this->user->id));
 
+        // Assert the badge will not be issued to the user as is.
+        $badge = new badge($this->coursebadge);
+        $badge->review_all_criteria();
+        $this->assertFalse($badge->is_issued($this->user->id));
+
         // Mark course as complete.
         $sink = $this->redirectEmails();
         $ccompletion->mark_complete();
@@ -394,18 +404,33 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
      * Test badges observer when user_updated event is fired.
      */
     public function test_badges_observer_profile_criteria_review() {
+        global $CFG, $DB;
+        require_once($CFG->dirroot.'/user/profile/lib.php');
+
+        // Add a custom field of textarea type.
+        $customprofileid = $DB->insert_record('user_info_field', array(
+            'shortname' => 'newfield', 'name' => 'Description of new field', 'categoryid' => 1,
+            'datatype' => 'textarea'));
+
         $this->preventResetByRollback(); // Messaging is not compatible with transactions.
         $badge = new badge($this->coursebadge);
-        $this->assertFalse($badge->is_issued($this->user->id));
 
         $criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
         $criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
         $criteria_overall1 = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_PROFILE, 'badgeid' => $badge->id));
-        $criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim'));
+        $criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim',
+            'field_' . $customprofileid => $customprofileid));
+
+        // Assert the badge will not be issued to the user as is.
+        $badge = new badge($this->coursebadge);
+        $badge->review_all_criteria();
+        $this->assertFalse($badge->is_issued($this->user->id));
 
+        // Set the required fields and make sure the badge got issued.
         $this->user->address = 'Test address';
         $this->user->aim = '999999999';
         $sink = $this->redirectEmails();
+        profile_save_data((object)array('id' => $this->user->id, 'profile_field_newfield' => 'X'));
         user_update_user($this->user, false);
         $this->assertCount(1, $sink->get_messages());
         $sink->close();
index 9fe64c9..2183370 100644 (file)
@@ -104,6 +104,23 @@ class block_html extends block_base {
         return true;
     }
 
+    /**
+     * Copy any block-specific data when copying to a new block instance.
+     * @param int $fromid the id number of the block instance to copy from
+     * @return boolean
+     */
+    public function instance_copy($fromid) {
+        $fromcontext = context_block::instance($fromid);
+        $fs = get_file_storage();
+        // This extra check if file area is empty adds one query if it is not empty but saves several if it is.
+        if (!$fs->is_area_empty($fromcontext->id, 'block_html', 'content', 0, false)) {
+            $draftitemid = 0;
+            file_prepare_draft_area($draftitemid, $fromcontext->id, 'block_html', 'content', 0, array('subdirs' => true));
+            file_save_draft_area_files($draftitemid, $this->context->id, 'block_html', 'content', 0, array('subdirs' => true));
+        }
+        return true;
+    }
+
     function content_is_trusted() {
         global $SCRIPT;
 
index 2851ae7..ed80f7b 100644 (file)
@@ -6,9 +6,9 @@ Feature: Block tags displaying tag cloud
 
   Background:
     Given the following "users" exist:
-      | username | firstname | lastname | email |
-      | teacher1 | Teacher | 1 | teacher1@example.com |
-      | student1 | Student | 1 | student1@example.com |
+      | username | firstname | lastname | email | interests |
+      | teacher1 | Teacher | 1 | teacher1@example.com | Dogs, Cats |
+      | student1 | Student | 1 | student1@example.com | |
     And the following "courses" exist:
       | fullname  | shortname |
       | Course 1  | c1        |
@@ -19,13 +19,6 @@ Feature: Block tags displaying tag cloud
       | user     | course | role           |
       | teacher1 | c1     | editingteacher |
       | student1 | c1     | student        |
-    And I log in as "teacher1"
-    And I follow "Preferences" in the user menu
-    And I follow "Edit profile"
-    And I expand all fieldsets
-    And I set the field "Enter tags separated by commas" to "Dogs, Cats"
-    And I press "Update profile"
-    And I log out
 
   Scenario: Add Tags block on a front page
     When I log in as "admin"
index e859cac..5c51578 100644 (file)
@@ -256,15 +256,17 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
     $groupbysql = '';
     $havingsql = '';
     if ($withmembers) {
-        $groupbysql = " GROUP BY $fieldssql";
+        $fieldssql .= ', s.memberscnt';
+        $subfields = "c.id, COUNT(DISTINCT cm.userid) AS memberscnt";
+        $groupbysql = " GROUP BY c.id";
         $fromsql = " LEFT JOIN {cohort_members} cm ON cm.cohortid = c.id ";
-        $fieldssql .= ', COUNT(DISTINCT cm.userid) AS memberscnt';
         if (in_array($withmembers,
                 array(COHORT_COUNT_ENROLLED_MEMBERS, COHORT_WITH_ENROLLED_MEMBERS_ONLY, COHORT_WITH_NOTENROLLED_MEMBERS_ONLY))) {
             list($esql, $params2) = get_enrolled_sql($currentcontext);
             $fromsql .= " LEFT JOIN ($esql) u ON u.id = cm.userid ";
             $params = array_merge($params2, $params);
-            $fieldssql .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
+            $fieldssql .= ', s.enrolledcnt';
+            $subfields .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
         }
         if ($withmembers == COHORT_WITH_MEMBERS_ONLY) {
             $havingsql = " HAVING COUNT(DISTINCT cm.userid) > 0";
@@ -280,13 +282,20 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
         $params = array_merge($params, $searchparams);
     }
 
-    $sql = "SELECT $fieldssql
-              FROM {cohort} c
-              $fromsql
-             WHERE $wheresql
-             $groupbysql
-             $havingsql
-          ORDER BY c.name, c.idnumber";
+    if ($withmembers) {
+        $sql = "SELECT " . str_replace('c.', 'cohort.', $fieldssql) . "
+                  FROM {cohort} cohort
+                  JOIN (SELECT $subfields
+                          FROM {cohort} c $fromsql
+                         WHERE $wheresql $groupbysql $havingsql
+                        ) s ON cohort.id = s.id
+              ORDER BY cohort.name, cohort.idnumber";
+    } else {
+        $sql = "SELECT $fieldssql
+                  FROM {cohort} c $fromsql
+                 WHERE $wheresql
+              ORDER BY c.name, c.idnumber";
+    }
 
     return $DB->get_records_sql($sql, $params, $offset, $limit);
 }
index dcbad6b..c32b0b1 100644 (file)
@@ -152,7 +152,8 @@ class core_completion_external extends external_api {
         $params = self::validate_parameters(self::get_activities_completion_status_parameters(), $arrayparams);
 
         $course = get_course($params['courseid']);
-        $user = core_user::get_user($params['userid'], 'id', MUST_EXIST);
+        $user = core_user::get_user($params['userid'], '*', MUST_EXIST);
+        core_user::require_active_user($user);
 
         $context = context_course::instance($course->id);
         self::validate_context($context);
@@ -270,7 +271,9 @@ class core_completion_external extends external_api {
         $params = self::validate_parameters(self::get_course_completion_status_parameters(), $arrayparams);
 
         $course = get_course($params['courseid']);
-        $user = core_user::get_user($params['userid'], 'id', MUST_EXIST);
+        $user = core_user::get_user($params['userid'], '*', MUST_EXIST);
+        core_user::require_active_user($user);
+
         $context = context_course::instance($course->id);
         self::validate_context($context);
 
index 26e49e4..505413d 100644 (file)
@@ -1,7 +1,7 @@
 {
     "require-dev": {
-        "phpunit/phpunit": "4.7.*",
+        "phpunit/phpunit": "4.8.*",
         "phpunit/dbUnit": "1.4.*",
-        "moodlehq/behat-extension": "1.30.0"
+        "moodlehq/behat-extension": "1.30.1"
     }
 }
index 719ac08..44a7f2f 100644 (file)
@@ -4,32 +4,33 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "a85d8c9e61ccba5e235093157021f7b5",
+    "hash": "85888280993254379afb3dd9a13fbf48",
+    "content-hash": "2660fb1bd1498fa3f4f106caede044f4",
     "packages": [],
     "packages-dev": [
         {
             "name": "behat/behat",
-            "version": "v2.5.3",
+            "version": "v2.5.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Behat/Behat.git",
-                "reference": "c3a105a3c0457df919879c72b63b910e63739e51"
+                "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Behat/Behat/zipball/c3a105a3c0457df919879c72b63b910e63739e51",
-                "reference": "c3a105a3c0457df919879c72b63b910e63739e51",
+                "url": "https://api.github.com/repos/Behat/Behat/zipball/c1e48826b84669c97a1efa78459aedfdcdcf2120",
+                "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120",
                 "shasum": ""
             },
             "require": {
                 "behat/gherkin": "~2.3.0",
                 "php": ">=5.3.1",
-                "symfony/config": "~2.0",
+                "symfony/config": "~2.3",
                 "symfony/console": "~2.0",
                 "symfony/dependency-injection": "~2.0",
                 "symfony/event-dispatcher": "~2.0",
                 "symfony/finder": "~2.0",
-                "symfony/translation": "~2.0",
+                "symfony/translation": "~2.3",
                 "symfony/yaml": "~2.0"
             },
             "require-dev": {
@@ -67,7 +68,7 @@
                 "Behat",
                 "Symfony2"
             ],
-            "time": "2014-04-26 16:55:16"
+            "time": "2015-06-01 09:37:55"
         },
         {
             "name": "behat/gherkin",
         },
         {
             "name": "behat/mink-extension",
-            "version": "v1.2.0",
+            "version": "v1.3.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Behat/MinkExtension.git",
-                "reference": "0b7223826341fad69b4600afe27722d2a2f9a306"
+                "reference": "b885b9407cba50a954f72c69ed1b2f8d3bc694f8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/0b7223826341fad69b4600afe27722d2a2f9a306",
-                "reference": "0b7223826341fad69b4600afe27722d2a2f9a306",
+                "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/b885b9407cba50a954f72c69ed1b2f8d3bc694f8",
+                "reference": "b885b9407cba50a954f72c69ed1b2f8d3bc694f8",
                 "shasum": ""
             },
             "require": {
                 "behat/behat": "~2.5.0",
-                "behat/mink": ">=1.4.3,<1.6-dev",
-                "php": ">=5.3.2"
+                "behat/mink": "~1.5",
+                "php": ">=5.3.2",
+                "symfony/config": "~2.2"
             },
             "require-dev": {
-                "behat/mink-goutte-driver": "~1.0"
+                "behat/mink-goutte-driver": "~1.0",
+                "fabpot/goutte": "~1.0"
             },
             "type": "behat-extension",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.1.x-dev"
-                }
-            },
             "autoload": {
                 "psr-0": {
                     "Behat\\MinkExtension": "src/"
                 "test",
                 "web"
             ],
-            "time": "2013-08-17 19:01:06"
+            "time": "2014-05-15 19:27:39"
         },
         {
             "name": "behat/mink-goutte-driver",
             "time": "2013-06-02 19:09:45"
         },
         {
-            "name": "doctrine/annotations",
-            "version": "v1.2.6",
+            "name": "doctrine/instantiator",
+            "version": "1.0.5",
             "source": {
                 "type": "git",
-                "url": "https://github.com/doctrine/annotations.git",
-                "reference": "f4a91702ca3cd2e568c3736aa031ed00c3752af4"
+                "url": "https://github.com/doctrine/instantiator.git",
+                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/annotations/zipball/f4a91702ca3cd2e568c3736aa031ed00c3752af4",
-                "reference": "f4a91702ca3cd2e568c3736aa031ed00c3752af4",
+                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
+                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
                 "shasum": ""
             },
             "require": {
-                "doctrine/lexer": "1.*",
-                "php": ">=5.3.2"
+                "php": ">=5.3,<8.0-DEV"
             },
             "require-dev": {
-                "doctrine/cache": "1.*",
-                "phpunit/phpunit": "4.*"
+                "athletic/athletic": "~0.1.8",
+                "ext-pdo": "*",
+                "ext-phar": "*",
+                "phpunit/phpunit": "~4.0",
+                "squizlabs/php_codesniffer": "~2.0"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.3.x-dev"
+                    "dev-master": "1.0.x-dev"
                 }
             },
             "autoload": {
-                "psr-0": {
-                    "Doctrine\\Common\\Annotations\\": "lib/"
+                "psr-4": {
+                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
             ],
             "authors": [
                 {
-                    "name": "Roman Borschel",
-                    "email": "roman@code-factory.org"
-                },
-                {
-                    "name": "Benjamin Eberlei",
-                    "email": "kontakt@beberlei.de"
-                },
-                {
-                    "name": "Guilherme Blanco",
-                    "email": "guilhermeblanco@gmail.com"
-                },
-                {
-                    "name": "Jonathan Wage",
-                    "email": "jonwage@gmail.com"
-                },
-                {
-                    "name": "Johannes Schmitt",
-                    "email": "schmittjoh@gmail.com"
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "homepage": "http://ocramius.github.com/"
                 }
             ],
-            "description": "Docblock Annotations Parser",
-            "homepage": "http://www.doctrine-project.org",
+            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+            "homepage": "https://github.com/doctrine/instantiator",
             "keywords": [
-                "annotations",
-                "docblock",
-                "parser"
+                "constructor",
+                "instantiate"
             ],
-            "time": "2015-06-17 12:21:22"
+            "time": "2015-06-14 21:17:01"
         },
         {
-            "name": "doctrine/cache",
-            "version": "v1.4.1",
+            "name": "fabpot/goutte",
+            "version": "v1.0.7",
             "source": {
                 "type": "git",
-                "url": "https://github.com/doctrine/cache.git",
-                "reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03"
+                "url": "https://github.com/FriendsOfPHP/Goutte.git",
+                "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/cache/zipball/c9eadeb743ac6199f7eec423cb9426bc518b7b03",
-                "reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03",
+                "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/794b196e76bdd37b5155cdecbad311f0a3b07625",
+                "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625",
                 "shasum": ""
             },
             "require": {
-                "php": ">=5.3.2"
-            },
-            "conflict": {
-                "doctrine/common": ">2.2,<2.4"
+                "ext-curl": "*",
+                "guzzle/http": "~3.1",
+                "php": ">=5.3.0",
+                "symfony/browser-kit": "~2.1",
+                "symfony/css-selector": "~2.1",
+                "symfony/dom-crawler": "~2.1",
+                "symfony/finder": "~2.1",
+                "symfony/process": "~2.1"
             },
             "require-dev": {
-                "phpunit/phpunit": ">=3.7",
-                "predis/predis": "~1.0",
-                "satooshi/php-coveralls": "~0.6"
+                "guzzle/plugin-history": "~3.1",
+                "guzzle/plugin-mock": "~3.1"
             },
-            "type": "library",
+            "type": "application",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.5.x-dev"
+                    "dev-master": "1.0-dev"
                 }
             },
             "autoload": {
                 "psr-0": {
-                    "Doctrine\\Common\\Cache\\": "lib/"
+                    "Goutte": "."
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
             ],
             "authors": [
                 {
-                    "name": "Roman Borschel",
-                    "email": "roman@code-factory.org"
-                },
-                {
-                    "name": "Benjamin Eberlei",
-                    "email": "kontakt@beberlei.de"
-                },
-                {
-                    "name": "Guilherme Blanco",
-                    "email": "guilhermeblanco@gmail.com"
-                },
-                {
-                    "name": "Jonathan Wage",
-                    "email": "jonwage@gmail.com"
-                },
-                {
-                    "name": "Johannes Schmitt",
-                    "email": "schmittjoh@gmail.com"
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
                 }
             ],
-            "description": "Caching library offering an object-oriented API for many cache backends",
-            "homepage": "http://www.doctrine-project.org",
+            "description": "A simple PHP Web Scraper",
+            "homepage": "https://github.com/fabpot/Goutte",
             "keywords": [
-                "cache",
-                "caching"
+                "scraper"
             ],
-            "time": "2015-04-15 00:11:59"
+            "time": "2014-10-09 15:52:51"
         },
         {
-            "name": "doctrine/collections",
-            "version": "v1.3.0",
+            "name": "guzzlehttp/guzzle",
+            "version": "v3.8.1",
             "source": {
                 "type": "git",
-                "url": "https://github.com/doctrine/collections.git",
-                "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
+                "url": "https://github.com/guzzle/guzzle.git",
+                "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
-                "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba",
+                "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba",
                 "shasum": ""
             },
             "require": {
-                "php": ">=5.3.2"
+                "ext-curl": "*",
+                "php": ">=5.3.3",
+                "symfony/event-dispatcher": ">=2.1"
+            },
+            "replace": {
+                "guzzle/batch": "self.version",
+                "guzzle/cache": "self.version",
+                "guzzle/common": "self.version",
+                "guzzle/http": "self.version",
+                "guzzle/inflection": "self.version",
+                "guzzle/iterator": "self.version",
+                "guzzle/log": "self.version",
+                "guzzle/parser": "self.version",
+                "guzzle/plugin": "self.version",
+                "guzzle/plugin-async": "self.version",
+                "guzzle/plugin-backoff": "self.version",
+                "guzzle/plugin-cache": "self.version",
+                "guzzle/plugin-cookie": "self.version",
+                "guzzle/plugin-curlauth": "self.version",
+                "guzzle/plugin-error-response": "self.version",
+                "guzzle/plugin-history": "self.version",
+                "guzzle/plugin-log": "self.version",
+                "guzzle/plugin-md5": "self.version",
+                "guzzle/plugin-mock": "self.version",
+                "guzzle/plugin-oauth": "self.version",
+                "guzzle/service": "self.version",
+                "guzzle/stream": "self.version"
             },
             "require-dev": {
-                "phpunit/phpunit": "~4.0"
+                "doctrine/cache": "*",
+                "monolog/monolog": "1.*",
+                "phpunit/phpunit": "3.7.*",
+                "psr/log": "1.0.*",
+                "symfony/class-loader": "*",
+                "zendframework/zend-cache": "<2.3",
+                "zendframework/zend-log": "<2.3"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.2.x-dev"
+                    "dev-master": "3.8-dev"
                 }
             },
             "autoload": {
                 "psr-0": {
-                    "Doctrine\\Common\\Collections\\": "lib/"
+                    "Guzzle": "src/",
+                    "Guzzle\\Tests": "tests/"
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
             ],
             "authors": [
                 {
-                    "name": "Roman Borschel",
-                    "email": "roman@code-factory.org"
-                },
-                {
-                    "name": "Benjamin Eberlei",
-                    "email": "kontakt@beberlei.de"
-                },
-                {
-                    "name": "Guilherme Blanco",
-                    "email": "guilhermeblanco@gmail.com"
-                },
-                {
-                    "name": "Jonathan Wage",
-                    "email": "jonwage@gmail.com"
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
                 },
                 {
-                    "name": "Johannes Schmitt",
-                    "email": "schmittjoh@gmail.com"
+                    "name": "Guzzle Community",
+                    "homepage": "https://github.com/guzzle/guzzle/contributors"
                 }
             ],
-            "description": "Collections Abstraction library",
-            "homepage": "http://www.doctrine-project.org",
+            "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
+            "homepage": "http://guzzlephp.org/",
             "keywords": [
-                "array",
-                "collections",
-                "iterator"
+                "client",
+                "curl",
+                "framework",
+                "http",
+                "http client",
+                "rest",
+                "web service"
             ],
-            "time": "2015-04-14 22:21:58"
+            "time": "2014-01-28 22:29:15"
         },
         {
-            "name": "doctrine/common",
-            "version": "v2.5.0",
+            "name": "instaclick/php-webdriver",
+            "version": "1.0.17",
             "source": {
                 "type": "git",
-                "url": "https://github.com/doctrine/common.git",
-                "reference": "cd8daf2501e10c63dced7b8b9b905844316ae9d3"
+                "url": "https://github.com/instaclick/php-webdriver.git",
+                "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/common/zipball/cd8daf2501e10c63dced7b8b9b905844316ae9d3",
-                "reference": "cd8daf2501e10c63dced7b8b9b905844316ae9d3",
+                "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/47a6019553a7a5b42d35493276ffc2c9252c53d5",
+                "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5",
                 "shasum": ""
             },
             "require": {
-                "doctrine/annotations": "1.*",
-                "doctrine/cache": "1.*",
-                "doctrine/collections": "1.*",
-                "doctrine/inflector": "1.*",
-                "doctrine/lexer": "1.*",
+                "ext-curl": "*",
                 "php": ">=5.3.2"
             },
-            "require-dev": {
-                "phpunit/phpunit": "~3.7"
-            },
+            "bin": [
+                "bin/webunit"
+            ],
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "2.6.x-dev"
+                    "dev-master": "1.0.x-dev"
                 }
             },
             "autoload": {
                 "psr-0": {
-                    "Doctrine\\Common\\": "lib/"
+                    "WebDriver": "lib/"
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
-                "MIT"
+                "Apache-2.0"
             ],
             "authors": [
                 {
-                    "name": "Roman Borschel",
-                    "email": "roman@code-factory.org"
-                },
-                {
-                    "name": "Benjamin Eberlei",
-                    "email": "kontakt@beberlei.de"
-                },
-                {
-                    "name": "Guilherme Blanco",
-                    "email": "guilhermeblanco@gmail.com"
-                },
-                {
-                    "name": "Jonathan Wage",
-                    "email": "jonwage@gmail.com"
+                    "name": "Justin Bishop",
+                    "email": "jubishop@gmail.com",
+                    "role": "Developer"
                 },
                 {
-                    "name": "Johannes Schmitt",
-                    "email": "schmittjoh@gmail.com"
+                    "name": "Anthon Pang",
+                    "email": "apang@softwaredevelopment.ca",
+                    "role": "developer"
                 }
             ],
-            "description": "Common Library for Doctrine projects",
-            "homepage": "http://www.doctrine-project.org",
+            "description": "PHP WebDriver for Selenium 2",
+            "homepage": "http://instaclick.com/",
             "keywords": [
-                "annotations",
-                "collections",
-                "eventmanager",
-                "persistence",
-                "spl"
+                "browser",
+                "selenium",
+                "webdriver",
+                "webtest"
             ],
-            "time": "2015-04-02 19:55:44"
+            "time": "2013-10-04 15:03:51"
         },
         {
-            "name": "doctrine/inflector",
-            "version": "v1.0.1",
+            "name": "moodlehq/behat-extension",
+            "version": "v1.30.1",
             "source": {
                 "type": "git",
-                "url": "https://github.com/doctrine/inflector.git",
-                "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604"
+                "url": "https://github.com/moodlehq/moodle-behat-extension.git",
+                "reference": "7882d9331de46327c430b1572111e722378ab941"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604",
-                "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604",
+                "url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/7882d9331de46327c430b1572111e722378ab941",
+                "reference": "7882d9331de46327c430b1572111e722378ab941",
                 "shasum": ""
             },
             "require": {
-                "php": ">=5.3.2"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "4.*"
+                "behat/behat": "2.5.5",
+                "behat/mink": "1.5.0",
+                "behat/mink-extension": "1.3.3",
+                "behat/mink-goutte-driver": "1.0.9",
+                "behat/mink-selenium2-driver": "1.1.1",
+                "guzzlehttp/guzzle": "~3.1",
+                "php": ">=5.4.4",
+                "symfony/browser-kit": "2.7.5",
+                "symfony/css-selector": "2.7.5",
+                "symfony/dom-crawler": "2.7.5",
+                "symfony/finder": "2.7.5"
             },
             "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0.x-dev"
-                }
-            },
             "autoload": {
                 "psr-0": {
-                    "Doctrine\\Common\\Inflector\\": "lib/"
+                    "Moodle\\BehatExtension": "src/"
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
-                "MIT"
+                "GPLv3"
             ],
             "authors": [
                 {
-                    "name": "Roman Borschel",
-                    "email": "roman@code-factory.org"
-                },
-                {
-                    "name": "Benjamin Eberlei",
-                    "email": "kontakt@beberlei.de"
-                },
-                {
-                    "name": "Guilherme Blanco",
-                    "email": "guilhermeblanco@gmail.com"
-                },
-                {
-                    "name": "Jonathan Wage",
-                    "email": "jonwage@gmail.com"
-                },
-                {
-                    "name": "Johannes Schmitt",
-                    "email": "schmittjoh@gmail.com"
+                    "name": "David MonllaĆ³",
+                    "email": "david.monllao@gmail.com",
+                    "homepage": "http://moodle.com",
+                    "role": "Developer"
                 }
             ],
-            "description": "Common String Manipulations with regard to casing and singular/plural rules.",
-            "homepage": "http://www.doctrine-project.org",
+            "description": "Moodle behat extension",
             "keywords": [
-                "inflection",
-                "pluralize",
-                "singularize",
-                "string"
+                "BDD",
+                "Behat",
+                "moodle"
             ],
-            "time": "2014-12-20 21:24:13"
+            "time": "2015-10-06 02:38:45"
         },
         {
-            "name": "doctrine/instantiator",
-            "version": "1.0.5",
+            "name": "phpdocumentor/reflection-docblock",
+            "version": "2.0.4",
             "source": {
                 "type": "git",
-                "url": "https://github.com/doctrine/instantiator.git",
-                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
+                "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+                "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
-                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
+                "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
+                "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
                 "shasum": ""
             },
             "require": {
-                "php": ">=5.3,<8.0-DEV"
+                "php": ">=5.3.3"
             },
             "require-dev": {
-                "athletic/athletic": "~0.1.8",
-                "ext-pdo": "*",
-                "ext-phar": "*",
-                "phpunit/phpunit": "~4.0",
-                "squizlabs/php_codesniffer": "~2.0"
+                "phpunit/phpunit": "~4.0"
+            },
+            "suggest": {
+                "dflydev/markdown": "~1.0",
+                "erusev/parsedown": "~1.0"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.0.x-dev"
+                    "dev-master": "2.0.x-dev"
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+                "psr-0": {
+                    "phpDocumentor": [
+                        "src/"
+                    ]
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
@@