Location: PHPKode > projects > DynPG > update/bin/start.php
<?php
    // check correctness of posted data, otherwise redirect
		if ( file_exists('../update.php') ) {
	        header('Location: ../../incomplete.php?update=yes');
	        exit;
	    }

    // init session and deduce correctness of session creation
		ob_start();
		session_start();
		$sessionstart_successfull = trim(ob_get_contents()) == '';
		ob_end_clean();

    // import
		require 'bin.php';
		require dirname(__FILE__) . '/../../functions.php';

    // fix beginning of update
    	$_SESSION['DYNPG_UPDATE'] = time();

    // perform get validation
		foreach ( $_GET as $key => $value ) {
	        $value = addslashes($value);
	    }

    // deduce license and update file
		if ( file_exists('../license-' . toEnglish_countries(dynpg_backend_language()) . '.html') ) {
	        $license = '../license-' . toEnglish_countries(dynpg_backend_language()) . '.html';
	    } else {
	        $license = '../license-german.html';
	    }
	    if ( file_exists('../update-' . toEnglish_countries(dynpg_backend_language()) . '.html') ) {
	        $update_file = '../update-' . toEnglish_countries(dynpg_backend_language()) . '.html';
	    } else {
	        $update_file = '../update.html';
	    }

    // read out current update specification
		if ( file_exists('../../' . strtoupper(toEnglish_countries(dynpg_backend_language())) . '.LICENSE') ) {
	        $fileContent = file('../../' . strtoupper(toEnglish_countries(dynpg_backend_language())) . '.LICENSE');
	        $_dynpg_License['type']    = $fileContent[0];
	        $_dynpg_License['info']    = $fileContent[1];

	        unset($fileContent[0]);
	        unset($fileContent[1]);

	        $_dynpg_License['license'] = nl2br(implode('', $fileContent));
	    }

    // init language processor
    	$langHdl = dynpg_install_InitLanguageProc(dynpg_backend_language());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

		<title>
			<?php print $langHdl->str['lang_update_step1_title'] ?>
		</title>

		<link rel="stylesheet" type="text/css" href="update.css">

		<script src="java.js" type="text/javascript"></script>

		<script language="javascript">
		<!--
			function jsLicenseChecked()
			{
				if ( document.getElementById('dynpg_install_step1_license').value ) {
					return true;
				} else {
					alert('<?php print $langHdl->str['lang_install_step1_license'] ?>');
					return false;
				}
			}

			function jvHideAndShow(array_showHtml4El, array_hideHtml4El) {
			    for (var hideHtml4El in array_hideHtml4El) {
		            if ( document.getElementById(array_hideHtml4El[hideHtml4El]) ) {
		                document.getElementById(array_hideHtml4El[hideHtml4El]).style.display = 'none';
		            }
			    }

			    for (var hideHtml4El in array_showHtml4El) {
		            if ( document.getElementById(array_showHtml4El[hideHtml4El]) ) {
		                if ( document.getElementById(array_showHtml4El[hideHtml4El]).style.display == 'none' ) {
					        document.getElementById(array_showHtml4El[hideHtml4El]).style.display = 'inline';
					    } else {
					        document.getElementById(array_showHtml4El[hideHtml4El]).style.display = 'none';
					    }
		            }
			    }
			}
		//-->
		</script>


	</head>

	<body>

	<a name="__self"></a>
	<table border="0" Cellpadding="0" Cellspacing="0" width="100%">
		<tr>
			<td valign="top" align="left" width="100%">
				<table border="0" Cellpadding="0" Cellspacing="0" width="100%">
				 <tr>
				  <td valign="top" align="left" width="705" style="background-image: url('logo.gif'); background-repeat: no-repeat;">
				  <div id="dynpg_installation_steps">
						<img src="step-on.gif" alt="Step 1 - Active" class="dynpg_installation_steps_img" />
						<img src="step-off.gif" alt="Step 2 - Inactive" class="dynpg_installation_steps_img" />
					</div>
                  </td>
				  <td valign="center" align="right" style="background-image: url('head-bg.gif');"><img src="head-right.gif" alt="Head-Right" /></td>
				 </tr>
				</table>
			</td>
		</tr>
	</table>

	<table border="0" cellspacing="0" align="center" class="dynpg_installation_step">
		<tr>
			<td height="50" style="background-image:url('stephead.gif');"><div id="dynpg_installation_step_headline"><?php print $langHdl->str['lang_update_step1_subtitle'] ?></div></td>
		</tr>
		<tr>
			<td><div id="dynpg_installation_step1_text">

			<form action="run.php" method="post" name="installation_step1" onSubmit="javascript: return jsLicenseChecked();">

			<h4><?php print $langHdl->str['lang_update_step1_description'] ?></h4>

			<?php include $update_file; ?>

			<br />

            <h4><?php print $langHdl->str['lang_install_step1_productInfo'] ?></h4>

			<table cellspacing="0" id="dynpg_installation_step1_infos">
				<tr>
					<td><strong><?php print $langHdl->str['lang_install_step1_type'] ?>:</strong></td>
					<td width="100%"><?php echo $_dynpg_License['type'] ?></td>
				</tr>
				<tr>
					<td><strong><?php print $langHdl->str['lang_install_step1_description'] ?>:</strong></td>
					<td width="100%"><?php echo $_dynpg_License['info'] ?></td>
				</tr>
				<tr>
					<td colspan="2"><strong><?php print $langHdl->str['lang_install_step1_licenseDetail'] ?>:</strong></td>
				</tr>
				<tr>
					<td colspan="2"><iframe id="dynpg_install_step1_license_text" src="<?php echo $license ?>"><?php echo $_dynpg_License['license'] ?></iframe></td>
				</tr>
				<tr>
					<td colspan="2">
						<img src="unchecked.gif" alt="unchecked" id="dynpg_install_step1_license_img" style="vertical-align:middle;" onClick="javascript: jvChangeCheck('dynpg_install_step1_license');" />
						<strong><?php print $langHdl->str['lang_install_step1_licenseAgree'] ?></strong>
					<input type="hidden" value="" id="dynpg_install_step1_license" name="dynpg_install_step1_license" /></td>
				</tr>
			</table>

			<br />

			<h4><?php print $langHdl->str['lang_install_step1_product_requirements'] ?></h4>

			<table cellspacing="2" id="dynpg_installation_step1_req">
				<tr>
					<td nowrap="nowrap"><?php print $langHdl->str['lang_install_step1_pr_php'] ?></td>
					<td nowrap="nowrap"><?php echo phpversion() < '4.0.6' ? '<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_not_complied'] . ' ('. phpversion() .')</div>' : '<div id="dynpg_installation_yes">' . $langHdl->str['lang_install_step1_complied'] . ' ('. phpversion() .')</div>';?></td>
				</tr>
				<tr>
					<td nowrap="nowrap"><?php print $langHdl->str['lang_install_step1_pr_gd'] ?></td>
					<td nowrap="nowrap"><?php echo extension_loaded('gd') ? '<div id="dynpg_installation_yes">' . $langHdl->str['lang_install_step1_available'] . '</div>' : '<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_gd_not_available'] . '' . $langHdl->str['lang_install_step1_gd_not_available'] . '</div>';?></td>
				</tr>
				<tr>
					<td nowrap="nowrap"><?php print $langHdl->str['lang_install_step1_pr_mysql'] ?></td>
					<td nowrap="nowrap"><?php echo function_exists( 'mysql_connect' ) ? '<div id="dynpg_installation_yes">' . $langHdl->str['lang_install_step1_available'] . '</div>' : '<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_not_available'] . '</div>';?></td>
				</tr>
				<tr>
					<td nowrap="nowrap"><?php print $langHdl->str['lang_update_step1_pr_upload_fld'] ?><br /><em>(<?php echo dirname( dirname(__FILE__) ); ?>)</em><sup>1</sup></td>
					<td nowrap="nowrap">
					<?php
	    				if ( @is_dir('../../update/') &&  @is_writable('../../update/') ) {
	    					echo '<div id="dynpg_installation_yes">'. $langHdl->str['lang_install_step1_changable'] .'</div>';
	    				} else {
	    					if (! @is_dir('../../update/') ) {
                                echo '<div id="dynpg_installation_no">'. $langHdl->str['lang_install_step1_unexistant'] .'</div>';
                            } else {
                                echo '<div id="dynpg_installation_no">'. $langHdl->str['lang_install_step1_not_changable'] .'</div>';
                            }
	    				}
					?></td>
				</tr>
				<?php if ( dynpg_install_IsModuleInstalled('forum') ) { ?>
                <tr>
					<td nowrap="nowrap"><?php print $langHdl->str['lang_install_step1_pr_config_forum'] ?><br /><em>(/forum/include/configuration/configurations.mysql.inc.php-dist)</em><sup>1</sup></td>
					<td nowrap="nowrap">
					<?php
	    				if ( @file_exists('../forum/include/configuration/configurations.mysql.inc.php-dist') &&  @is_readable('../forum/include/configuration/configurations.mysql.inc.php-dist') ) {
	    					echo '<div id="dynpg_installation_yes">' . $langHdl->str['lang_install_step1_readable'] . '</div>';
	    				} else {
	    					if (! @file_exists('../forum/include/configuration/configurations.mysql.inc.php-dist') ) {
                                echo '<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_unexistant'] . '</div>';
                            } else {
                                echo '<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_unreadable'] . '</div>';
                            }
	    				}
					?></td>
				</tr>
				<tr>
					<td nowrap="nowrap"><?php print $langHdl->str['lang_install_step1_pr_upload_forum'] ?><br /><em>(/forum/forumupload/)</em><sup>2</sup></td>
					<td nowrap="nowrap">
					<?php
	    				if ( @is_dir('../forum/forumupload/') &&  @is_writable('../forum/forumupload/') ) {
	    					echo '<div id="dynpg_installation_yes">' . $langHdl->str['lang_install_step1_changable'] . '</div>';
	    				} else {
	    					if (! @is_dir('../forum/forumupload/') ) {
                                echo '<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_unexistant'] . '</div>';
                            } else {
                                echo '<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_not_changable'] . '</div>';
                            }
	    				}
					?></td>
				</tr>
				<?php } ?>
				<tr>
					<td nowrap="nowrap"><?php print $langHdl->str['lang_install_step1_pr_sessions'] ?></td>
					<td nowrap="nowrap">
						<?php
							$sess = Array();
							$sess []= @is_writable(ini_get('session.save_path'));
							$sess []= @is_writable(session_save_path());
							$sess []= $sessionstart_successfull;

							echo ( $sess[0] || $sess[1] )? '<div id="dynpg_installation_yes">' . $langHdl->str['lang_install_step1_access'] . '</div>' :
								( $sess[2]?'<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_sessions_hint'] . '</div>':
								'<div id="dynpg_installation_no">' . $langHdl->str['lang_install_step1_no_access'] . '</div>' );
						?></td>
				</tr>
			</table>

			<p style="text-align: justify;"><?php print $langHdl->str['lang_install_step1_statement_1'] ?></p>

			<p><?php print $langHdl->str['lang_install_step1_statement_2'] ?></p>

			<p id="foodnote"><sup>1</sup>) <?php print $langHdl->str['lang_install_step1_statement_3'] ?></p>

			<p id="foodnote"><sup>2</sup>) <?php print $langHdl->str['lang_install_step1_statement_4'] ?></p>

			<p style="margin: 20px;"></p>

			<?php foreach ( $_POST as $key => $value ) { ?>
			<?php if ( !strpos($key, 'password') ) { ?>
			<input type="hidden" name="<?php echo $key ?>" id="<?php echo $key ?>" value="<?php echo stripslashes($value) ?>" />
            <?php } } ?>

			<input type="image" src="button_install.gif" alt="install" align="right" border="0" />

			</form>

			</div></td>
		</tr>
		<tr>
			<td height="30" style="background-color: white; background-image:url('stepfood.gif');"></td>
		</tr>
	</table>

	</body>
</html>
Return current item: DynPG