%attr(0640,root,root) %{_datadir}/%{name}/sql/Makefile
%attr(0644,root,root) %{_datadir}/%{name}/sql/datatest.def
%attr(0644,root,root) %{_datadir}/%{name}/sql/*.sql
+%exclude %{wwwdir}/%{name}/unipos.php
+%exclude %{wwwdir}/%{name}/unimar.php
%exclude %{_datadir}/%{name}/sql/%{name}.mysql
%exclude %{_datadir}/%{name}/sql/%{name}.postg
#-----------------------------------------------------------------------------
%files postgresql
%defattr(-,root,root,-)
%attr(0755,%{name},mail) %{_libexecdir}/%{name}/bin-posql/*
+%attr(0750,%{name},apache) %{wwwdir}/%{name}/unipos.php
#-----------------------------------------------------------------------------
%post postgresql
%files mysql
%defattr(-,root,root,-)
%attr(0755,%{name},mail) %{_libexecdir}/%{name}/bin-mysql/*
+%attr(0750,%{name},apache) %{wwwdir}/%{name}/unimar.php
#-----------------------------------------------------------------------------
--- /dev/null
+<?php
+//==============================================================
+//
+// To dispatch all data base access according database type
+//
+//==============================================================
+
+function sql_connect()
+
+{
+switch($dbtype) {
+ case 'MYSQL' :
+ include_once "unimar.php";
+ echo ("unimar.php included");
+ break;
+ case 'POSTGRESQL' :
+ include_once "unipos.php";
+ echo ("unipos.php included");
+ break;
+ default :
+ throw new ErrorException("Database type $dbtype is unexpected!");
+ break;
+ }
+}
+
+?>
function body($action,$logname,$pass)
{
-include "unienv.php";
-include "scrfun.php";
+include_once "unienv.php";
+include_once "scrfun.php";
+include_once "devsql.php";
loadenv();
$footer=footer("mailleur");
$dbtype=getenv("DB_TYPE");
$dbport=getenv("DB_PORT");
+
$STR = <<<EOT
<!DOCTYPE html>
<HTML>
Password=$pass
<BR>
DBTYPE=$dbtype; DBPORT=$dbport
+sql_connect();
</FONT></STRONG></CENTER>
</FONT></STRONG></CENTER>
$footer
switch ($phase) {
case 0 : //checking if file exist
if(!is_file($env_file_path)){
- throw new ErrorException("Environment File is Missing.");
+ throw new ErrorException("File <".$env_file_path."> is Missing!");
$phase=999; //no need to go further
}
break;
case 1 : //opening file
$fopen=fopen($env_file_path,'r');
if (!$fopen) {
- throw new ErrorException("Unable to read file <".($env_file_path).">");
+ throw new ErrorException("Unable to read file <".($env_file_path).">!");
$phase=999;
}
break;
--- /dev/null
+<?php
+//==============================================================
+//
+// To manage all access to MariaDB database
+//
+//==============================================================
+
+
+?>
--- /dev/null
+<?php
+//==============================================================
+//
+// To manage all access to Postgresql database
+//
+//==============================================================
+
+
+?>