config.ini.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. if (!defined('IN_ONLINE')) {
  3. exit('Access Denied');
  4. }
  5. if ($_SESSION['USAI_USER']['is_demo'] == "t") {
  6. $_DB['host'] = '127.0.0.1';
  7. $_DB['username'] = 'root';
  8. $_DB['password'] = '123456';
  9. $_DB['dbname'] = 'usai_website';
  10. $_DB['port'] = '5433';
  11. $_DB['type'] = 'postgres';
  12. } else {
  13. $_DB['host'] = '192.168.0.177';
  14. $_DB['username'] = 'root';
  15. $_DB['password'] = '123456';
  16. if (!empty($_GET['_schemas'])) {
  17. $_DB['dbname'] = 'redant_online_new2';
  18. } else {
  19. $_DB['dbname'] = 'redant_online_new2';
  20. }
  21. $_DB['port'] = '5433';
  22. $_DB['type'] = 'postgres';
  23. // $_DB['host'] = '172.31.2.157';
  24. // $_DB['username'] = 'ksroot';
  25. // $_DB['password'] = 'czZ7!HGSGMRPwWbypC9w';
  26. // if (!empty($_GET['_schemas'])) {
  27. // $_DB['dbname'] = 'online';
  28. // } else {
  29. // $_DB['dbname'] = 'online';
  30. // }
  31. // $_DB['port'] = '5432';
  32. // $_DB['type'] = 'postgres';
  33. }
  34. $db_url = "host=" . $_DB['host'] . " port=" . $_DB['port'] . " dbname=" . $_DB['dbname'] . " user=" . $_DB['username'] . " password=" . $_DB['password'];
  35. $db = NewADOConnection($_DB['type']);
  36. $db->Connect($db_url) or die('Connect Database Error');
  37. $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
  38. //打開詳細頁面時指定模式
  39. if (!empty($_REQUEST['_schemas'])) {
  40. $db->Execute("SET search_path TO " . $_REQUEST['_schemas'] . ";");
  41. } elseif (!empty($_REQUEST['__schemas'])) {//部分report
  42. $db->Execute("SET search_path TO " . $_REQUEST['__schemas'] . ";");
  43. } else {
  44. //超级管理员有没有选择数据库模式
  45. if (!empty($_SESSION['_current_schemas'])) {
  46. $db->Execute("SET search_path TO " . $_SESSION['_current_schemas'] . ";");
  47. } else {
  48. if (empty($_SESSION['ONLINE_USER']['main_schemas'])) {
  49. $db->Execute("SET search_path TO public;");
  50. } else {
  51. $db->Execute("SET search_path TO " . $_SESSION['ONLINE_USER']['main_schemas'] . ";");
  52. }
  53. }
  54. }
  55. $_VERSION = 'RAO 1.0.0.8';
  56. $_COPYRIGHT = 'Copyright @ 2009 United Software Applications,Inc.';
  57. ?>