Location: PHPKode > projects > Ajax File Manager - AjaxExplorer > ajaxexplorer/install.php
<?php

/*
AjaxExplorer Copyright (C) 2007 Syed Mohammad Sidque Tahir Al-Habshi

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Head to
GNU site http://www.gnu.org/licenses/ for license copy.
*/

$link=$list='';
$part=array_reverse(explode('/', 'wwwroot'.$_SERVER['SCRIPT_NAME']));

foreach($part as $id=>$name)
{
  if($id>1)
  {
    $link.=$link? '/..':'../..';
    $list.='<option value="'.$link.'"'.($id==(count($part)-1)? ' selected="selected">':'>').$name.'</option>';
  }
}

?>
<html>
  <head>

    <title>Installer - AjaxExplorer</title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="SMSID Software" />
    <meta name="keywords" content="ajax,explorer,file,manager" />
    <meta name="description" content="Ajax File Manager - AjaxExplorer" />

    <link rel="SHORTCUT ICON" href="images/exe.gif" />
    <link rel="STYLESHEET" href="script/style.css" type="text/css" />

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

      load=2;

      function cancel()
      {
	if(!confirm('Previous installation of AjaxExplorer detected!\n\nWould you want to continue this installation and lost user database,\nor click \'Cancel\' to allow the system to skip this installer?'))
	{
	  ajaxRequest('install', 'exit=1');
	}
      }

      function toggle(id)
      {
	if(id==3 && !confirm('By clicking \'OK\' you have read & understand the license.')) id=2;
	for(i=1; i<4; i++)
	{
	  display('R'+i, i==id? 1:0);
	  display('R2'+i, i==id? 1:0);
	}
      }

      function install(id)
      {
	load=3;

	if(get('R11').value)
	{
	  if(get('R12').value.length>4)
	  {
	    if(get('R12').value==get('R13').value)
	    {
	      ajaxRequest('install', 'user='+get('R11').value+'&pass='+get('R12').value+'&root='+get('R14').value);
	    }
	    else alert('Your password does not match!');
	  }
	  else alert('Your password must be at least 5 characters long!');
	}
	else alert('Please key in your username!');
      }

      <?php echo file_exists('user')? 'setTimeout("cancel()", 0)':'' ?>

    </script>

  </head>

  <body>
    <div class="tabs" style="display: block">
      <div class="tabs-head">AjaxExplorer Installer</div>
      <div class="tabs-menu"><span class="href" onclick="toggle(1)">Requirement</span> &nbsp; <span class="href" onclick="toggle(2)">License</span> &nbsp; <span class="href" onclick="toggle(3)">Install</span></div>

      <div class="tabs-body">
	<div id="R1">
	  <div>In order for the system to work, do ensure below requirements are meet.</div><br />

	  <fieldset><legend>System Requirement</legend>
	    <span class="right"><img alt="" src="images/<?php echo phpversion()>=4? 'yes':'no' ?>.gif" /></span>PHP 4 or latest<br />
	    <span class="right"><img alt="" src="images/<?php echo class_exists('ZipArchive')? 'yes':'no' ?>.gif" /></span>Zip extension (optional)<br />
	    <span class="right"><img alt="" src="images/<?php echo filegroup('.')? 'yes':'no' ?>.gif" /></span>File permission (optional)
	  </fieldset><br />

	  <fieldset><legend>Directory Permission</legend>
	    <span class="right"><img alt="" src="images/<?php echo is_writable('.')? 'yes':'no' ?>.gif" /></span>/ajaxexplorer/<br />
	    <span class="right"><img alt="" src="images/<?php echo is_writable('script')? 'yes':'no' ?>.gif" /></span>/ajaxexplorer/script/
	  </fieldset><br /><br />

	  <div class="center"><a href="http://smsid.hyperphp.com" target="_new"><img alt="" src="images/trademark.gif" /></a></div>
	</div>

	<div id="R2" style="display: none">
	  AjaxExplorer Copyright (C) 2007-2008 Syed Mohd Sidque Tahir Al-Habshi.<br /><br />
	  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.<br /><br />
	  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br /><br />Head to GNU site for <a href="http://www.gnu.org/licenses/" target="_new">license copy</a>.
	</div>

	<div id="R3" style="display: none">
	  <div>Setup your account information below.</div><br />
	  <fieldset><legend>Setup Account</legend>
	    Username:<br /><input id="R11" type="text" class="tran1" value="Admin" /><br />
	    Password:<br /><input id="R12" type="password" class="tran1" /><br />
	    Confirm Password:<br /><input id="R13" type="password" class="tran1" />
	  </fieldset><br />

	  <div>The starting directory which the system will begin loading.</div><br />
	  <fieldset><legend>Starting Directory</legend>
	    <select id="R14" class="tran1"><?php echo $list ?></select><br />
	  </fieldset>
	</div>
      </div>

      <div class="span">
	<span class="right"><input id="R21" type="button" class="button" value="License" onclick="toggle(2)" /><input id="R22" type="button" class="button" style="display: none" value="Install" onclick="toggle(3)" /><input id="R23" type="button" class="button" style="display: none" value="Submit" onclick="install()" /></span><span id="detail"><a href="readme.htm" target="_new"><img alt="" src="images/help.gif" /></a></span>
      </div>
    </div>

    <div id="H1"></div><div id="H2"><img alt="" src="images/server.gif" /></div>
  </body>
</html>
Return current item: Ajax File Manager - AjaxExplorer