6 require_once 'plc_login.php';
8 // Get session and API handles
9 require_once 'plc_session.php';
14 require_once 'plc_functions.php';
15 require_once 'plc_sorts.php';
18 $_person= $plc->person;
19 $_roles= $_person['role_ids'];
22 // if no site id redirect
24 header( "location: index.php" );
29 $site_id= $_GET['id'];
32 $site_info= $api->GetSites( array( intval( $site_id ), array( "name", "url", "longitude", "latitude", "login_base", "max_slices", "abbreviated_name", "slice_ids" ) );
34 // if submitted expire
35 if( $_POST['action'] ) {
36 $expiration= strtotime( $_POST['expires'] );
38 // loop through all slices for site
39 foreach( $site_info[0]['slice_ids'] as $slice_id ) {
40 $fields= array( "expires" => $expiration );
41 // update all slice's expiration
42 $api->UpdateSlice( $slice_id, $fields );
46 // update site to not allow slice creation or renewal
47 $site_fields= array( "max_slices" => 0 );
48 $api->UpdateSite( $site_id, $site_fields );
54 require_once 'plc_drupal.php';
55 drupal_set_title('Sites');
56 include 'plc_header.php';
59 echo "<form method=post action='expire.php?id=$site_id'>\n";
60 echo "<h2>Expire ". $site_info[0]['name'] ."</h2>\n";
61 echo "<b>Expiration:</b> <input name='expires' value='2 days' />\n";
62 echo "<p>Are you sure you want to set the expiration date for all slices that expire after the above date to the above date as well as disable slice creation and renewal at this site?</p>\n";
63 echo "<input type=submit name='action' value='Yes' />\n";
65 echo "<p><a href='index.php?id=$site_id'>Back to Site</a>\n";
72 include 'plc_footer.php';