Skip to content

Commit

Permalink
MDL-23613 fixed wrong page set up
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 2, 2010
1 parent e00d996 commit 470f4c3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions user/managetoken.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@

require('../config.php');

require_login();
require_sesskey();

$usercontext = get_context_instance(CONTEXT_USER, $USER->id);

$PAGE->set_context($usercontext);
$PAGE->set_url('/user/managetoken.php');
$PAGE->set_title(get_string('securitykeys', 'webservice'));
$PAGE->set_heading(get_string('securitykeys', 'webservice'));
$PAGE->set_context(get_system_context());
$PAGE->set_pagelayout('standard');

require_login();
require_sesskey();

$rsstokenboxhtml = $webservicetokenboxhtml = '';
/// Manage user web service tokens
if ( !is_siteadmin($USER->id)
if ( !is_siteadmin($USER->id)
&& !empty($CFG->enablewebservices)
&& has_capability('moodle/webservice:createtoken', get_system_context() )) {
require($CFG->dirroot.'/webservice/lib.php');
Expand All @@ -57,7 +60,7 @@
} else {
/// Delete the token that need to be regenerated
$webservice->delete_user_ws_token($tokenid);
}
}
}

//no point creating the table is we're just displaying a confirmation screen
Expand Down

0 comments on commit 470f4c3

Please sign in to comment.