/[scire]/webgli/clientconfig.php
Gentoo

Contents of /webgli/clientconfig.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (show annotations) (download)
Sun May 7 19:57:58 2006 UTC (12 years, 5 months ago) by codeman
File size: 6454 byte(s)
adding a lot of webgli screens, some of which are done
the details of the status of webgli is in /webgli/TODO

1 <?php
2 include('webgliCF.php');
3 include('webgliUtility.php');
4
5 include('Smarty.class.php');
6 $smarty = new Smarty;
7 #phpinfo();
8 $smarty->template_dir = './templates';
9 $smarty->compile_dir = './templates_c';
10 $smarty->cache_dir = './cache';
11 $smarty->config_dir = './configs';
12 $error_msg = "";
13
14
15 $cf = new ClientConfiguration();
16 $cf->parse('testcc.xml') or $error_msg .= "No configuration could be loaded.";
17
18
19
20
21 if ($_POST['SaveCC']) {
22 if ($_POST['ArchType']) {
23 $error_msg .= "Found an architecture: you submitted " . $_POST['ArchType']. "<BR>\n";
24 $cf->set("architecture_template", $_POST['ArchType']);
25 #$error_msg .= "ERROR: Could not set the Architecture Template<br>\n";
26 }
27 if ($_POST['Logfile']) {
28 $error_msg .= "Found a logfile: you submitted " . $_POST['Logfile'] . "<BR>\n";
29 $cf->set("log_file",$_POST['Logfile']);
30 #$error_msg .= "ERROR: Could not set the Logfile <BR>\n";
31 }
32 if ($_POST['RootMountPoint']) {
33 $error_msg .= "Found a root mount point: you submitted " . $_POST['RootMountPoint'] . "<BR>\n";
34 $cf->set("root_mount_point",$_POST['RootMountPoint']);
35 #$error_msg .= "ERROR: Could not set the Root Mount Point<BR>\n";
36 }
37 if ($_POST['Network_Iface']) {
38 $error_msg .= "Found a network interface: you submitted " . $_POST['Network_Iface'] . "<BR>\n";
39 $cf->set("network_interface", $_POST['Network_Iface']);
40 #$error_msg .= "ERROR: Could not set the Network Interface<BR>\n";
41 }
42 if ($_POST['Network_Type']) {
43 $error_msg .= "Found a Network Type: you submitted " . $_POST['Network_Type'] . "<BR>\n";
44 $cf->set("network_type", $_POST['Network_Type']);
45 #$error_msg .= "ERROR: Could not set the Network Type<BR>\n";
46 }
47 if ($_POST['dhcp_options']) {
48 $error_msg .= "Found DHCP Options. You submitted " . $_POST['dhcp_options'] . "<BR>\n";
49 $cf->set("network_dhcp_options", $_POST['dhcp_options']);
50 #$error_msg .= "ERROR: Could not set the dhcp options<br>\n";
51 }
52 if ($_POST['ip']) {
53 $error_msg .= "Found an IP: you submitted " . $_POST['ip'] . "<BR>\n";
54 $cf->set("network_ip",$_POST['ip']);
55 #$error_msg .= "ERROR: Could not set the IP<BR>\n";
56 }
57 if ($_POST['broadcast']) {
58 $error_msg .= "Found an broadcast IP: you submitted " . $_POST['broadcast'] . "<BR>\n";
59 $cf->set("network_broadcast", $_POST['broadcast']);
60 #$error_msg .= "ERROR: Could not set the broadcast IP<BR>\n";
61 }
62 if ($_POST['netmask']) {
63 $error_msg .= "Found an netmask IP: you submitted " . $_POST['netmask'] . "<BR>\n";
64 $cf->set("network_netmask", $_POST['netmask']);
65 #$error_msg .= "ERROR: Could not set the netmask IP<BR>\n";
66 }
67 if ($_POST['gateway']) {
68 $error_msg .= "Found an gateway IP: you submitted " . $_POST['gateway'] . "<BR>\n";
69 $cf->set("network_gateway",$_POST['gateway']);
70 #$error_msg .= "ERROR: Could not set the gateway IP<BR>\n";
71 }
72 if ($_POST['http_proxy']) {
73 $error_msg .= "Found an HTTP Proxy IP: you submitted " . $_POST['http_proxy'] . "<BR>\n";
74 $cf->set("http_proxy", $_POST['http_proxy']);
75 #$error_msg .= "ERROR: Could not set the HTTP Proxy IP<BR>\n";
76 }
77 if ($_POST['ftp_proxy']) {
78 $error_msg .= "Found an FTP Proxy IP: you submitted " . $_POST['ftp_proxy'] . "<BR>\n";
79 $cf->set("ftp_proxy", $_POST['ftp_proxy']);
80 #$error_msg .= "ERROR: Could not set the FTP Proxy IP<BR>\n";
81 }
82 if ($_POST['rsync_proxy']) {
83 $error_msg .= "Found an RSYNC Proxy IP: you submitted " . $_POST['rsync_proxy'] . "<BR>\n";
84 $cf->set("rsync_proxy",$_POST['rsync_proxy']);
85 #$error_msg .= "ERROR: Could not set the RSYNC Proxy IP<BR>\n";
86 }
87 $dns_servers = array();
88 if ($_POST['dnsserver']) {
89 $error_msg .= "Found an DNS server: you submitted " . $_POST['dnsserver'] . "<BR>\n";
90 array_push($dns_servers, $_POST['dnsserver']);
91 }
92 if ($_POST['dnsserver2']) {
93 $error_msg .= "Found an alternate DNS server: you submitted " . $_POST['dnsserver2'] . "<BR>\n";
94 array_push($dns_servers, $_POST['dnsserver2']);
95 }
96 if ($dns_servers) {
97 $cf->set("dns_servers", $dns_servers);
98 $error_msg .= "ERROR: Could not set the DNS Server<BR>\n";
99 }
100 if ($_POST['EnableSSH']) {
101 $error_msg .= "Found an Enable SSH Flag: you set it to " . $_POST['EnableSSH'] . "<BR>\n";
102 $cf->set("enable_ssh", $_POST['EnableSSH']);
103 #$error_msg .= "ERROR: Could not set the SSH flag<BR>\n";
104 }
105 if ($_POST['Verbose']) {
106 $error_msg .= "Found an Verbose Mode Flag: you set it to " . $_POST['Verbose'] . "<BR>\n";
107 $cf->set("verbose", $_POST['Verbose']);
108 #$error_msg .= "ERROR: Could not set the Verbose mode flag<BR>\n";
109 }
110 if ($_POST['RootPass1'] and $_POST['RootPass2']) {
111 $error_msg .= "Found a root password1: you submitted " . $_POST['RootPass1'] . "<BR>\n";
112 $error_msg .= "Found a root password2: you submitted " . $_POST['RootPass2'] . "<BR>\n";
113 if ($_POST['RootPass1'] == $_POST['RootPass2']) {
114 $error_msg .= "Trying to set the root password. <br>";
115 $cf->set("root_passwd",hash_password($_POST['RootPass1']));
116 $error_msg .= "ERROR: Could not set the root password<BR>\n";
117 } else {
118 $error_msg .= "ERROR: Passwords DO NOT MATCH!<BR>\n";
119 }
120 }
121 if ($_POST['Modules']) {
122 $error_msg .= "Found an Additional Module: you submitted " . $_POST['Modules'] . "<BR>\n";
123 $cf->set("kernel_modules", $_POST['Modules']);
124 #$error_msg .= "ERROR: Could not set the Kernel Modules<BR>\n";
125 }
126 if ($_POST['SaveCC']) {
127 $error_msg .= "Trying to save the profile. <br>\n";
128 #SAVE VALUES
129 file_put_contents('testcc.xml', $cf->serialize()); #PHP 5 only
130 #$error_msg .= "ERROR: Could not save the profile!<BR>\n";
131 }
132 if ($error_msg == "") {
133 $error_msg = "Values saved successfully";
134 }
135 }
136 $smarty->assign('error_msg',$error_msg);
137 #########################################
138 $smarty->assign('advanced', True);
139
140 $subarches['i386'] = 'x86';
141 $subarches['i486'] = 'x86';
142 $subarches['i586'] = 'x86';
143 $subarches['i686'] = 'x86';
144 $subarches['x86_64'] = 'amd64';
145 $subarches['parisc'] = 'hppa';
146 $smarty->assign('subarches', $subarches);
147
148 #Choose the architecture for the Install.
149 #import platform
150 #arch = platform.machine()
151 #if arch in subarches:
152 # arch = subarches[arch]
153 #Arch selection string here.<br>
154
155 $arches["x86"] = "x86 (Pentium and Athlon Series)";
156 $arches["amd64"] = "AMD Athlon 64 and Opteron";
157 $arches["ppc"] = "PPC (New World) Macs";
158 $arches["sparc"] = "Sparc (don't know how to be more specific yet";
159 $arches["alpha"] = "Alpha";
160 $arches["hppa"] = "HPPA";
161 $smarty->assign('arches', $arches);
162
163 $modules = list_modules();
164 $smarty->assign('modules', $modules);
165
166 $smarty->display('clientconfig.tpl');
167
168 ?>

  ViewVC Help
Powered by ViewVC 1.1.20