4 require_once 'plc_login.php';
6 // Get session and API handles
7 require_once 'plc_session.php';
12 require_once 'plc_functions.php';
15 $_person= $plc->person;
16 $_roles= $_person['role_ids'];
19 // if no site id redirect
21 plc_redirect(l_sites());
24 $site_id= $_GET['id'];
27 if( $_POST['submitted'] ) {
28 $new_site= $_POST['new_site'];
30 // no primary site anymore..........
36 require_once 'plc_drupal.php';
37 drupal_set_title('Sites');
38 include 'plc_header.php';
41 // if admin list all sites, else list just persons sites
42 if( in_array( '10', $_roles ) )
43 $site_info= $api->GetSites( NULL, array( "site_id", "name" ) );
45 $site_info= $api->GetSites( $_person['site_ids'], array( "site_id", "name" ) );
49 echo "<from method=post action='switch_site.php?id=$site_id'>\n";
50 echo "<h2>Switch Site</h2>\n";
51 echo "Change active site to: \n";
52 echo "<p><select name='new_site'>\n";
54 // out puts site names and ids
55 foreach( $site_info as $site ) {
56 echo "<option value='". $site['site_id'] ."'>". $site['name'] ."</option>\n";
61 echo "<p>This will change your Primary Site.\n";
62 echo "<p><input type=submit name='submitted' value='Switch Site'>\n";
64 echo "<p><a href='index.php?id=$site_id'>Back to Site</a>\n";
71 include 'plc_footer.php';