From c05877e6be60fa24c77ec5d6f991719debfbd400 Mon Sep 17 00:00:00 2001 From: jerome mouneyrac Date: Mon, 25 Jan 2010 02:43:23 +0000 Subject: [PATCH] webservice MDL-21351 add IP Restriction field to the token list (otherwise no way to see it for the admin) --- lib/adminlib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index e7e9e66c57b..f5f1829aa93 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -6707,12 +6707,13 @@ class admin_setting_managewebservicetokens extends admin_setting { $struser = get_string('user'); $strcontext = get_string('context', 'webservice'); $strvaliduntil = get_string('validuntil', 'webservice'); + $striprestriction = get_string('iprestriction', 'webservice'); $return = $OUTPUT->box_start('generalbox webservicestokenui'); $table = new html_table(); - $table->head = array($strtoken, $struser, $strservice, $strcontext, $strvaliduntil, $stroperation); - $table->align = array('left', 'left', 'left', 'left', 'center'); + $table->head = array($strtoken, $struser, $strservice, $strcontext, $striprestriction, $strvaliduntil, $stroperation); + $table->align = array('left', 'left', 'left', 'center', 'center', 'center', 'center'); $table->width = '100%'; $table->data = array(); @@ -6741,7 +6742,12 @@ class admin_setting_managewebservicetokens extends admin_setting { $validuntil = date("F j, Y"); //TODO: language support (look for moodle function) } - $table->data[] = array($token->token, $token->firstname." ".$token->lastname, $token->name, '', $validuntil, $delete); + $iprestriction = ''; + if (!empty($token->iprestriction)) { + $iprestriction = $token->iprestriction; + } + + $table->data[] = array($token->token, $token->firstname." ".$token->lastname, $token->name, '', $iprestriction, $validuntil, $delete); } $return .= $OUTPUT->table($table);