/* Poor old Internet Explorer 6 has a bug that means we can't use background images for the table rows
as it trys to download the image each and every time that it is used (which means a 1000 row table
will produce 1000 http requests for the image in question) */
-tr[class="alt"] td {
+tr[class="alt"]>td {
background: #F5FAFA url(/planetlab/icons/tablesort_td_alt.jpg) no-repeat;
}
td.plc_table [class~="alt"] {
background: #edf3f3 url(/planetlab/icons/tablesort_col_alt.jpg) no-repeat !important;
}
/* Poor old Internet Explorer won't see the next two rules either as it doesn't get :first-child */
-table.plc_table tbody tr.alt td:first-child {
+table.plc_table>tbody>tr.alt>td:first-child {
background: #F5FAFA url(/planetlab/icons/tablesort_bullet2.gif) no-repeat;
font-weight:bold;
}
-table.plc_table tbody tr td:first-child {
+table.plc_table>tbody>tr>td:first-child {
background: #fff url(/planetlab/icons/tablesort_bullet1.gif) no-repeat;
font-weight:bold;
}
$type='type=button value="' . $label . '"';
}
printf('<span title="%s">',$todo['bubble']);
- printf('<input %s %s onclick=\'miniTab.submit("%s");\' />',$tracer,$type,$todo['confirm']);
+ $message="";
+ if ($todo['confirm']) $message=$todo['confirm'] . " ?";
+ printf('<input %s %s onclick=\'miniTab.submit("%s");\' />',$tracer,$type,$message);
printf('</span>',$todo['bubble']);
printf("</form></li>\n");
}
// Print header
require_once 'plc_drupal.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
-
+include 'plc_header.php';
// Common functions
require_once 'plc_functions.php';
if ($local_peer && $privileges) {
if (plc_is_admin())
- $tabs['Events'] = array('url'=>l_event("Person","person",$person_id),
- 'bubble'=>'Related events',
- 'image'=>'/planetlab/icons/event.png',
- 'height'=>18);
+ $tabs['Events'] = array('url'=>l_events(),
+ 'values'=>array('type'=>'Person','person'=>$person_id),
+ 'bubble'=>'Related events',
+ 'image'=>'/planetlab/icons/event.png',
+ 'height'=>18);
if ($enabled)
$tabs['Disable'] = array ('method'=>'POST',
'url'=>'/db/persons/person_actions.php',
'values'=> array ('person_id'=>$person_id,
'action'=>'disable'),
- 'bubble'=>"Disable $first_name");
+ 'bubble'=>"Disable $first_name",
+ 'confirm'=>"Are you sure you want to disable $first_name $last_name");
else
$tabs['Enable'] = array ('method'=>'POST',
'url'=>'/db/persons/person_actions.php',
'values'=>array('id'=>$person_id),
'bubble'=>"Update $first_name");
- $tabs['Persons'] = array ('url'=>l_persons());
+ $tabs['All Users'] = array ('url'=>l_persons());
plc_tabs($tabs);
$_person= $plc->person;
$_roles= $_person['role_ids'];
-
+//////////////////////////////
// get person id
if( $_POST['person_id'] )
$person_id= $_POST['person_id'];
-// if site_id submitted add the person to that site_id
+//////////////////// add in site
if( $_POST['site_add'] ) {
$site_id= $_POST['site_add'];
}
+//////////////////// remove from sites
if ( $_POST['Remove_Sites']){
if( $_POST['rem_site'] ) {
foreach( $_POST['rem_site'] as $site_id ) {
}else{
echo "<h3><span class='plc-warning'>Please select one or more Sites to remove.<br /></h3> </span>\n";
echo "<br /><hr /><p><a href='/db/persons/index.php?id=$person_id'>Back to person page</a></div>";
+ return;
}
}
+//////////////////// remove roles
// remove role
if ( $_POST['Remove_Roles']){
if($_POST['rem_role']) {
}
}
-// add roles
+//////////////////// add roles
if( $_POST['add_role'] ) {
$role_id= $_POST['add_role'];
exit();
}
+//////////////////// enable
// enable person
-if( $_GET['enab_id'] ) {
+if ( $_GET['enab_id'] ) {
$per_id= $_GET['enab_id'];
$fields= array( "enabled"=>true );
}
-// disable person
+//////////////////// disable person
if( $_GET['dis_id'] ) {
$per_id= $_GET['dis_id'];
$api->UpdatePerson( intval( $per_id ), $fields );
- header( "location: index.php?id=$person_id" );
+ header( "location: index.php?id=$per_id" );
exit();
}
}
-// delete person
+//////////////////// delete person
if( $_GET['per_id'] ) {
- $person_id= $_GET['per_id'];
+ $per_id= $_GET['per_id'];
- $api->DeletePerson( intval( $person_id ) );
+ $api->DeletePerson( intval( $per_id ) );
header( "location: index.php" );
exit();
// fetch persons
-$person_columns=array('first_name','last_name','email','roles','peer_id','key_ids','site_ids');
+$person_columns=array('person_id','first_name','last_name','email','roles','peer_id','key_ids','site_ids');
// PIs and admins can see users not yet enabled
$privileges=plc_is_admin() || plc_is_pi();
if ( ! $privileges )
$title .= t_site($site);
$tabs = array_merge($tabs,tabs_site($site));
$person_filter['person_id']=$site['person_ids'];
+ if ($site_id == plc_my_site_id())
+ unset($tabs['My accounts']);
}
if ($slice_id) {
// initial sort on email
$table_options=array();
-plc_table_start("persons",$columns,5,$table_options);
+plc_table_start("persons",$columns,4,$table_options);
$peer_hash = plc_peer_get_hash ($api);
// write rows