Location: PHPKode > projects > Ajax File Manager - AjaxExplorer > ajaxexplorer/script/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.
*/

session_start();

if(isset($_POST['exit']))
{
  $row=file('../user/config.php');
  $col=explode("\t", $row[0]);

  if(count($col)==4)
  {
    if(($file=fopen('../user/config.php', 'w+')))
    {
      fwrite($file, $col[0]."\t".$col[1]."\t".$col[2]."\t0\t0\t1000\t".$col[3]);
      fclose($file);
    }
  }

  if(count($col)==6)
  {
    if(($file=fopen('../user/config.php', 'w+')))
    {
      fwrite($file, $col[0]."\t".$col[1]."\t".$col[2]."\t".$col[3]."\t".$col[4]."\t1000\t".$col[5]);
      fclose($file);
    }
  }

  unlink('../install.php');
  unlink('install.php');
  exit;
}

if(isset($_POST['user']))
{
  $name=$_POST['user'];

  mkdir('../user');
  mkdir('../user/'.$name);
  mkdir('../user/'.$name.'/My Profile');
  mkdir('../user/'.$name.'/Recycle Bin');

  if(($file=fopen('../user/config.php', 'w+')))
  {
    fwrite($file, "1\t0\t0\t0\t0\t1000\t".$_POST['root']);
    fclose($file);
  }

  if(($file=fopen('../user/record.php', 'w+')))
  {
    if(fwrite($file, "<?php header('location: ../') ?>\t\t/\t0\r\n".$name."\t".MD5($_POST['pass'])."\t/\t31"))
    {
      unlink('../install.php');
      unlink('install.php');
      $_SESSION['userid']=1;
    }

    fclose($file);
  }
}

?>
Return current item: Ajax File Manager - AjaxExplorer