f00000000000-setup.php
f00000000000-setup.php
php
/*
** Application name: SGD
** Last Edit page: 2004-08-23
** Path by root: ../installation/setup.php
** Authors: Ceam / Fullo
**
** =============================================================================
**
** SGD - Project Managment
**
** -----------------------------------------------------------------------------
** Please refer to license, copyright, and credits in README.TXT
**
** -----------------------------------------------------------------------------
** FILE: setup.php
**
** DESC: Screen: setup file
**
** HISTORY:
** 2004-08-23 - add/complete switch according to php version
** 2004-08-23 - update register_globals cheat code to be compatible with php5
** 19/05/2005 - fixed and & in link
** -----------------------------------------------------------------------------
** TO-DO:
**
** =============================================================================
*/
error_reporting(2039);
include("../languages/help_en.php");
$version = "2.5";
$dateheure = date("Y-m-d H:i");
if ($action == "generate")
{
if ($myserver == '')
{
$error = 'Must be insert the database Server';
}
elseif ($mylogin == '')
{
$error = 'Must be insert the database Login';
}
elseif ($mydatabase == '')
{
$error = 'Must be insert the database Name';
}
elseif ($root == '')
{
$error = 'Must be insert the Root path';
}
elseif ($adminPwd == '')
{
$error = 'Must be insert the Admin password';
}
if ($installationType == "offline")
{
$updatechecker = "false";
}
$content = <<<STAMP
<?php
#Application name: SGD
#Status page: 2
#Path by root: ../includes/settings.php
# installation type
\$installationType = "$installationType"; //select "offline" or "online"
# database parameters
define('MYSERVER','$myserver');
define('MYLOGIN','$mylogin');
define('MYPASSWORD','$mypassword');
define('MYDATABASE','$mydatabase');
# notification method
\$notificationMethod = "mail"; //select "mail" or "smtp"
# Invoicing module
\$enableInvoicing = "true";
# theme choice
define('THEME','default');
# newsdesk limiter
\$newsdesklimit = 1;
# session.trans_sid forced
\$trans_sid = "true";
# language choice
\$langDefault = "$langdefault";
# CVS parameters
// Should CVS be enabled?
\$enable_cvs = "false";
// Should browsing CVS be limited to project members?
\$cvs_protected = "false";
# login method, set to "CRYPT" in order CVS authentication to work (if CVS support
is enabled)
\$loginMethod = "$loginMethod"; //select "MD5", "CRYPT", or "PLAIN"
# enable LDAP
\$useLDAP = "false";
\$configLDAP[ldapserver] = "your.ldap.server.address";
\$configLDAP[searchroot] = "ou=People, ou=Intranet, dc=YourCompany, dc=com";
# htaccess parameters
\$htaccessAuth = "false";
\$fullPath = "/usr/local/apache/htdocs/SGD/files"; //no slash at the end
# e-mail notifications
\$notifications = "$notifications";
# table prefix
\$tablePrefix = "$myprefix";
# database tables
\$tableCollab["calendar"] = "{$myprefix}calendar";
\$tableCollab["logs"] = "{$myprefix}logs";
\$tableCollab["members"] = "{$myprefix}members";
\$tableCollab["organizations"] = "{$myprefix}organizations";
\$tableCollab["fases"] = "{$myprefix}fases";
\$tableCollab["fase_pedente"] = "{$myprefix}fase_pendente";
\$tableCollab["projects"] = "{$myprefix}projects";
\$tableCollab["projects_corretiva"] = "{$myprefix}projects_corretiva";
\$tableCollab["teams"] = "{$myprefix}teams";
\$tableCollab["solicita_mudanca"] = "{$myprefix}solicita_mudanca";
\$tableCollab["services"] = "{$myprefix}services";
\$tableCollab["ata_anexo"] = "{$myprefix}ata_anexo";
\$tableCollab["ata_reuniao"] = "{$myprefix}ata_reuniao";
\$tableCollab["sistema"] = "{$myprefix}sistemas";
\$tableCollab["termo_aceite"] = "{$myprefix}termo_aceite";
\$tableCollab["calender_reuniao"] = "{$myprefix}calender_reuniao";
\$tableCollab["control"] = "{$myprefix}s_control_in";
\$tableCollab["s_usuario_grupo"] = "{$myprefix}s_usuario_grupo";
\$tableCollab["s_grupo"] = "{$myprefix}s_grupo";
\$tableCollab["s_funcao_sgd"] = "{$myprefix}s_funcao_sgd";
\$tableCollab["s_sub_funcao_sgd"] = "{$myprefix}s_sub_funcao_sgd";
\$tableCollab["s_recurso_usuario"] = "{$myprefix}s_recurso_usuario";
\$tableCollab["s_recurso_tempo"] = "{$myprefix}s_recurso_tempo";
\$tableCollab["s_recurso_projeto"] = "{$myprefix}s_recurso_projeto";
\$tableCollab["s_recurso_atividade"] = "{$myprefix}s_recurso_atividade";
\$tableCollab["s_recurso_hora"] = "{$myprefix}s_recurso_hora";
\$tableCollab["s_recurso_dispensa"] = "{$myprefix}s_recurso_dispensa";
\$tableCollab["s_recurso_feriado"] = "{$myprefix}s_recurso_feriado";
\$tableCollab["s_recurso_usuario"] = "{$myprefix}s_recurso_usuario";
# SGD version
\$version = "$version";
# Gantt graphs
\$activeJpgraph = "true";
# enable the redirection to the last visited page, EXPERIMENTAL DO NOT USE IT
\$lastvisitedpage = "false";
if (!$error)
{
$fp = @fopen("../includes/settings.php",'wb+');
$fw = fwrite($fp,$content);
if (!$fw)
{
$error = 1;
echo "<br/><b>PANIC! <br/> settings.php can't be
written!</b><br/>";
}
fclose($fp);
$msg = 'File settings.php created correctly.';
if ($databaseType == "mysql")
{
$my = @mysql_connect($myserver, $mylogin, $mypassword);
if ($databaseType == "sqlserver")
{
$my = @mssql_connect($myserver, $mylogin, $mypassword);
OCIExecute($index);
//echo $SQL[$con] . '<br/>';
if (OCIError() != 0){ exit('<br/><b>PANIC! <br/> Error
during the creation of the tables.</b><br/> Error: '. mssql_get_last_message()); }
}
}
$msg .= "<br/>Tabelas e arquivos de configura��es criados com
sucesso.";
//$msg .= "<br/><br/><a href='../general/login.php'>Por favor efetue
login</a>";
$msg .= "<br/><br/><a href='../index.php'>Por favor efetue login</a>";
}
else
{
$msg = $error;
}
}
if ($step == "")
{
$step = "1";
}
$setTitle = "SGD";
define('THEME','default');
$banner_top = "teste_01.jpg";
$blank = "true";
include("../themes/".THEME."/block.class.php");
if ($step == "1")
{
$blockPage->itemBreadcrumbs("Licen�a");
}
elseif ($step > "1")
{
$blockPage->itemBreadcrumbs("<a href='../installation/setup.php?
step=1'>Licen�a</a>");
if ($step == "2")
{
$blockPage->itemBreadcrumbs("Configura��es");
}
elseif ($step > "2")
{
$blockPage->itemBreadcrumbs("<a href='../installation/setup.php?
step=2'>Configura��es</a>");
if ($step == "3")
{
$blockPage->itemBreadcrumbs("Control");
}
}
}
$blockPage->closeBreadcrumbs();
if ($step == "1")
{
$block1->openContent();
$block1->contentTitle(" ");
if ($step == "2")
{
$block1->openContent();
$block1->contentTitle("Details");
$block1->form = "settings";
$block1->openForm("../installation/setup.php?action=generate&step=3");
if ($connexion == "off")
{
echo "<input value='false' name='updatechecker' type='hidden'>";
}
elseif (@join('',file("http://www.SGD.com/website/version.txt")))
{
echo "<input value='true' name='updatechecker' type='hidden'>";
}
else
{
echo "<input value='false' name='updatechecker' type='hidden'>";
}
if ($connexion == "off")
{
$installCheckOffline = "checked";
}
else
{
$installCheckOnline = "checked";
}
if ($databaseType == "mysql" || $databaseType == "")
{
$dbCheckMysql = "checked";
}
elseif ($databaseType == "sqlserver")
{
$dbCheckSqlserver = "checked";
}
elseif ($databaseType == "postgresql")
{
$dbCheckPostgresql = "checked";
}
elseif ($databaseType == "oracle")
{
$dbCheckOracle = "checked";
}
$safemodeTest = ini_get(safe_mode);
if ($safemodeTest == "1")
{
$checked1_a = "checked"; //false
$safemode = "on";
}
else
{
$checked2_a = "checked"; //true
$safemode = "off";
}
$notificationsTest = function_exists('mail');
if ($notificationsTest == "true")
{
$checked2_b = "checked"; //false
$gdlibrary = "on";
}
else
{
$checked1_b = "checked"; //true
$gdlibrary = "off";
}
$url = $SERVER_NAME;
if ($SERVER_PORT != 80 && $SERVER_PORT != 443)
{
$url .= ":". $SERVER_PORT;
}
if ($HTTPS == "on")
{
$protocol = "https://";
}
else
{
$protocol = "http://";
}
$root = $protocol.$url.dirname($PHP_SELF);
$root = str_replace("installation","",$root);
echo "
<tr class='odd'>
<td valign='top' class='leftvalue'>Root :</td>
<td><input size='44' value='$root' style='width: 200px'
name='root' maxlength='100' type='text'></td>
</tr>
<tr class='odd'>
<td valign='top' class='leftvalue'>Metodo de Login :<br/>[<a
href=\"javascript:void(0);\" onmouseover=\"return
overlib('".addslashes($help["setup_loginmethod"])."',SNAPX,550,BGCOLOR,'#5B7F93',FG
COLOR,'#C4D3DB');\" onmouseout=\"return nd();\">Help</a>] </td>
<td><input type='radio' name='loginMethod' value='PLAIN'>
Plain <input type='radio' name='loginMethod' value='MD5'> Md5 <input
type='radio' name='loginMethod' value='CRYPT' checked> Crypt</td>
</tr>
<tr class='odd'>
<td valign='top' class='leftvalue'>Admin password :</td>
<td><input size='44' value='$adminPwd' style='width: 200px'
name='adminPwd' maxlength='100' type='password'></td>
</tr>
<tr class='odd'>
<td valign='top' class='leftvalue'> </td>
<td><input type='SUBMIT' value='Save'></td>
</tr>";
$block1->closeContent();
$block1->closeForm();
}
if ($step == "3")
{
$block1->openContent();
$block1->contentTitle(" ");
$stepNext = $step + 1;
if ($step < "2") { echo "<form name='license' action='../installation/setup.php?
step=2&redirect=true' method='post'><center><a
href=\"javascript:document.license.submit();\"><b>Passo
$stepNext</b></a><br/><br/><input type='checkbox' value='off' name='connexion'>
Estou de acordo.</center></form><br/>"; }
$footerDev = "false";
include('../themes/'.THEME.'/footer.php');
?>