wwwroot/$CFG->admin/index.php"); } require_login(); if (!isadmin()) { error("You must be an administrator to use this page."); } $primaryadmin = get_admin(); /// assign all of the configurable language strings $stringstoload = array ( "assigncreators", "administration", "existingcreators", "noexistingcreators", "potentialcreators", "nopotentialcreators", "addcreator", "removecreator", "search", "searchagain", "users", "toomanytoshow", "searchresults" ); foreach ($stringstoload as $stringtoload){ $strstringtoload = "str" . $stringtoload; $$strstringtoload = get_string($stringtoload); } if ($search) { $searchstring = $strsearchagain; } else { $searchstring = $strsearch; } print_header("$site->shortname: $strassigncreators", "$site->fullname", "$stradministration -> $strusers -> $strassigncreators", ""); /// Add a creator if one is specified if (!empty($_GET['add'])) { if (! add_creator($add)) { error("Could not add that creator!"); } } /// Remove a creator if one is specified. if (!empty($_GET['remove'])) { if (! remove_creator($remove)) { error("Could not remove that creator!"); } } /// Print a help notice about this page if (empty($add) and empty($remove) and empty($search)) { print_simple_box("
".get_string("adminhelpassigncreators")."
", "center", "50%"); } /// Get all existing creators $creators = get_creators(); /// Print the lists of existing and potential creators echo ""; echo ""; echo "
$strexistingcreators$strpotentialcreators
"; /// First, show existing creators if (! $creators) { echo "

$strnoexistingcreators"; $creatorlist = ""; } else { $creatorarray = array(); foreach ($creators as $creator) { $creatorarray[] = $creator->id; echo "

$creator->firstname $creator->lastname, $creator->email    "; echo "id\" title=\"$strremovecreator\">"; echo "

"; } $creatorlist = implode(",",$creatorarray); unset($creatorarray); } echo "
"; /// Print list of potential creators $usercount = get_users(false, $search, true, $creatorlist); if ($usercount == 0) { echo "

$strnopotentialcreators

"; } else if ($usercount > MAX_USERS_PER_PAGE) { echo "

$strtoomanytoshow ($usercount)

"; } else { if ($search) { echo "

($strsearchresults : $search)

"; } if (!$users = get_users(true, $search, true, $creatorlist)) { error("Could not get users!"); } foreach ($users as $user) { echo "

id\"". "title=\"$straddcreator\">  $user->firstname $user->lastname, $user->email"; } } if ($search or $usercount > MAX_USERS_PER_PAGE) { echo "

"; echo ""; echo ""; echo "
"; } echo "
"; print_footer(); ?>