Permalink
Browse files

Merge branch 'master' into install_master

  • Loading branch information...
AMOS bot
AMOS bot committed Jul 27, 2013
2 parents 6ff2ebd + bdd045c commit 7081e477f243c2d8e1958d78123d9a755d88957b
Showing 313 changed files with 12,696 additions and 5,753 deletions.
View
@@ -188,6 +188,7 @@
//Database types
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
+ 'mariadb'=> moodle_database::get_driver_instance('mariadb', 'native'),
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
'oci' => moodle_database::get_driver_instance('oci', 'native'),
'sqlsrv' => moodle_database::get_driver_instance('sqlsrv', 'native'), // MS SQL*Server PHP driver
@@ -394,8 +395,9 @@
cli_error(get_string('pathserrcreatedataroot', 'install', $a));
}
}
-$CFG->tempdir = $CFG->dataroot.'/temp';
-$CFG->cachedir = $CFG->dataroot.'/cache';
+$CFG->tempdir = $CFG->dataroot.'/temp';
+$CFG->cachedir = $CFG->dataroot.'/cache';
+$CFG->localcachedir = $CFG->dataroot.'/localcache';
// download required lang packs
if ($CFG->lang !== 'en') {
View
@@ -899,6 +899,7 @@
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
+ <VENDOR name="mariadb" version="5.3.5" />
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
@@ -957,6 +958,8 @@
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
+ <PHP_EXTENSION name="zlib" level="optional">
+ </PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
@@ -182,7 +182,8 @@
'128M' => '128M',
'256M' => '256M',
'512M' => '512M',
- '1024M' => '1024M'
+ '1024M' => '1024M',
+ '2048M' => '2048M',
)));
$temp->add(new admin_setting_configtext('curlcache', new lang_string('curlcache', 'admin'),
new lang_string('configcurlcache', 'admin'), 120, PARAM_INT));
@@ -62,7 +62,7 @@ public function i_set_the_following_administration_settings_values(TableNode $ta
}
// Search by label.
- $searchbox = $this->find_field('Search in settings');
+ $searchbox = $this->find_field(get_string('searchinsettings', 'admin'));
$searchbox->setValue($label);
$submitsearch = $this->find('css', 'form.adminsearchform input[type=submit]');
$submitsearch->press();
@@ -72,8 +72,12 @@ public function i_set_the_following_administration_settings_values(TableNode $ta
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
$exception = new ElementNotFoundException($this->getSession(), '"' . $label . '" administration setting ');
+
+ // The argument should be converted to an xpath literal.
+ $label = $this->getSession()->getSelectorsHandler()->xpathLiteral($label);
+
$fieldxpath = "//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]" .
- "[@id=//label[contains(normalize-space(string(.)), '" . $label . "')]/@for]";
+ "[@id=//label[contains(normalize-space(.), $label)]/@for]";
$fieldnode = $this->find('xpath', $fieldxpath, $exception);
$formfieldtypenode = $this->find('xpath', $fieldxpath . "/ancestor::div[@class='form-setting']" .
"/child::div[contains(concat(' ', @class, ' '), ' form-')]/child::*/parent::div");
@@ -90,7 +94,7 @@ public function i_set_the_following_administration_settings_values(TableNode $ta
$field = behat_field_manager::get_field_instance($type, $fieldnode, $this->getSession());
$field->set_value($value);
- $this->find_button('Save changes')->press();
+ $this->find_button(get_string('savechanges'))->press();
}
}
@@ -15,7 +15,7 @@ Feature: Display extended course names
And I should not see "C_shortname Course fullname"
Scenario: Courses list with extended course names
- Given I click on "Courses" "link" in the "//div[@id='settingsnav']//descendant::li[contains(concat(' ', @class, ' '), ' type_setting ')][not(contains(., 'Site administration'))][contains(., 'Appearance')]" "xpath_element"
+ Given I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][not(contains(., 'Site administration'))][contains(., 'Appearance')]" "xpath_element"
And I check "Display extended course names"
When I press "Save changes"
And I am on homepage
@@ -143,6 +143,9 @@
$CFG->{$var} = $CFG->{'behat_' . $var};
}
+// Clean $CFG extra values before performing any action.
+behat_clean_init_config();
+
$CFG->noemailever = true;
$CFG->passwordsaltmain = 'moodle';
@@ -151,6 +154,7 @@
// Unset cache and temp directories to reset them again with the new $CFG->dataroot.
unset($CFG->cachedir);
+unset($CFG->localcachedir);
unset($CFG->tempdir);
// Continues setup.
@@ -41,6 +41,5 @@
$string['viewsteps'] = 'Filter';
$string['wheninfo'] = 'When. Actions that provokes an event';
$string['wrongbehatsetup'] = 'Something is wrong with behat setup, ensure:<ul>
-<li>You ran "curl http://getcomposer.org/installer | php"</li>
-<li>You ran "php composer.phar install --dev"</li>
+<li>You ran "php admin/tool/behat/cli/init.php" from your moodle root directory</li>
<li>vendor/bin/behat file has execution permissions</li></ul>';
@@ -37,13 +37,13 @@ Feature: Page contents assertions
And I follow "Course 1"
When I click on "Move this to the dock" "button" in the ".block_settings" "css_element"
Then I should not see "Question bank"
- And I click on "//div[@id='dock']/descendant::*[contains(., 'Administration')]/h2" "xpath_element"
+ And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element"
@javascript
Scenario: Locators inside specific DOM nodes using XPath
Given the following "courses" exists:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
- When I click on "Move this to the dock" "button" in the "//*[contains(concat(' ', normalize-space(@class), ' '), ' block_settings ')]" "xpath_element"
+ When I click on "Move this to the dock" "button" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' block_settings ')]" "xpath_element"
Then I should not see "Turn editing on"
@@ -30,17 +30,17 @@ Feature: Set up contextual data for tests
Then I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
- When I go to the courses management page
+ And I go to the courses management page
And I follow "Cat 1"
- Then I should see "Cat 2"
+ And I should see "Cat 2"
And I should see "Cat 3"
- When I follow "Cat 3"
- Then I should see "Course 1"
+ And I follow "Cat 3"
+ And I should see "Course 1"
And I should see "Course 2"
- When I select "Cat 2" from "Course categories:"
- Then I should see "No courses in this category"
- When I select "Miscellaneous" from "Course categories:"
- Then I should see "Course 3"
+ And I select "Cat 1 / Cat 2" from "Course categories:"
+ And I should see "No courses in this category"
+ And I select "Miscellaneous" from "Course categories:"
+ And I should see "Course 3"
@javascript
Scenario: Add a bunch of groups and groupings
@@ -79,6 +79,49 @@ Feature: Set up contextual data for tests
And I follow "Course 1"
Then I should see "Topic 1"
+ Scenario: Add role assigns
+ Given the following "users" exists:
+ | username | firstname | lastname | email |
+ | user1 | User | 1 | user1@moodlemoodle.com |
+ | user2 | User | 2 | user2@moodlemoodle.com |
+ | user3 | User | 3 | user3@moodlemoodle.com |
+ And the following "categories" exists:
+ | name | category | idnumber |
+ | Cat 1 | 0 | CAT1 |
+ And the following "courses" exists:
+ | fullname | shortname | category |
+ | Course 1 | C1 | CAT1 |
+ And the following "role assigns" exists:
+ | user | role | contextlevel | reference |
+ | user1 | manager | System | |
+ | user2 | editingteacher | Category | CAT1 |
+ | user3 | editingteacher | Course | C1 |
+ When I log in as "user1"
+ Then I should see "Front page settings"
+ And I log out
+ And I log in as "user2"
+ And I follow "Course 1"
+ And I should see "Turn editing on"
+ And I log out
+ And I log in as "user3"
+ And I follow "Course 1"
+ And I should see "Turn editing on"
+
+ Scenario: Add modules
+ Given the following "courses" exists:
+ | fullname | shortname |
+ | Course 1 | C1 |
+ And the following "activities" exists:
+ | activity | name | intro | course | idnumber |
+ | assign | Test assignment name | Test assignment description | C1 | assign1 |
+ | data | Test database name | Test database description | C1 | data1 |
+ When I log in as "admin"
+ And I follow "Course 1"
+ Then I should see "Test assignment name"
+ And I should see "Test database name"
+ And I follow "Test assignment name"
+ And I should see "Test assignment description"
+
@javascript
Scenario: Add relations between users and groups
Given the following "users" exists:
@@ -323,6 +323,7 @@ protected static function dump_strings($lang, $component, $strings) {
fwrite($f, ";\n");
}
fclose($f);
+ @chmod($filepath, $CFG->filepermissions);
}
/**
@@ -74,12 +74,11 @@
$prevreferences = $DB->get_records_select('profiling',
'url = ? AND runreference = 1 AND timecreated < ?',
array($run->url, $run->timecreated),
- 'timecreated DESC', 'runid', 0, 1);
- $prevrunid = $prevreferences ? reset($prevreferences)->runid : false;
+ 'timecreated DESC', 'runid, runcomment, timecreated', 0, 10);
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
$header = get_string('lastrunof', 'tool_profiling', $script);
echo $OUTPUT->heading($header);
- $table = profiling_print_run($run, $prevrunid);
+ $table = profiling_print_run($run, $prevreferences);
echo $table;
echo $OUTPUT->box_end();
@@ -126,12 +125,11 @@
$prevreferences = $DB->get_records_select('profiling',
'url = ? AND runreference = 1 AND timecreated < ?',
array($run->url, $run->timecreated),
- 'timecreated DESC', 'runid', 0, 1);
- $prevrunid = $prevreferences ? reset($prevreferences)->runid : false;
+ 'timecreated DESC', 'runid, runcomment, timecreated', 0, 10);
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
$header = get_string('summaryof', 'tool_profiling', $run->url);
echo $OUTPUT->heading($header);
- $table = profiling_print_run($run, $prevrunid);
+ $table = profiling_print_run($run, $prevreferences);
echo $table;
echo $OUTPUT->box_end();
@@ -51,5 +51,5 @@
$string['runid'] = 'Run ID';
$string['summaryof'] = 'Summary of {$a}';
$string['viewdetails'] = 'View profiling details';
-$string['viewdiff'] = 'View profiling differences with last reference run';
+$string['viewdiff'] = 'View profiling differences with:';
$string['viewdiffdetails'] = 'View profiling diff details';
@@ -1110,9 +1110,6 @@
if (isset($rowcols['city'])) {
$rowcols['city'] = trim($rowcols['city']);
- if (empty($rowcols['city'])) {
- $rowcols['status'][] = get_string('fieldrequired', 'error', 'city');
- }
}
// Check if rowcols have custom profile field with correct data and update error state.
$noerror = uu_check_custom_profile_data($rowcols) && $noerror;
@@ -257,9 +257,10 @@ function definition () {
} else {
$mform->setDefault('city', $CFG->defaultcity);
}
- $mform->addRule('city', get_string('required'), 'required');
- $mform->addElement('select', 'country', get_string('selectacountry'), get_string_manager()->get_list_of_countries());
+ $choices = get_string_manager()->get_list_of_countries();
+ $choices = array(''=>get_string('selectacountry').'...') + $choices;
+ $mform->addElement('select', 'country', get_string('selectacountry'), $choices);
if (empty($CFG->country)) {
$mform->setDefault('country', $templateuser->country);
} else {
@@ -0,0 +1,110 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * User login event.
+ *
+ * @package core_auth
+ * @copyright 2013 Frédéric Massart
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+namespace core_auth\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * User login event class.
+ *
+ * @package core_auth
+ * @copyright 2013 Frédéric Massart
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class user_loggedin extends \core\event\base {
+
+ /**
+ * Returns localised description of what happened.
+ *
+ * @return \lang_string.
+ */
+ public function get_description() {
+ return new \lang_string('event_user_loggedin_desc', '', $this->get_username());
+ }
+
+ /**
+ * Return legacy data for add_to_log().
+ *
+ * @return array
+ */
+ public function get_legacy_logdata() {
+ return array(SITEID, 'user', 'login', "view.php?id=" . $this->data['objectid'] . "&course=".SITEID,
+ $this->data['objectid'], 0, $this->data['objectid']);
+ }
+
+ /**
+ * Return localised event name.
+ *
+ * @return \lang_string
+ */
+ public static function get_name() {
+ return new \lang_string('event_user_loggedin');
+ }
+
+ /**
+ * Get URL related to the action
+ *
+ * @return \moodle_url
+ */
+ public function get_url() {
+ return new \moodle_url('/user/profile.php', array('id' => $this->data['objectid']));
+ }
+
+ /**
+ * Return the username of the logged in user.
+ *
+ * @return string
+ */
+ public function get_username() {
+ return $this->data['other']['username'];
+ }
+
+ /**
+ * Init method.
+ *
+ * @return void
+ */
+ protected function init() {
+ $this->context = \context_system::instance();
+ $this->data['crud'] = 'r';
+ $this->data['level'] = 50; // TODO MDL-37658.
+ $this->data['objecttable'] = 'user';
+ }
+
+ /**
+ * Custom validation.
+ *
+ * @throws coding_exception when validation does not pass.
+ * @return void
+ */
+ protected function validate_data() {
+ if (!isset($this->data['objectid'])) {
+ throw new \coding_exception("objectid has to be specified.");
+ } else if (!isset($this->data['other']['username'])) {
+ throw new \coding_exception("other['username'] has to be specified.");
+ }
+ }
+
+}
@@ -52,6 +52,7 @@ protected function init_auth_database() {
set_config('sybasequoting', '1', 'auth/db');
break;
+ case 'mariadb_native_moodle_database':
case 'mysqli_native_moodle_database':
set_config('type', 'mysqli', 'auth/db');
set_config('setupsql', "SET NAMES 'UTF-8'", 'auth/db');
Oops, something went wrong.

0 comments on commit 7081e47

Please sign in to comment.