Index: temp_moodle_dev/build.properties =================================================================== diff -u -r33d78407b791ef9f2c48036098186a4d596ef155 -raca9f00eec05f594be36b6397b9c363742db6022 --- temp_moodle_dev/build.properties (.../build.properties) (revision 33d78407b791ef9f2c48036098186a4d596ef155) +++ temp_moodle_dev/build.properties (.../build.properties) (revision aca9f00eec05f594be36b6397b9c363742db6022) @@ -1,3 +1,3 @@ -moodle_dir=/var/www/moodle193 -moodle_db_name=moodle193 +moodle_dir=/var/www/moodle-soe +moodle_db_name=moodle-soe mysql_binary=/usr/bin/mysql \ No newline at end of file Index: temp_moodle_dev/moodle/lib/datalib.php =================================================================== diff -u -r3af3eb545df98ae2c84a96bd2fce2bfedc95860b -raca9f00eec05f594be36b6397b9c363742db6022 --- temp_moodle_dev/moodle/lib/datalib.php (.../datalib.php) (revision 3af3eb545df98ae2c84a96bd2fce2bfedc95860b) +++ temp_moodle_dev/moodle/lib/datalib.php (.../datalib.php) (revision aca9f00eec05f594be36b6397b9c363742db6022) @@ -210,11 +210,14 @@ * @uses SITEID * @deprecated Use {@link get_course_users()} instead. * @param string $fields A comma separated list of fields to be returned from the chosen table. + * @param string $exceptions A comma separated list of user->id to be skiped in the result returned by the function + * @param int $limitfrom return a subset of records, starting at this point (optional, required if $limitnum is set). + * @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set). * @return object|false {@link $USER} records or false if error. */ -function get_site_users($sort='u.lastaccess DESC', $fields='*', $exceptions='') { +function get_site_users($sort='u.lastaccess DESC', $fields='*', $exceptions='', $limitfrom='', $limitnum='') { - return get_course_users(SITEID, $sort, $exceptions, $fields); + return get_course_users(SITEID, $sort, $exceptions, $fields, $limitfrom, $limitnum); } @@ -1017,14 +1020,14 @@ // // Perhaps it's actually visible to $USER - // check moodle/category:visibility + // check moodle/category:viewhiddencategories // // The name isn't obvious, but the description says // "See hidden categories" so the user shall see... // But also check if the allowvisiblecoursesinhiddencategories setting is true, and check for course visibility if ($viscat === false) { $catctx = $cats[$courses[$n]->category]->context; - if (has_capability('moodle/category:visibility', $catctx, $USER->id)) { + if (has_capability('moodle/category:viewhiddencategories', $catctx, $USER->id)) { $vcatpaths[$courses[$n]->categorypath] = true; $viscat = true; } elseif ($CFG->allowvisiblecoursesinhiddencategories && $courses[$n]->visible == true) { @@ -1235,7 +1238,7 @@ if( $rs = get_recordset_sql($sql) ){ while ($cat = rs_fetch_next_record($rs)) { $cat = make_context_subobj($cat); - if ($cat->visible || has_capability('moodle/category:visibility',$cat->context)) { + if ($cat->visible || has_capability('moodle/category:viewhiddencategories',$cat->context)) { $categories[$cat->id] = $cat; } } @@ -1461,7 +1464,7 @@ $userid = $USER->id; } - $sql = "SELECT c.remoteid, c.shortname, c.fullname, + $sql = "SELECT c.id, c.remoteid, c.shortname, c.fullname, c.hostid, c.summary, c.cat_name, h.name AS hostname FROM {$CFG->prefix}mnet_enrol_course c @@ -1613,7 +1616,7 @@ FROM {$CFG->prefix}modules m, {$CFG->prefix}course_modules cm WHERE cm.course = ".intval($courseid)." - AND cm.module = m.id AND m.visible = 1 AND cm.is_lams=0"); // no disabled mods + AND cm.module = m.id AND m.visible = 1 AND cm.is_lams=0"); // no disabled mods } @@ -1689,7 +1692,6 @@ cm.instance = m.id AND md.name = '$modulename' AND md.id = cm.module".(($modulename=="assignment")?" AND m.is_lams = 0":"")); // to show just activities that are created outside Lams (in that case assignments) - //old md.id = cm.module"); } /** @@ -1727,7 +1729,6 @@ cm.section = cw.id AND md.name = '$modulename' AND md.id = cm.module".(($modulename=="quiz"||$modulename=="choice"||$modulename=="glossary"||$modulename=="wiki"||$modulename=="lesson"||$modulename=="scorm"||$modulename=="chat")?" AND m.is_lams = 0":""))) { // to show just activities that are created outside Lams - //old md.id = cm.module")) { return $outputarray; } @@ -1882,6 +1883,9 @@ } $REMOTE_ADDR = getremoteaddr(); + if (empty($REMOTE_ADDR)) { + $REMOTE_ADDR = '0.0.0.0'; + } $timenow = time(); $info = addslashes($info); @@ -2174,7 +2178,7 @@ * we'll save a dbquery * * - If we return false, you'll still need to check if - * the user can has the 'moodle/category:visibility' + * the user can has the 'moodle/category:viewhiddencategories' * capability... * * - Will generate 2 DB calls. @@ -2255,27 +2259,15 @@ if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM))) { return true; - } else { - return (bool) count(get_creatable_categories()); } - -} - -/** - * get the list of categories the current user can create courses in - * @return array - */ -function get_creatable_categories() { - - $creatablecats = array(); if ($cats = get_records('course_categories')) { foreach ($cats as $cat) { if (has_capability('moodle/course:create', get_context_instance(CONTEXT_COURSECAT, $cat->id))) { - $creatablecats[$cat->id] = $cat->name; + return true; } } } - return $creatablecats; + return false; } // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: Index: temp_moodle_dev/moodle/lib/pagelib.php =================================================================== diff -u -r5330c13e294f86a39f3e83ac52fbbe0e5ef2c593 -raca9f00eec05f594be36b6397b9c363742db6022 --- temp_moodle_dev/moodle/lib/pagelib.php (.../pagelib.php) (revision 5330c13e294f86a39f3e83ac52fbbe0e5ef2c593) +++ temp_moodle_dev/moodle/lib/pagelib.php (.../pagelib.php) (revision aca9f00eec05f594be36b6397b9c363742db6022) @@ -633,7 +633,7 @@ function blocks_default_position() { return BLOCK_POS_LEFT; } - //lams: add a new parameter so we can display or not the header depending on if is in a lams sequence or not + function print_header($title, $morenavlinks = NULL, $bodytags = '', $meta = '',$is_lams=null) { global $USER, $CFG; @@ -662,11 +662,11 @@ $morenavlinks = array(); } $navigation = build_navigation($morenavlinks, $this->modulerecord); - if($is_lams==0){ - print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord), false, $bodytags); - }else{ - print_header(); - } + if($is_lams==0){ + print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord), false, $bodytags); + } else { + print_header(); + } } } Index: temp_moodle_dev/moodle/lib/weblib.php =================================================================== diff -u -r90883bda4ec71884bf3ff3d18ec7952b70e6af22 -raca9f00eec05f594be36b6397b9c363742db6022 --- temp_moodle_dev/moodle/lib/weblib.php (.../weblib.php) (revision 90883bda4ec71884bf3ff3d18ec7952b70e6af22) +++ temp_moodle_dev/moodle/lib/weblib.php (.../weblib.php) (revision aca9f00eec05f594be36b6397b9c363742db6022) @@ -101,7 +101,7 @@ */ $ALLOWED_PROTOCOLS = array('http', 'https', 'ftp', 'news', 'mailto', 'rtsp', 'teamspeak', 'gopher', 'mms', 'color', 'callto', 'cursor', 'text-align', 'font-size', 'font-weight', 'font-style', 'font-family', - 'border', 'margin', 'padding', 'background', 'text-decoration'); // CSS as well to get through kses + 'border', 'margin', 'padding', 'background', 'background-color', 'text-decoration'); // CSS as well to get through kses /// Functions @@ -848,7 +848,6 @@ die; } - /** * Given an array of values, output the HTML for a select element with those options. * Normally, you only need to use the first few parameters. @@ -867,9 +866,17 @@ * @param int $tabindex if give, sets the tabindex attribute on the <select> element. Default none. * @param string $id value to use for the id attribute of the <select> element. If none is given, * then a suitable one is constructed. + * @param mixed $listbox if false, display as a dropdown menu. If true, display as a list box. + * By default, the list box will have a number of rows equal to min(10, count($options)), but if + * $listbox is an integer, that number is used for size instead. + * @param boolean $multiple if true, enable multiple selections, else only 1 item can be selected. Used + * when $listbox display is enabled + * @param string $class value to use for the class attribute of the <select> element. If none is given, + * then a suitable one is constructed. */ function choose_from_menu ($options, $name, $selected='', $nothing='choose', $script='', - $nothingvalue='0', $return=false, $disabled=false, $tabindex=0, $id='') { + $nothingvalue='0', $return=false, $disabled=false, $tabindex=0, + $id='', $listbox=false, $multiple=false, $class='') { if ($nothing == 'choose') { $nothing = get_string('choose') .'...'; @@ -886,23 +893,49 @@ if ($id ==='') { $id = 'menu'.$name; - // name may contaion [], which would make an invalid id. e.g. numeric question type editing form, assignment quickgrading + // name may contaion [], which would make an invalid id. e.g. numeric question type editing form, assignment quickgrading $id = str_replace('[', '', $id); $id = str_replace(']', '', $id); } - $output = '' . "\n"; if ($nothing) { $output .= '