00001 <?PHP
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 $page_author = $creator_name;
00018 $page_author_email = $creator_email;
00019 $page_menu = 1;
00020 $page_date = formatTime( time() );
00021
00022 if( !auth($_REQUEST["username"], $_REQUEST["password"]) )
00023 $page_content = loginform($language, globalIDtoURL("setup/users"), $auth_messages);
00024 else if( !isAllowed("global_user_edit") )
00025 $page_content = "<p>" . i18n("You do not have the correct permissions to change other user's information") . "</p>";
00026 else
00027 {
00028
00029 $setupPage = new setupPage;
00030 $setupPage->addBreadcrumb( i18n("Users"), globalIDtoURL("setup/users") );
00031 if( $_REQUEST["action"] != "" )
00032 $setupPage->addBreadcrumb( i18n($_REQUEST["action"]), globalIDtoURL("setup/users/" . $_REQUEST["action"]) );
00033 if($_REQUEST["subaction"] != "")
00034 $setupPage->addBreadcrumb( i18n($_REQUEST["subaction"]), thisPageURL( false, true, array("subaction" => $_REQUEST["subaction"]) ) );
00035 $setupPage->addCommand( i18n("Profile options"), i18n("Options pertaining to all profiles, and to viewing profiles"), globalIDtoURL("setup/users/profile_options") );
00036 $setupPage->addCommand( i18n("Set permission defaults"), i18n("Manage what permissions are used for an anonymous user, and for all users who have not had permissions set specifically"), globalIDtoURL("setup/users/default_permissions") );
00037 $setupPage->addCommand( i18n("New") , i18n("Create a new user"), globalIDtoURL("user/" . i18n("username") . "/new") );
00038
00039 if( $_REQUEST["action"] == "profile_options" )
00040 {
00041 global $setup_folder, $language;
00042
00043 if ($_REQUEST["profiles_view"] != "") $profile_options["profiles_view"] = $_REQUEST["profiles_view"];
00044 if ($_REQUEST["profiles_contact"] != "") $profile_options["profiles_contact"] = $_REQUEST["profiles_contact"];
00045 if ($_REQUEST["profiles_mypage"] != "") $profile_options["profiles_mypage"] = $_REQUEST["profiles_mypage"];
00046 if ($_REQUEST["profiles_menu"] != "") $profile_options["profiles_menu"] = $_REQUEST["profiles_menu"];
00047 if ($_REQUEST["avatar_maxwidth"] != "") $profile_options["avatar_maxwidth"] = (int)$_REQUEST["avatar_maxwidth"];
00048 if ($_REQUEST["avatar_maxheight"] != "") $profile_options["avatar_maxheight"] =(int) $_REQUEST["avatar_maxheight"];
00049 if ($_REQUEST["tiny_width"] != "") $profile_options["tiny_width"] =(int) $_REQUEST["tiny_width"];
00050 if ($_REQUEST["tiny_height"] != "") $profile_options["tiny_width"] =(int) $_REQUEST["tiny_height"];
00051 if ($_REQUEST["thumbnail_width"] != "") $profile_options["thumbnail_width"] = (int)$_REQUEST["thumbnail_width"];
00052 if ($_REQUEST["thumbnail_height"] != "") $profile_options["thumbnail_height"] = (int)$_REQUEST["thumbnail_height"];
00053 if( $_REQUEST["save_profileoptions"] )
00054 {
00055 if ($_REQUEST["thumbnail_disable"])
00056 $profile_options["thumbnail_disable"] = "checked";
00057 else
00058 $profile_options["thumbnail_disable"] = "";
00059 }
00060 if( $_REQUEST["subaction"] == "contact" )
00061 {
00062 if( $_REQUEST["subsubaction"] == "add" )
00063 {
00064 $profile_options["contact_fields"][count($profile_options["contact_fields"])] = array(
00065 "name" => i18n("Name"),
00066 "description" => i18n("Description of the contact field"),
00067 "image" => "image.gif",
00068 "url" => "http://www.url.com/",
00069 "regexp" => ".*");
00070 }
00071 else if( $_REQUEST["save_profileoptions"] )
00072 {
00073 foreach( $_REQUEST["name"] as $key => $value )
00074 {
00075 $profile_options["contact_fields"][$key]["name"] = stripslashes($value);
00076 $profile_options["contact_fields"][$key]["description"] = stripslashes($_REQUEST["description"][$key]);
00077 $profile_options["contact_fields"][$key]["image"] = stripslashes($_REQUEST["image"][$key]);
00078 $profile_options["contact_fields"][$key]["url"] = stripslashes($_REQUEST["url"][$key]);
00079 $profile_options["contact_fields"][$key]["regexp"] = stripslashes($_REQUEST["regexp"][$key]);
00080 }
00081
00082 foreach($_REQUEST["name"] as $key => $value)
00083 if ($_REQUEST["remove"][$key])
00084 unset($profile_options["contact_fields"][$key]);
00085 }
00086
00087 if( is_array( $profile_options["contact_fields"] ) )
00088 foreach ($profile_options["contact_fields"] as $key => $value)
00089 $temp_contactfields[$value["name"]] = $value;
00090
00091 $profile_options["contact_fields"] = $temp_contactfields;
00092
00093 if( count($profile_options["contact_fields"]) < 1 )
00094 {
00095 $profile_options["contact_fields"] = array(
00096 "MSN" => array(
00097 "name" => i18n("MSN"),
00098 "description" => i18n("MSN Messenger"),
00099 "image" => "msn.gif",
00100 "url" => "http://www.msn.com/",
00101 "regexp" => ".+@.+\..+."),
00102 "ICQ" => array(
00103 "name" => i18n("ICQ"),
00104 "description" => i18n("I Seek U"),
00105 "image" => "icq.gif",
00106 "url" => "http://wwp.icq.com/scripts/search.dll?to=$$",
00107 "regexp" => ".*"),
00108 "Y!" => array(
00109 "name" => i18n("Y!"),
00110 "description" => i18n("Yahoo! Messenger"),
00111 "image" => "yahoo.gif",
00112 "url" => "http://edit.yahoo.com/config/send_webmesg?.target=$$&.src=pg",
00113 "regexp" => ".*"),
00114 "AIM" => array(
00115 "name" => i18n("AIM"),
00116 "description" => i18n("AOL Instant Messenger"),
00117 "image" => "aim.gif",
00118 "url" => "aim:goim%3Fscreenname=$$&message=Hello+Are+you+there%3F",
00119 "regexp" => ".*"),
00120 "Jabber" => array(
00121 "name" => i18n("Jabber"),
00122 "description" => i18n("Jabber XMPP Based Instant Messenger"),
00123 "image" => "jabber.gif",
00124 "url" => "http://www.jabber.org/",
00125 "regexp" => ".+@.+\..+."),
00126 "Google Talk" => array(
00127 "name" => i18n("Google Talk"),
00128 "description" => i18n("Google's voice-chat enabled Jabber-based Instant Messenger"),
00129 "image" => "gtalk.gif",
00130 "url" => "http://www.google.com/talk/",
00131 "regexp" => ".+@gmail\.com"),
00132 "Skype" => array(
00133 "name" => i18n("Skype"),
00134 "description" => i18n("Skype Internet Telephony"),
00135 "image" => "skype.gif",
00136 "url" => "skype:$$?call",
00137 "regexp" => ".*"),
00138 "WWW" => array(
00139 "name" => i18n("WWW"),
00140 "description" => i18n("Homepage address (remember http://)"),
00141 "image" => "www.gif",
00142 "url" => "$$",
00143 "regexp" => ".*")
00144 );
00145 }
00146 }
00147 saveProfileOptions();
00148
00149 $tabwidget = new TabWidget;
00150 $tabwidget->tabbar->addTab(i18n("Default profile options"), thisPageURL( false, true, array( "subaction" => "default")), true);
00151 $tabwidget->tabbar->addTab(i18n("Avatar options"),thisPageURL( false, true, array( "subaction" => "avatar")), false);
00152 $tabwidget->tabbar->addTab(i18n("Contact fields"), thisPageURL( false, true, array( "subaction" => "contact")), false);
00153
00154 switch( $_REQUEST["subaction"] )
00155 {
00156 case "contact":
00157 $page_title = i18n("Contact fields");
00158 $tabwidget->tabbar->setCurrent("Contact fields");
00159 $tabwidget->addCommand(i18n("Add field"), i18n("Add a new contact field"), thisPageURL( false, true, array( "subaction" => "contact", "subsubaction" => "add" ) ) );
00160
00161 if( is_array($profile_options["contact_fields"]) )
00162 {
00163 $temp_content = "
00164 <table class=\"options\">
00165 <tr class=\"option\">
00166 <th class=\"options\" width=\"50%\">" . i18n("Name and Description") . "</th>
00167 <th class=\"options\" width=\"50%\">" . i18n("Image, URL and Validation regexp") . "</th>
00168 </tr>
00169 <tr>
00170 <td colspan=\"2\">";
00171
00172 foreach( $profile_options["contact_fields"] as $key => $value )
00173 {
00174 if ($value["enabled"] == "true")
00175 $checkedvalue = "checked ";
00176 else
00177 $checkedvalue = "";
00178
00179 $temp_content .= "
00180 <table class=\"options\">
00181 <tr class=\"option\">
00182 <td class=\"option\" width=\"35%\"><input style=\"width: 100%;\" type=\"text\" name=\"name[$key]\" value=\"{$value['name']}\" />
00183 <td class=\"option\" width=\"15%\"><label><input type=\"checkbox\" name=\"remove[$key]\" />" . i18n("Delete") . "</label></td>
00184 <td class=\"option\" width=\"25%\"><input style=\"width: 100%;\" type=\"text\" name=\"image[$key]\" value=\"{$value['image']}\" /></td>
00185 <td class=\"option\" width=\"25%\"><input style=\"width: 100%;\" type=\"text\" name=\"regexp[$key]\" value=\"{$value['regexp']}\" /></td>
00186 </tr><tr class=\"option\">
00187 <td class=\"option\" colspan=\"2\"><input type=\"text\" style=\"width: 100%;\" name=\"description[$key]\" value=\"{$value['description']}\" /></td>
00188 <td class=\"option\" colspan=\"2\"><input style=\"width: 100%;\" type=\"text\" name=\"url[$key]\" value=\"{$value['url']}\" /></td>
00189 </tr>
00190 </table>";
00191 }
00192 $temp_content .= "
00193 </td>
00194 </tr>
00195 <tr>
00196 <td class=\"options-bottomleft\"><input type=\"submit\" name=\"save_profileoptions\" value=\"" . i18n("Save options") . "\" /></td>
00197 <td class=\"options-bottomright\"><input type=\"reset\" value=\"" . i18n("Reset to saved") . "\" /></td>
00198 </tr>
00199 </table>";
00200 }
00201
00202 $tabwidget->contents = $temp_content;
00203 break;
00204 case "avatar":
00205 $page_title = i18n("Avatar options");
00206 $tabwidget->tabbar->setCurrent("Avatar options");
00207 $tabwidget->contents = "
00208 <table class=\"options\">
00209 <tr class=\"option\"><th class=\"options\" colspan=\"2\">" . i18n("Maximum sizes") . "</th></tr>
00210 <tr class=\"option\">
00211 <td class=\"option\" width=\"50%\">" . i18n("Width") . "</td>
00212 <td class=\"option\" width=\"50%\"><input style=\"width: 100%\" type=\"text\" name=\"avatar_maxwidth\" value=\"{$profile_options['avatar_maxwidth']}\" /></td>
00213 </tr>
00214 <tr class=\"option\">
00215 <td class=\"option\">" . i18n("Height") . "</td>
00216 <td class=\"option\"><input style=\"width: 100%\" type=\"text\" name=\"avatar_maxheight\" value=\"{$profile_options['avatar_maxheight']}\" /></td>
00217 </tr>
00218 <tr class=\"option\"><th class=\"options\" colspan=\"2\">" . i18n("Thumbnail sizes") . "</th></tr>
00219 <tr class=\"option\">
00220 <td class=\"option\" colspan=\"2\"><label><input type=\"checkbox\" name=\"thumbnail_disable\" {$profile_options['thumbnail_disable']} />
00221 " . i18n("Disable thumbnails. If you select this, you will probably want to greatly limit the size options for the avatar above") . "</label>
00222 </td>
00223 </tr>
00224 <tr class=\"option\">
00225 <td class=\"option\" width=\"50%\">" . i18n("Width") . "</td>
00226 <td class=\"option\" width=\"50%\"><input style=\"width: 100%\" type=\"text\" name=\"thumbnail_width\" value=\"{$profile_options['thumbnail_width']}\" /></td>
00227 </tr>
00228 <tr class=\"option\">
00229 <td class=\"option\">" . i18n("Height") . "</td>
00230 <td class=\"option\"><input style=\"width: 100%\" type=\"text\" name=\"thumbnail_height\" value=\"{$profile_options['thumbnail_height']}\" /></td>
00231 </tr>
00232 <tr class=\"option\"><th class=\"options\" colspan=\"2\">" . i18n("Tiny sizes") . "</th></tr>
00233 <tr class=\"option\">
00234 <td class=\"option\" width=\"50%\">" . i18n("Width") . "</td>
00235 <td class=\"option\" width=\"50%\"><input style=\"width: 100%\" type=\"text\" name=\"tiny_width\" value=\"{$profile_options['tiny_width']}\" /></td>
00236 </tr>
00237 <tr class=\"option\">
00238 <td class=\"option\">" . i18n("Height") . "</td>
00239 <td class=\"option\"><input style=\"width: 100%\" type=\"text\" name=\"tiny_height\" value=\"{$profile_options['tiny_height']}\" /></td>
00240 </tr>
00241 <tr>
00242 <td class=\"options-bottomleft\"><input type=\"submit\" name=\"save_profileoptions\" value=\"" . i18n("Save options") . "\" /></td>
00243 <td class=\"options-bottomright\"><input type=\"reset\" value=\"" . i18n("Reset to saved") . "\" /></td>
00244 </tr>
00245 </table>";
00246 break;
00247 case "default":
00248 default:
00249 $page_title = i18n("Default profile options");
00250 $tabwidget->tabbar->setCurrent("Default profile options");
00251
00252 $permissionlevels_array = array(
00253 0 => i18n("All"),
00254 1 => i18n("Registered users"),
00255 2 => i18n("Registered users, except blacklisted"),
00256 3 => i18n("Friends"),
00257 4 => i18n("Noone"));
00258 foreach( $permissionlevels_array as $key => $value )
00259 {
00260 if ($profile_options["profiles_view"] == $key) { $default = " selected"; } else { $default = ""; }
00261 $permissionlevels_view .= "<option value=\"$key\"$default>$value</option>";
00262 if ($profile_options["profiles_contact"] == $key) { $default = " selected"; } else { $default = ""; }
00263 $permissionlevels_contact .= "<option value=\"$key\"$default>$value</option>";
00264 if ($profile_options["profiles_mypage"] == $key) { $default = " selected"; } else { $default = ""; }
00265 $permissionlevels_mypage .= "<option value=\"$key\"$default>$value</option>";
00266 }
00267
00268
00269
00270 $tabwidget->contents = "
00271 <table class=\"options\">
00272 <tr class=\"option\">
00273 <td class=\"option\" width=\"50%\">" . i18n("Profiles are by default viewable by") . "</td>
00274 <td class=\"option\" width=\"50%\"><select style=\"width: 100%;\" name=\"profiles_view\">$permissionlevels_view</select></td>
00275 </tr>
00276 <tr class=\"option\">
00277 <td class=\"option\">" . i18n("Users can by default be contacted by") . "</td>
00278 <td class=\"option\"><select style=\"width: 100%;\" name=\"profiles_contact\">$permissionlevels_contact</select></td>
00279 </tr>
00280 <tr class=\"option\">
00281 <td class=\"option\">" . i18n("User's personal pages can by default be viewed by") . "</td>
00282 <td class=\"option\"><select style=\"width: 100%;\" name=\"profiles_mypage\">$permissionlevels_mypage</select></td>
00283 </tr>
00284 <tr class=\"option\">
00285 <td class=\"option\">" . i18n("The menu used by the profiles section") . "</td>
00286 <td class=\"option\"><select style=\"width: 100%;\" name=\"profiles_menu\">";
00287
00288 $menu_menus = $pagectl->fetchMenuMenuList($menu_folder);
00289 foreach( $menu_menus as $key => $value )
00290 {
00291 if( is_array($value["language"]) )
00292 {
00293 if ($value["id"] == $profile_options["profiles_menu"])
00294 $tabwidget->contents .= "\n <option value=\"{$value["id"]}\" selected>ID {$value["id"]} (";
00295 else
00296 $tabwidget->contents .= "\n <option value=\"{$value["id"]}\">ID {$value["id"]} (";
00297
00298 foreach ($value["language"] as $key2 => $value2)
00299 $tabwidget->contents .= "$value2: {$value["title"][$key2]} ";
00300
00301 $tabwidget->contents .= ")</option>";
00302 }
00303 else
00304 {
00305 if ($value["id"] == $profile_options["profiles_menu"])
00306 $tabwidget->contents .= "\n <option value=\"{$value["id"]}\" selected>ID {$value["id"]} ({$value["language"]}: {$value["title"]})</option>";
00307 else
00308 $tabwidget->contents .= "\n <option value=\"{$value["id"]}\">ID {$value["id"]} ({$value["language"]}: {$value["title"]})</option>";
00309 }
00310 }
00311
00312 $tabwidget->contents .= "</select></td>
00313 </tr>
00314 <tr>
00315 <td class=\"options-bottomleft\"><input type=\"submit\" name=\"save_profileoptions\" value=\"" . i18n("Save options") . "\" /></td>
00316 <td class=\"options-bottomright\"><input type=\"reset\" value=\"" . i18n("Reset to saved") . "\" /></td>
00317 </tr>
00318 </table>
00319 ";
00320 }
00321
00322 $setupPage->contents = "
00323 <form action=\"" . thisPageURL() . "\" method=\"post\">
00324 ". $tabwidget->renderTabWidget() . "
00325 <div class=\"wikicenteralign\">
00326 </div>
00327 </form>";
00328 }
00329 else if( $_REQUEST["action"] == "default_permissions" )
00330 {
00331 $page_title = i18n("Default permissions");
00332 if( $_REQUEST["thepermission"] != "" && ($_REQUEST["thevalue"] == "true" || $_REQUEST["thevalue"] == "false") )
00333 {
00334 if( setAllowed($_REQUEST["thepermission"], $_REQUEST["thevalue"]) )
00335 $setupPage->contents = "<p>" . i18n("The permissions were set successfully") . "</p>";
00336 else
00337 $setupPage->contents = "<p>" . i18n("An error occured during the setting of the permission!") . "</p>";
00338 }
00339 $setupPage->contents .= "
00340 <table class=\"setup\">
00341 <tr class=\"setup\">
00342 <th class=\"setup\">" . i18n("Name of the permission") . "</th>
00343 <th class=\"setup\">" . i18n("Current (click to allow/ disallow)") . "</th>
00344 </tr>
00345 ";
00346 ksort($usergroups_default);
00347 foreach( $usergroups_default as $key => $value )
00348 {
00349 if( $value == true )
00350 {
00351 $temptext = "Allowed";
00352 $thenewvalue = "false";
00353 }
00354 else
00355 {
00356 $temptext = "Not allowed";
00357 $thenewvalue = "true";
00358 }
00359 $setupPage->contents .= "
00360 <tr class=\"setup\">
00361 <td class=\"setup\">" . i18n($key) . "</td>
00362 <td class=\"setup wikirightalign\">
00363 " . drawCommand( i18n($temptext), i18n($temptext), thisPageURL( false, true, array( "thepermission" => $key, "thevalue" => $thenewvalue ) ) ) . "
00364 </td>
00365 </tr>
00366 ";
00367 }
00368 $setupPage->contents .= "</table>
00369 ";
00370 }
00371 else if( $_REQUEST["action"] == "permissions" )
00372 {
00373 $page_title = i18n("Permissions for ##0##", array( $_REQUEST["username"] ) );
00374 if( $_REQUEST["thepermission"] != "" && ($_REQUEST["thevalue"] == "true" || $_REQUEST["thevalue"] == "false") )
00375 {
00376 if( setAllowed($_REQUEST["thepermission"], $_REQUEST["thevalue"], $_REQUEST["username"]) )
00377 $setupPage->contents = "<p>" . i18n("The permissions were set successfully") . "</p>";
00378 else
00379 $setupPage->contents = "<p>" . i18n("An error occured during the setting of the permission!") . "</p>";
00380 }
00381 $setupPage->contents .= "
00382 <table class=\"setup\">
00383 <tr class=\"setup\">
00384 <th class=\"setup\">" . i18n("Name of the permission") . "</th>
00385 <th class=\"setup\">" . i18n("Current (click to allow/ disallow)") . "</th>
00386 </tr>
00387 ";
00388 $temp_usergroups = getPermissions($_REQUEST["username"]);
00389 ksort($usergroups_default);
00390 foreach($usergroups_default as $key => $value)
00391 {
00392 if( is_array($temp_usergroups) )
00393 {
00394 if( array_key_exists($key, $temp_usergroups) )
00395 {
00396 if( $temp_usergroups[$key] == true )
00397 {
00398 $temptext = "Allowed";
00399 $thenewvalue = "false";
00400 }
00401 else
00402 {
00403 $temptext = "Not allowed";
00404 $thenewvalue = "true";
00405 }
00406 }
00407 else
00408 {
00409 if( $value == true )
00410 {
00411 $temptext = "(default) Allowed";
00412 $thenewvalue = "false";
00413 }
00414 else
00415 {
00416 $temptext = "(default) Not allowed";
00417 $thenewvalue = "true";
00418 }
00419 }
00420 }
00421 else
00422 {
00423 if( $value == true )
00424 {
00425 $temptext = "(default) Allowed";
00426 $thenewvalue = "false";
00427 }
00428 else
00429 {
00430 $temptext = "(default) Not allowed";
00431 $thenewvalue = "true";
00432 }
00433 }
00434 $setupPage->contents .= "
00435 <tr class=\"setup\">
00436 <td class=\"setup\">" . i18n($key) . "</td>
00437 <td class=\"setup wikirightalign\">
00438 " . drawCommand( i18n($temptext), i18n($temptext), thisPageURL( false, true, array( "thepermission" => $key, "thevalue" => $thenewvalue ) ) ) . "
00439 </td>
00440 </tr>
00441 ";
00442 }
00443 $setupPage->contents .= "</table>
00444 ";
00445
00446 }
00447 else if( $_REQUEST["action"] == "remove" )
00448 {
00449 $page_title = i18n("Remove user");
00450 if ($_REQUEST["remove_confirm"] != "true") {
00451 $setupPage->contents = "
00452 <p>" . i18n("Please confirm that you wish to remove the user ##0##", array($_REQUEST['username'])) . "</p>
00453 <div align=\"center\">
00454 <a href=\"" . thisPageURL( false, true, array( "username" => $_REQUEST['username'], "remove_confirm" => "true" ) ) . "\">[". i18n("Remove user") . "]</a>
00455 <a href=\"" . globalIDtoURL( "setup/users" ) . "\">[" . i18n("Abort") . "]</a>
00456 </div>
00457 ";
00458 }
00459 else
00460 {
00461 if( $_REQUEST["username"] == currentUser() )
00462 {
00463 $usermanager->remove($_REQUEST["username"], "setup/password.txt");
00464 $setupPage->contents = "<p>" . i18n("User removed!") . "</p>";
00465 header("Location: " . globalIDtoURL("logout") );
00466 }
00467 else if( isAllowed("global_admin") )
00468 {
00469 $usermanager->remove($_REQUEST["username"], "setup/password.txt");
00470 $setupPage->contents = "<p>" . i18n("User removed!") . "</p>";
00471 header("Location: " . globalIDtoURL("setup/users") );
00472 }
00473 else
00474 $setupPage->contents = "<p>You are not authorised to remove this user! Also, you should <i>not</i> be seeing this.</p>";
00475 }
00476 }
00477 else if( $_REQUEST["action"] == "rename" && $_REQUEST["username"] != "" )
00478 {
00479 $page_title = i18n("Rename user");
00480 if( $_REQUEST["renameto"] == "" || $_REQUEST["renameto"] == $_REQUEST["username"] )
00481 {
00482 $setupPage->contents = "
00483 <form action=\"" . globalIDtoURL("setup/users/rename") . "\" method=\"post\">
00484 <input type=\"hidden\" name=\"username\" value=\"{$_REQUEST['username']}\" />
00485 <table class=\"setup\">
00486 <tr class=\"setup\"><td class=\"setup\" colspan=\"2\">
00487 " . i18n("Write the new username for the user ##0## in the text box below.", array($_REQUEST["username"])) . "
00488 <tr><td class=\"setup\">" . i18n("Username:") . "</td><td class=\"setup\" align=\"right\"><input type=\"text\" name=\"renameto\" value=\"{$_REQUEST['username']}\"></td></tr>
00489 <tr class=\"setup\"><td class=\"setup\" colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"" . i18n("Rename") . "\"></td></tr>
00490 </table></form>
00491 ";
00492 }
00493 else
00494 {
00495 $usermanager->rename($_REQUEST["username"], $_REQUEST["renameto"]);
00496 $setupPage->contents = "<p>" . i18n("User renamed") . "</p>";
00497 header("Location: " . globalIDtoURL("setup/users") );
00498 }
00499 }
00500 else
00501 {
00502 $page_title = i18n("Manage users");
00503 $bgarray[1] = "transparent";
00504 $bgarray[2] = "#e0e0e0";
00505
00506 $fp = fopen("setup/password.txt", "r");
00507 while (!feof($fp)) {
00508 $line = trim(fgets($fp, 1000));
00509 list($l, $p) = explode(",", $line);
00510 $bgarray = array_reverse($bgarray);
00511 if (!isAllowed("group_admin") && $let_user_delete_self == true) {
00512 if ($l == "admin" || !($l == currentUser())) {
00513 $temp_content = "$temp_content
00514 <tr class=\"setup\">
00515 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\"><div align=\"left\">$l</div></td>
00516 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\" align=\"right\"><div class=\"command\">
00517 " . i18n("(admin only)") . "
00518 </div></td></tr>";
00519 } else {
00520 $temp_content = "$temp_content
00521 <tr class=\"setup\">
00522 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\"><div align=\"left\">$l</div></td>
00523 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\" align=\"right\"><div class=\"command\">
00524 " . drawCommand( i18n("Remove"), i18n("Remove the user"), globalIDtoURL( "setup/users/remove/$l" ) ) . "
00525 " . drawCommand( i18n("Edit user"), i18n("Edit the user", array($l) ), globalIDtoURL("user/$l/edit") ) . "
00526 </div></td></tr>";
00527 }
00528 } else {
00529 if ($l == "admin") {
00530 $temp_content = "$temp_content
00531 <tr class=\"setup\">
00532 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\"><div align=\"left\">$l</div></td>
00533 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\" align=\"right\"><div class=\"command\">
00534 " . drawCommand( i18n("Edit user"), i18n("Edit the user", array($l) ), globalIDtoURL("user/$l/edit") ) . "
00535 </div></td></tr>";
00536 } else {
00537 $temp_content = "$temp_content
00538 <tr class=\"setup\">
00539 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\"><div align=\"left\">$l</div></td>
00540 <td class=\"setup\" style=\"background-color: {$bgarray[1]};\" align=\"right\"><div class=\"command\">
00541 " . drawCommand( i18n("Permissions"), i18n("Permissions"), globalIDtoURL( "setup/users/permissions/$l") ) . "
00542 " . drawCommand( i18n("Remove"), i18n("Remove the user"), globalIDtoURL( "setup/users/remove/$l" ) ) . "
00543 " . drawCommand( i18n("Rename"), i18n("Rename the user"), globalIDtoURL( "setup/users/rename/$l" ) ) . "
00544 " . drawCommand( i18n("Edit user"), i18n("Edit the user", array($l) ), globalIDtoURL("user/$l/edit") ) . "
00545 </div></td></tr>";
00546 }
00547 }
00548 }
00549 fclose($fp);
00550
00551 $setupPage->contents .= "
00552 <table class=\"setup\">
00553 <tr class=\"setup\">
00554 <th class=\"setup\">" . i18n("Username") . "</th>
00555 <th class=\"setup\">" . i18n("Functions") . "</th>
00556 </tr>
00557
00558 $temp_content</table>";
00559 }
00560
00561 $page_content = $setupPage->render();
00562 }
00563 ?>