add network configuration screen
[raven.git] / apps / gacksadmin / user_network.php
1 <?php
2
3 // this must occur before linetabs.php, or linetabs won't work. I have no idea why.
4 drupal_add_js("misc/popup.js");
5
6 // Require login
7 require_once 'plc_login.php';
8
9 // Get session and API handles
10 require_once 'plc_session.php';
11 global $plc, $api, $adm;
12
13 // Common functions
14 require_once 'plc_functions.php';
15 require_once 'plc_peers.php';
16 require_once 'gacks_functions.php';
17 require_once 'gacksclient.php';
18 require_once 'linetabs.php';
19 require_once 'table.php';
20 require_once 'details.php';
21 require_once 'toggle.php';
22 require_once 'form.php';
23 require_once 'nifty.php';
24
25 // find person roles
26 $_person= $plc->person;
27 $_person_id = $plc->person['person_id'];
28 $_roles= $_person['role_ids'];
29
30 // Print header
31 require_once 'plc_drupal.php';
32 drupal_set_title('Manage Slivers: Configure Network');
33 include 'plc_header.php';
34
35 $tabs = manage_slivers_tabs();
36 $_GET['active_line_tab'] = "Configure Network";
37 plekit_linetabs($tabs);
38
39 $nifty=new PlekitNifty ('slicenetwork','objects-list','big');
40 $nifty->start();
41 print '<div style="width: 640px; margin-left: auto; margin-right: auto;">';
42
43 $account_name = get_account_name($api, $_person_id);
44
45 if ($account_name != NULL) {
46     $gacksapi = new GACKSAPI();
47
48     $wizard_config = $api->SliceGetConfig($account_name);
49     $network_method = $wizard_config["network_method"];
50     if (!$network_method) {
51         $network_method = "";
52     }
53
54     $network_selectors = array();
55     $network_selectors []= array("display"=>"Default - No Private Network", "value"=>"");
56     $network_selectors []= array("display"=>"Private Bridge with GRE Tunnels", "value"=>"gre");
57     $network_selectors []= array("display"=>"IPv4 partitioned shared 10.x.x.x", "value"=>"ipv4_shared");
58     $network_selectors []= array("display"=>"IPv6 partitioned shared fec0::", "value"=>"ipv6_shared");
59     select_selector($network_method, $network_selectors);
60
61     $form = new PlekitForm(l_gacks_actions(), array("action"=>"set-network",
62                                                     "account_name"=> $account_name));
63     $form->start();
64
65     print "<br><br>Select a network method for your slice:<br>";
66     print $form->select_html("network_method", $network_selectors);
67     print "<br><br>";
68     print $form->submit_html("submit", "submit");
69     print "<br><br>";
70     print "Note: If you have slivers already instantiated in your slice, then you ";
71     print "will need to delete them, wait 15 minutes, and re-add them for the network ";
72     print "changes to take effect.";
73
74     $form->end();
75 }
76
77 print "</div>";
78 $nifty->end();
79
80 include 'plc_footer.php';
81
82 ?>
83
84