Skip to content

Commit

Permalink
Merge branch 'wip-mdl-40469' of git://github.com/rajeshtaneja/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Aug 6, 2013
2 parents 206f18c + c597ff3 commit 2ad4a76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions grade/export/grade_export_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ function definition() {
$mform->addElement('text', 'iprestriction', get_string('keyiprestriction', 'userkey'), array('size'=>80));
$mform->addHelpButton('iprestriction', 'keyiprestriction', 'userkey');
$mform->setDefault('iprestriction', getremoteaddr()); // own IP - just in case somebody does not know what user key is
$mform->setType('iprestriction', PARAM_RAW_TRIMMED);

$mform->addElement('date_time_selector', 'validuntil', get_string('keyvaliduntil', 'userkey'), array('optional'=>true));
$mform->addHelpButton('validuntil', 'keyvaliduntil', 'userkey');
$mform->setDefault('validuntil', time()+3600*24*7); // only 1 week default duration - just in case somebody does not know what user key is
$mform->setType('validuntil', PARAM_INT);

$mform->disabledIf('iprestriction', 'key', 'noteq', 1);
$mform->disabledIf('validuntil', 'key', 'noteq', 1);
Expand Down
3 changes: 3 additions & 0 deletions grade/export/key_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ function definition () {

$mform->addElement('static', 'value', get_string('keyvalue', 'userkey'));
$mform->addElement('text', 'iprestriction', get_string('keyiprestriction', 'userkey'), array('size'=>80));
$mform->setType('iprestriction', PARAM_RAW_TRIMMED);

$mform->addElement('date_time_selector', 'validuntil', get_string('keyvaliduntil', 'userkey'), array('optional'=>true));
$mform->setType('validuntil', PARAM_INT);

$mform->addHelpButton('iprestriction', 'keyiprestriction', 'userkey');
$mform->addHelpButton('validuntil', 'keyvaliduntil', 'userkey');
Expand Down
1 change: 1 addition & 0 deletions grade/import/key_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function definition () {

$mform->addHelpButton('iprestriction', 'keyiprestriction', 'userkey');
$mform->addHelpButton('validuntil', 'keyvaliduntil', 'userkey');
$mform->setType('iprestriction', PARAM_RAW_TRIMMED);

$mform->addElement('hidden','id');
$mform->setType('id', PARAM_INT);
Expand Down

0 comments on commit 2ad4a76

Please sign in to comment.