From 68a4b5d673010b2b738c66fb9fd11469401bd191 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 15 Sep 2006 15:56:05 +0000 Subject: [PATCH] We don't need these any more (obsolete because of role assignment) --- admin/admin.html | 103 ------------------------------------- admin/admin.php | 121 -------------------------------------------- admin/creators.html | 88 -------------------------------- admin/creators.php | 115 ----------------------------------------- 4 files changed, 427 deletions(-) delete mode 100644 admin/admin.html delete mode 100644 admin/admin.php delete mode 100644 admin/creators.html delete mode 100755 admin/creators.php diff --git a/admin/admin.html b/admin/admin.html deleted file mode 100644 index 8a2e575ada..0000000000 --- a/admin/admin.html +++ /dev/null @@ -1,103 +0,0 @@ - -
- - - - - - - - - - - - - -
- count = count($admins); - $a->items = $strexistingadmins; - print_string('counteditems', '', $a); - ?> - - count = $usercount; - $a->items = $strpotentialadmins; - print_string('counteditems', '', $a); - ?> -
- -
- -
- -
-
- -
- - - - '."\n"; - } - ?> -
-
- - diff --git a/admin/admin.php b/admin/admin.php deleted file mode 100644 index 5841ad1ec7..0000000000 --- a/admin/admin.php +++ /dev/null @@ -1,121 +0,0 @@ -wwwroot/$CFG->admin/index.php"); - } - - require_login(); - - require_capability('moodle/user:assign', get_context_instance(CONTEXT_SYSTEM, SITEID)); - - if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); - } - - $primaryadmin = get_admin(); - -/// If you want any administrator to have the ability to assign admin -/// rights, then comment out the following if statement - if ($primaryadmin->id != $USER->id) { - error("You must be the primary administrator to use this page."); - } - -/// assign all of the configurable language strings - $stringstoload = array ( - "assignadmins", - "administration", - "existingadmins", - "potentialadmins", - "search", - "users", - "searchresults", - "showall" - ); - - foreach ($stringstoload as $stringtoload){ - $strstringtoload = "str" . $stringtoload; - $$strstringtoload = get_string($stringtoload); - } - - print_header("$site->shortname: $strassignadmins", - "$site->fullname", - "$stradministration -> $strusers -> $strassignadmins", "adminform.searchtext"); - - - if (!$frm = data_submitted()) { - print_simple_box("
".get_string("adminhelpassignadmins")."
", "center", "50%"); - -/// A form was submitted so process the input - - } else { - if (!empty($frm->add) and !empty($frm->addselect)) { - foreach ($frm->addselect as $addadmin) { - if (! add_admin($addadmin)) { - error("Could not add admin with user id $addadmin!"); - } - } - } else if (!empty($frm->remove) and !empty($frm->removeselect)) { - $admins = get_admins(); - if (count($admins) > count($frm->removeselect)) { - foreach ($frm->removeselect as $removeadmin) { - if (! remove_admin($removeadmin)) { - error("Could not remove admin with user id $removeadmin!"); - } - } - } - } else if (!empty($frm->showall)) { - unset($frm->searchtext); - $frm->previoussearch = 0; - } - } - -/// Is there a current search? - $previoussearch = (!empty($frm->search) or (isset($frm->previoussearch) and $frm->previoussearch == 1)) ; - -/// Get all existing admins - $admins = get_admins(); - - - $adminarray = array(); - foreach ($admins as $admin) { - $adminarray[] = $admin->id; - } - $adminlist = implode(',', $adminarray); - - unset($adminarray); - - $usercount = get_users(false, '', true, $adminlist); - -/// Get search results excluding any current admins - if (!empty($frm->searchtext) and $previoussearch) { - $searchusers = get_users(true, $frm->searchtext, true, $adminlist, 'firstname ASC, lastname ASC', - '', '', 0, MAX_USERS_PER_PAGE, 'id, firstname, lastname, email'); - } - -/// If no search results then get potential users excluding current admins - if (empty($searchusers)) { - $users = array(); - - if ($usercount <= MAX_USERS_PER_PAGE) { - if (!$users = get_users(true, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '', - 0, MAX_USERS_PER_PAGE, 'id, firstname, lastname, email') ) { - $users = array(); - } - } - } - - $searchtext = (isset($frm->searchtext)) ? $frm->searchtext : ""; - $previoussearch = ($previoussearch) ? '1' : '0'; - - include('./admin.html'); - - print_footer(); - -?> diff --git a/admin/creators.html b/admin/creators.html deleted file mode 100644 index 433042d28f..0000000000 --- a/admin/creators.html +++ /dev/null @@ -1,88 +0,0 @@ - -
- - - - - - - - - - - - - -
- count = count($creators); - $a->items = $strexistingcreators; - print_string('counteditems', '', $a); - ?> - - count = $usercount; - $a->items = $strpotentialcreators; - print_string('counteditems', '', $a); - ?> -
- -
- -
- -
-
- -
- - - '."\n"; - } - ?> -
-
- - diff --git a/admin/creators.php b/admin/creators.php deleted file mode 100755 index 567a3662bc..0000000000 --- a/admin/creators.php +++ /dev/null @@ -1,115 +0,0 @@ -wwwroot/$CFG->admin/index.php"); - } - - require_login(); - - require_capability('moodle/user:assign', get_context_instance(CONTEXT_SYSTEM, SITEID)); - - if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); - } - - $primaryadmin = get_admin(); - -/// assign all of the configurable language strings - $stringstoload = array ( - "assigncreators", - "administration", - "existingcreators", - "potentialcreators", - "search", - "users", - "searchresults", - "showall" - ); - - foreach ($stringstoload as $stringtoload){ - $strstringtoload = "str" . $stringtoload; - $$strstringtoload = get_string($stringtoload); - } - - print_header("$site->shortname: $strassigncreators", - "$site->fullname", - "$stradministration -> $strusers -> - $strassigncreators", "creatorsform.searchtext"); - - - if (!$frm = data_submitted()) { - print_simple_box("
".get_string("adminhelpassigncreators")."
", "center", "50%"); - $frm = new object(); - -/// A form was submitted so process the input - - } else { - if (!empty($frm->add) and !empty($frm->addselect)) { - foreach ($frm->addselect as $addcreator) { - if (! add_creator($addcreator)) { - error("Could not add course creator with user id $addcreator!"); - } - } - } else if (!empty($frm->remove) and !empty($frm->removeselect)) { - foreach ($frm->removeselect as $removecreator) { - if (! remove_creator($removecreator)) { - error("Could not remove course creator with user id $removecreator!"); - } - } - } else if (!empty($frm->showall)) { - unset($frm->searchtext); - $frm->previoussearch = 0; - } - } - -/// Is there a current search? - $previoussearch = (!empty($frm->search) or (isset($frm->previoussearch) && $frm->previoussearch == 1)) ; - - -/// Get all existing creators - if (! $creators = get_creators()) { - $creators = array(); - } - - $creatorsarray = array(); - foreach ($creators as $creator) { - $creatorsarray[] = $creator->id; - } - $creatorlist = implode(',', $creatorsarray); - - unset($creatorarray); - - $usercount = get_users(false, '', true, $creatorlist); - -/// Get search results excluding any current admins - if (!empty($frm->searchtext) and $previoussearch) { - $searchusers = get_users(true, $frm->searchtext, true, $creatorlist, 'firstname ASC, lastname ASC', - '', '', 0, MAX_USERS_PER_PAGE, 'id, firstname, lastname, email'); - } - -/// If no search results then get potential users excluding current creators - if (empty($searchusers)) { - $users = array(); - if ($usercount <= MAX_USERS_PER_PAGE) { - if (!$users = get_users(true, '', true, $creatorlist, 'firstname ASC, lastname ASC', '', '', - 0, MAX_USERS_PER_PAGE, 'id, firstname, lastname, email') ) { - $users = array(); - } - } - } - - $searchtext = (isset($frm->searchtext)) ? $frm->searchtext : ""; - $previoussearch = ($previoussearch) ? '1' : '0'; - - include('./creators.html'); - - print_footer(); - -?> -- 2.39.5