1 rizwank 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5 <title>SSP Admin :: Install</title>
6 <link rel="stylesheet" href="styles/main.css" />
7 <script type="text/javascript">
8 function checkPwd(){
9 elem = document.getElementById('theForm');
10 var pwd = elem.pwd.value;
11 var pwd2 = elem.pwd2.value;
12
13 if (pwd == pwd2)
14 {
15 return true;
16 }
17 else
18 {
19 alert('Passwords Do Not Match!');
20 return false;
21 }
22 rizwank 1.1 }
23
24 </script>
25 </head>
26
27 <body>
28
29 <div id="container">
30 <h1>SSP Admin Install</h1>
31
32 <?php
33 if ( !$_POST )
34 {
35 die('<h2>Error</h2><p>Please start the installation from <a href="start.php">start.php</a>...</p>');
36 } else
37 {
38 $server = $_REQUEST['svr'];
39 $db = $_REQUEST['db'];
40 $usr = $_REQUEST['usr'];
41 $pwd = $_REQUEST['pwd'];
42 $fldr = $_REQUEST['fldr'];
43 rizwank 1.1 $pr = $_REQUEST['pr'];
44
45 $filename = 'inc/conf.php';
46
47 $perms = substr(sprintf('%o', fileperms($filename)), -4);
48
49 if ($perms != '0777')
50 @chmod($filename, 0777) or die("<h2>Error</h2><p>SSPAdmin does not have the proper permissions to write to the inc/conf.php file. SSPAdmin tried do set the permissions for you, but was rejected. Please chmod this file to 777 and start the installation over. If you cannot set the permissions to this file, open it in a text editor and fill in the values manually. Then simply run _install.php");
51
52 $fill = "<?php\n\n";
53 $fill .= '$host = \''.$server."';\n";
54 $fill .= '$db = \''.$db."';\n";
55 $fill .= '$user = \''.$usr."';\n";
56 $fill .= '$pass = \''.$pwd."';\n\n";
57 $fill .= '$adminDir = \''.$fldr."';\n";
58 $fill .= '$pre = \''.$pr."';\n\n";
59 $fill .= '?>';
60
61 $handle = fopen($filename, 'w+');
62
63 if (fwrite($handle, $fill) == false)
64 rizwank 1.1 {
65 die('<p>An Error Occured. Your Server May Not Allow Writing Files Via PHP. If not, follow the instructions for creating the configuration file in the help documents.</p>');
66 }
67
68 fclose($handle);
69
70 echo '<p>Your configuration file was successfully created. You are now ready to install SSP Admin. All that is needed is for you to pick a username and password below. This is the username and password you will use to login to SSPAdmin</p>';
71 ?>
72
73 <form id="theForm" action="_install.php" method="post" onsubmit="return checkPwd()">
74 <fieldset>Username: <input type="text" name="usr" /></fieldset>
75 <fieldset>Password: <input type="password" name="pwd" /></fieldset>
76 <fieldset>Password Again: <input type="password" name="pwd2" /></fieldset>
77 <fieldset><input type="submit" value="Install SSP" /></fieldset>
78 </form>
79 <?php } ?>
80
81 </div>
82 </body>
83 </html>
|