[ PHPXref.com ] [ Generated: Sun Jul 20 18:29:47 2008 ] [ LogiCampus 1.1.5 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/public_html/ -> install.php (source)

   1  <?php
   2      include ('defines.template.php');
   3  ?><html>
   4  <body>
   5  
   6  
   7      <h2 style="margin:1px;">Installation</h2>
   8  <div style="background-color:#9C0000;color:white">
   9  &nbsp;
  10  </div>
  11  
  12  <br/>
  13  
  14  <form method="GET" style="padding:0px;margin:0px;" action="<?php echo $PHP_SELF;?>">
  15  <fieldset style="background-color:#DDE;font-family:Helvetica,Arial;">
  16  <legend style="font-size:120%;">Instructions</legend>
  17      <p>
  18      It seems as though the site has not been installed yet.  To complete the installation 
  19      you need to:
  20          <ol>
  21              <li>Edit the file called <em>'defines.template.php'</em>.</li>
  22              <li>Change the database settings near the bottom
  23              of the file and save it as a file called <em>'defines.php'</em>.</li>
  24              <li>Save or upload this file to the 
  25              same folder that has the <em>'defines.template.php'</em> file.</li>
  26          </ol>
  27      </p>
  28  
  29      <p>
  30      After you setup the configuration file you will need to populate the database.
  31      A bash script called <i>'wipe_clean.sh'</i> is provided in the <i>'logicampus/scripts/'</i> directory.  It will <em><u>erase ALL TABLES</u></em> in the given database and
  32      insert the proper LogiCampus tables.  It is important to use a new database and to 
  33      remove the <i>'logicampus/scripts/'</i> directory after running <i>'wipe_clean.sh'</i>.
  34      </p>
  35  
  36      <p>
  37      <pre>
  38      # cd logicampus/scripts/
  39      # sh ./wipe_clean.sh db_user db_pass db_name
  40      </pre>
  41      </p>
  42  </fieldset>
  43  
  44  <br/>
  45  <a href="<?php echo $PHP_SELF;?>">Click here</a> to reload the page when you're done with the installation.
  46  <br/>
  47  <br/>
  48  <?php
  49  if ($_GET['send'] == 'go') {
  50      $stats = true;
  51      if ( !sendStats('logicampus.com') ) {
  52          $stats = sendStats('216.40.247.38');
  53      }
  54  
  55      if ($stats) {
  56          echo '<h3>Thanks for sending your data.</h3>';
  57      } else {
  58          echo '<h3>There was a problem sending your data.</h3>';
  59      }
  60  }
  61  
  62  ?>
  63  
  64  <fieldset style="background-color:#DDE;font-family:Helvetica,Arial;">
  65  <legend style="font-size:120%;">Statistics</legend>
  66      <p>
  67      You may report this installation by clicking on the submit button below.
  68      No personally identifiable information is required.  The information that will 
  69      be submitted automatically is:
  70  
  71          <ol>
  72              <li>Web Server Name and/or IP Address: <?php echo $_SERVER['HTTP_HOST'].'/'.$_SERVER['SERVER_ADDR'];?></li>
  73              <li>Browser Type: <?php echo $_SERVER['HTTP_USER_AGENT'];?></li>
  74              <li>Campus Version: 1.1.5</li>
  75              <li>PHP Version: <?php echo PHP_VERSION;?></li>
  76              <li>Today's Date: <?php echo  date('m.d.Y');?></li>
  77          </ol>
  78      </p>
  79  
  80      <input type="submit" id="submit_button" value="Don't Send Personal Info."/>
  81      <p>
  82      In addition, you may also add personal information if you wish:
  83      <div style="width:300px;text-align:right">
  84          <ol>
  85              <li style="float:left;"><label for="org_name">
  86                  Organization Name:</label></li>
  87              <input id="org_name" type="text" size="35" value=""/>
  88              <li style="float:left;"><label for="contact_name">
  89                  Contact Name:</label></li>
  90                     <input id="contact_name" type="text" size="35" value=""/>
  91              <li style="float:left;"><label for="contact_email">
  92                  Contact Email:</label></li> 
  93              <input id="contact_name" type="text" size="35" value=""/>
  94              <li style="float:left;"><label for="contact_phone">
  95                  Contact Phone Number:</label></li>
  96              <input type="text" size="35" value=""/>
  97          </ol>
  98      </div>
  99      <input type="hidden" name="send" value="go"/>
 100      <input type="submit"  id="submit_button" value="Send Statistics"/>
 101      </p>
 102  
 103  </fieldset>
 104  </form>
 105  
 106  <br/>
 107  
 108  <div style="margin-top:2em;font-size:75%;">
 109  LogiCampus <?php echo LOGICAMPUS_VERSION.LOGICAMPUS_VERSION_STATUS;?>
 110  <br/>
 111  Build Date: <?php echo LOGICAMPUS_BUILD_DATE;?>
 112  </div>
 113  <pre>
 114  <?php //print_r($_SERVER);?>
 115  </pre>
 116  </body>
 117  </html>
 118  <?php
 119      //define function to send stat info
 120  	function sendStats($host) {
 121          $post = 'http_host='.$_SERVER['HTTP_HOST'];
 122          $post .="\n";
 123          $post .= '&server_addr='.$_SERVER['SERVER_ADDR'];
 124          $post .="\n";
 125          $post .= '&user_agent='.$_SERVER['HTTP_USER_AGENT'];
 126          $post .="\n";
 127          $post .= '&campus_version=1.1.5';
 128          $post .="\n";
 129          $post .= '&php_version='.$PHP_VERSION;
 130          $post .="\n";
 131          $post .= '&install_date='.time();
 132  
 133          //echo $post;
 134  
 135  
 136          $fp = fsockopen ($host, 80);
 137          if ($fp) {
 138  
 139              fputs ($fp, "
 140  POST /web_reg.php HTTP/1.0
 141  Host: logicampus.com
 142  Content-Length: ".strlen($post)."
 143  Content-Type: application/x-www-form-urlencoded
 144  Connection: Close
 145  
 146  ".$post."
 147  
 148  ");
 149  
 150  
 151              while (!feof($fp)) {fgets ($fp,4096); }
 152               fclose ($fp);
 153              return 1;
 154          } else {
 155              return 0;
 156          }
 157      }
 158  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]