From 4dfdeb76ddc0e466662ae000f10773afb861eea1 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Thu, 13 May 2010 02:13:06 +0000 Subject: [PATCH] rss MDL-22204 added ability for user to reset their rss token --- lib/navigationlib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 7cd653adffb..e83e46ade65 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2815,8 +2815,16 @@ class settings_navigation extends navigation_node { } } + $enablemanagetokens = false; + if (!empty($CFG->enablerssfeeds)) { + $enablemanagetokens = true; + } else if (!is_siteadmin($USER->id) + && !empty($CFG->enablewebservices) + && has_capability('moodle/webservice:createtoken', get_system_context()) ) { + $enablemanagetokens = true; + } // Security keys - if ($currentuser) { + if ($currentuser && $enablemanagetokens) { $url = new moodle_url('/user/managetoken.php', array('sesskey'=>sesskey())); $usersetting->add(get_string('securitykeys', 'webservice'), $url, self::TYPE_SETTING); }