config.ini.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. }
  24. $db_url = "host=" . $_DB['host'] . " port=" . $_DB['port'] . " dbname=" . $_DB['dbname'] . " user=" . $_DB['username'] . " password=" . $_DB['password'];
  25. $db = NewADOConnection($_DB['type']);
  26. $db->Connect($db_url) or die('Connect Database Error');
  27. $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
  28. //打開詳細頁面時指定模式
  29. if (!empty($_REQUEST['_schemas'])) {
  30. $db->Execute("SET search_path TO " . $_REQUEST['_schemas'] . ";");
  31. } elseif (!empty($_REQUEST['__schemas'])) {//部分report
  32. $db->Execute("SET search_path TO " . $_REQUEST['__schemas'] . ";");
  33. } else {
  34. //超级管理员有没有选择数据库模式
  35. if (!empty($_SESSION['_current_schemas'])) {
  36. $db->Execute("SET search_path TO " . $_SESSION['_current_schemas'] . ";");
  37. } else {
  38. if (empty($_SESSION['ONLINE_USER']['main_schemas'])) {
  39. $db->Execute("SET search_path TO public;");
  40. } else {
  41. $db->Execute("SET search_path TO " . $_SESSION['ONLINE_USER']['main_schemas'] . ";");
  42. }
  43. }
  44. }
  45. $_VERSION = 'RAO 1.0.0.8';
  46. $_COPYRIGHT = 'Copyright @ 2009 United Software Applications,Inc.';
  47. ?>