mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'MDL-79139-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE
This commit is contained in:
commit
bc67d4491c
@ -220,6 +220,7 @@ $string['customrolename_help'] = 'Names of standard roles are localised automati
|
||||
$string['defaultrole'] = 'Default role';
|
||||
$string['defaultx'] = 'Default: {$a}';
|
||||
$string['defineroles'] = 'Define roles';
|
||||
$string['definitionofrolex'] = 'Definition of role \'{$a}\'';
|
||||
$string['deletecourseoverrides'] = 'Delete all overrides in course';
|
||||
$string['deletelocalroles'] = 'Delete all local role assignments';
|
||||
$string['deleterolesure'] = '<p>Are you sure that you want to delete role "{$a->name} ({$a->shortname})"?</p><p>Currently this role is assigned to {$a->count} users.</p>';
|
||||
|
@ -14,26 +14,16 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Verifies sanity of default user role.
|
||||
*
|
||||
* @package core
|
||||
* @category check
|
||||
* @copyright 2020 Brendan Heywood <brendan@catalyst-au.net>
|
||||
* @copyright 2008 petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core\check\access;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core\check\check;
|
||||
use core\check\result;
|
||||
|
||||
/**
|
||||
* Verifies sanity of default user role.
|
||||
*
|
||||
* @package core
|
||||
* @category check
|
||||
* @copyright 2020 Brendan Heywood <brendan@catalyst-au.net>
|
||||
* @copyright 2008 petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@ -55,10 +45,14 @@ class defaultuserrole extends check {
|
||||
* @return action_link|null
|
||||
*/
|
||||
public function get_action_link(): ?\action_link {
|
||||
global $CFG;
|
||||
global $CFG, $DB;
|
||||
|
||||
$defaultrole = $DB->get_record('role', ['id' => $CFG->defaultuserroleid]);
|
||||
|
||||
return new \action_link(
|
||||
new \moodle_url('/admin/roles/define.php?action=view&roleid=' . $CFG->defaultuserroleid),
|
||||
get_string('userpolicies', 'admin'));
|
||||
new \moodle_url('/admin/roles/define.php', ['action' => 'view', 'roleid' => $defaultrole->id]),
|
||||
get_string('definitionofrolex', 'core_role', role_get_name($defaultrole))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user