spaces not tabs.
Stephen Soltesz [Sun, 5 Jul 2009 00:41:44 +0000 (00:41 +0000)]
PlanetLabConf/get_plc_config.php

index 645bfe8..3d83056 100755 (executable)
@@ -36,37 +36,37 @@ echo $shebang . "\n";
 $limit_view = True;
 
 if (isset($_REQUEST['node_id']) ) {
-       $node_id = intval($_REQUEST['node_id']);
+    $node_id = intval($_REQUEST['node_id']);
 } else {
-       $node_id = 0;
+    $node_id = 0;
 }
 
 
 if ($node_id) {
-       $nodes = $adm->GetNodes($node_id);
+    $nodes = $adm->GetNodes($node_id);
     if (!empty($nodes)) {
         $node = $nodes[0];
         $tags = $adm->GetNodeTags(array('node_id' => $node_id,
-                                                                               'tagname' => 'infrastructure'));
+                                        'tagname' => 'infrastructure'));
         if (!empty($tags)) {
             $tag = $tags[0];
             if ( intval($tag['value']) == 1 ) {
-                               $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
-                               if (!empty($interfaces)) {
-                                       $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
-                                       if (!empty($nodes)) {
-                                               $node = $nodes[0];
-                                               if ( $node['node_id'] == $node_id )
-                                               {
-                                                       # NOTE: only provide complete view if 
-                                                       #     node exists
-                                                       #   node has infrastrucure tag
-                                                       #   infrastructure tag value == 1
-                                                       # Check that the requestor is the node.
-                                       $limit_view = False;
-                                               }
-                                       }
-                               }
+                $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+                if (!empty($interfaces)) {
+                    $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
+                    if (!empty($nodes)) {
+                        $node = $nodes[0];
+                        if ( $node['node_id'] == $node_id )
+                        {
+                            # NOTE: only provide complete view if 
+                            #     node exists
+                            #   node has infrastrucure tag
+                            #   infrastructure tag value == 1
+                            # Check that the requestor is the node.
+                            $limit_view = False;
+                        }
+                      }
+                }
             }
         }
     }
@@ -80,21 +80,21 @@ if ( $limit_view ) {
                'PLC_MAIL_MOM_LIST_ADDRESS',
                'PLC_MAIL_SLICE_ADDRESS');
 } else {
-       $plc_constants = array();
-       $const = get_defined_constants(true);
-       foreach ( $const['user'] as $name => $v ){
-           if ( preg_match('/^PLC_/', $name) == 1 ){
-                       $plc_constants[] = $name;
-               }               
-       }
+    $plc_constants = array();
+    $const = get_defined_constants(true);
+    foreach ( $const['user'] as $name => $v ){
+        if ( preg_match('/^PLC_/', $name) == 1 ){
+            $plc_constants[] = $name;
+        }        
+    }
 }
 
 foreach ($plc_constants as $name) {
-       if (defined($name)) {
-               // Perl, PHP, Python, and sh all support strong single quoting
-               $value = "'" . str_replace("'", "\\'", constant($name)) . "'";
-               printf($format, $name, $value);
-       }
+    if (defined($name)) {
+        // Perl, PHP, Python, and sh all support strong single quoting
+        $value = "'" . str_replace("'", "\\'", constant($name)) . "'";
+        printf($format, $name, $value);
+    }
 }
 printf($format, 'PLC_API_CA_SSL_CRT', "'/usr/boot/cacert.pem'");
 printf($format, 'PLC_ROOT_GPG_KEY_PUB', "'/usr/boot/pubring.gpg'");