Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
84dcdbd
)
MDL-24520 use different name if manager role already exists
author
Petr Skoda
<skodak@moodle.org>
Tue, 5 Oct 2010 08:25:58 +0000
(08:25 +0000)
committer
Petr Skoda
<skodak@moodle.org>
Tue, 5 Oct 2010 08:25:58 +0000
(08:25 +0000)
lib/db/upgrade.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/db/upgrade.php
b/lib/db/upgrade.php
index
e648446
..
3b7940a
100644
(file)
--- a/
lib/db/upgrade.php
+++ b/
lib/db/upgrade.php
@@
-2851,9
+2851,16
@@
WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
$role->archetype = substr($role->capability, $substart);
unset($role->capability);
if ($role->archetype === 'admin') {
$role->archetype = substr($role->capability, $substart);
unset($role->capability);
if ($role->archetype === 'admin') {
+ $i = '';
+ if ($DB->record_exists('role', array('shortname'=>'manager'))) {
+ $i = 2;
+ while($DB->record_exists('role', array('shortname'=>'manager'.$i))) {
+ $i++;
+ }
+ }
$role->archetype = 'manager';
if ($role->shortname === 'admin') {
$role->archetype = 'manager';
if ($role->shortname === 'admin') {
- $role->shortname = 'manager';
+ $role->shortname = 'manager'
.$i
;
$role->name = get_string('manager', 'role');
$role->description = get_string('managerdescription', 'role');
}
$role->name = get_string('manager', 'role');
$role->description = get_string('managerdescription', 'role');
}