Now maxeditingtime for entries work againt timecreated instead of timemodified.

Thanks skodak!

Bug 1822
(http://moodle.org/bugs/bug.php?op=show&bugid=1822)

Merged from MOODLE_14_STABLE
This commit is contained in:
stronk7 2004-08-28 10:56:42 +00:00
parent 0083049b21
commit 516c7276e5
2 changed files with 2 additions and 2 deletions

View file

@ -252,7 +252,7 @@ print_header_simple(strip_tags("$glossary->name"), "",
<A HREF=\"view.php?id=$cm->id\">$glossary->name</A> -> $stredit", "",
"", true, "", navmenu($course, $cm));
$ineditperiod = ((time() - $newentry->timemodified < $CFG->maxeditingtime) || $glossary->editalways);
$ineditperiod = ((time() - $newentry->timecreated < $CFG->maxeditingtime) || $glossary->editalways);
if ( (!$ineditperiod || $USER->id != $newentry->userid) and !isteacher($course->id) and $e) {
if ( $USER->id != $newentry->userid ) {
error("You can't edit other people's entries!");

View file

@ -710,7 +710,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$ho
//Decide if an entry is editable:
// -It isn't a imported entry (so nobody can edit a imported (from secondary to main) entry)) and
// -The user is teacher or he is a student with time permissions (edit period or editalways defined).
$ineditperiod = ((time() - $entry->timemodified < $CFG->maxeditingtime) || $glossary->editalways);
$ineditperiod = ((time() - $entry->timecreated < $CFG->maxeditingtime) || $glossary->editalways);
if ( !$importedentry and ($isteacher or ($entry->userid == $USER->id and $ineditperiod))) {
$return .= " <a title=\"" . get_string("delete") . "\" href=\"deleteentry.php?id=$cm->id&mode=delete&entry=$entry->id&prevmode=$mode&hook=$hook\"><img src=\"";
$return .= $icon;