2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 if (!defined('TR_INCLUDE_PATH')) { exit; }
15 require('../svn.php');
17 $svn_data = explode("\n", $svn_data);
19 if (substr($svn_data[1], 0, 1) == 'r') {
20 $svn_data = $svn_data[1];
21 } else if (substr($svn_data[2], 0, 1) == 'r') {
22 $svn_data = $svn_data[2];
25 if (count($svn_data) > 1) {
27 $build_date = date('Y-m-d H:i:s');
29 $svn_data = explode(' ', $svn_data);
31 $build = $svn_data[0];
32 $build_date = $svn_data[4] .' '. $svn_data[5];
39 $os = php_uname('s') . ' '. php_uname('r'). ' '. php_uname('v'). ' '. php_uname('m');
42 if (isset($_POST['submit'])) {
43 unset($_POST['submit']);
46 if ($_POST['log_yes']) {
48 $request = '&upgrade=' . urlencode($stripslashes($_POST['log_upgrade']));
49 $request .= '&version=' . urlencode($stripslashes($new_version));
50 $request .= '&build=' . urlencode($stripslashes($build));
51 $request .= '&build_date=' . urlencode($stripslashes($build_date));
52 $request .= '&os=' . urlencode($stripslashes($_POST['log_os']));
53 $request .= '&server=' . urlencode($stripslashes($_POST['log_server']));
54 $request .= '&php=' . urlencode($stripslashes($_POST['log_php']));
55 $request .= '&mysql=' . urlencode($stripslashes($_POST['log_mysql']));
57 if ($_POST['step1']['old_path'] != '') {
58 // get some usage data from this upgrade:
59 $db = @mysql_connect($_POST['step1']['db_host'] . ':' . $_POST['step1']['db_port'], $_POST['step1']['db_login'], urldecode($_POST['step1']['db_password']));
60 @mysql_select_db($_POST['step1']['db_name'], $db);
62 $db_size = 0; // db size in bytes
63 $sql = 'SHOW TABLE STATUS';
64 $result = mysql_query($sql, $db);
65 while ($row = mysql_fetch_assoc($result)) {
66 $db_size += $row['Data_length']+$row['Index_length'];
69 $request .= '&db=' . $db_size; // db size in bytes
72 if ($_POST['log_url_yes']) {
73 $request .= '&url=' . urlencode($stripslashes($_POST['log_url']));
76 // $header = "POST /install_log.php HTTP/1.1\r\n";
77 // $header .= "Host: transformable.ca\r\n";
78 // $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
79 // $header .= "Content-Length: " . strlen($request) . "\r\n\r\n";
80 // $fp = fsockopen('www.transformable.ca', 80, $errno, $errstr, 30);
83 // fputs($fp, $header . $request . "\r\n\r\n");
93 print_progress($step);
96 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
97 <input type="hidden" name="step" value="<?php echo $step; ?>" />
99 if ($_POST['step1']['old_path'] != '') {
100 echo '<input type="hidden" name="log_upgrade" value="1" />';
102 echo '<input type="hidden" name="log_upgrade" value="0" />';
107 <table width="80%" class="tableborder" cellspacing="0" cellpadding="1" align="center">
109 <td class="row1" colspan="2">Submit the following information to the atutor.ca server anonymously? The information we gather helps us plan our development resources to better suit the needs of the community. You may optionally choose to send the URL of your AContent installation.</td>
112 <td class="row1" width="20%"><b>AContent Version:</b></td>
113 <td class="row1"><?php echo $new_version; ?> (build <?php echo $build . ' - '.$build_date; ?>)</td>
116 <td class="row1" nowrap="nowrap"><b>Operating System:</b></td>
117 <td class="row1"><?php echo $os; ?> <input type="hidden" name="log_os" value="<?php echo $os; ?>" /></td>
120 <td class="row1"><b>Web Server:</b></td>
121 <td class="row1"><?php echo $_SERVER['SERVER_SOFTWARE']; ?> <input type="hidden" name="log_server" value="<?php echo $_SERVER['SERVER_SOFTWARE']; ?>" /></td>
124 <td class="row1"><b>PHP Version:</b></td>
125 <td class="row1"><?php echo phpversion(); ?> <input type="hidden" name="log_php" value="<?php echo phpversion(); ?>" /></td>
128 <td class="row1"><b>MySQL Version:</b></td>
129 <td class="row1"><?php
131 if ($_POST['step1']['old_path'] != '') {
132 $db = @mysql_connect($_POST['step1']['db_host'] . ':' . $_POST['step1']['db_port'], $_POST['step1']['db_login'], urldecode($_POST['step1']['db_password']));
134 $db = @mysql_connect($_POST['step2']['db_host'] . ':' . $_POST['step2']['db_port'], $_POST['step2']['db_login'], $_POST['step2']['db_password']);
137 $sql = 'SELECT VERSION() AS version';
138 $result = @mysql_query($sql, $db);
139 $row = @mysql_fetch_assoc($result);
140 echo $row['version'];
141 ?> <input type="hidden" name="log_mysql" value="<?php echo $row['version']; ?>" /></td>
144 <td class="row1" valign="top"><div class="optional" title="Optional Field">?</div><b>Optional URL:</b></td>
145 <td class="row1"><?php
146 $url = 'http' . ((isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on') ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . substr($_SERVER['PHP_SELF'], 0, -strlen('install/install.php'));
147 echo $url; ?><input type="hidden" name="log_url" value="<?php echo $url; ?>" /><br />
148 <input type="checkbox" name="log_url_yes" value="1" id="url_yes" checked="checked"/><label for="url_yes">Include this URL as well.</label></td>
151 <input type="hidden" name="log_yes" value="1" />
153 <p align="center"><input type="submit" class="button" value=" Next » " name="submit" /></p>