PageRenderTime 46ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/01.Source/01.CORE/admincp/modules/siteinfo/system_info.php

http://creative-portal.googlecode.com/
PHP | 175 lines | 150 code | 6 blank | 19 comment | 8 complexity | 86213af8d24969080d3067cf24bd5f54 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /**
  3. * @Project NUKEVIET 3.0
  4. * @Author VINADES.,JSC (contact@vinades.vn)
  5. * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
  6. * @Createdate 2-1-2010 22:5
  7. */
  8. if ( ! defined( 'NV_IS_FILE_SITEINFO' ) ) die( 'Stop!!!' );
  9. $page_title = $lang_module['site_configs_info'];
  10. $info = array();
  11. if ( defined( 'NV_IS_GODADMIN' ) )
  12. {
  13. $global_config['version'] .= "<a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=settings&amp;" . NV_OP_VARIABLE . "=checkupdate\">" . $lang_module['checkversion'] . "</a>";
  14. $global_config['chmod'] = " <a id='checkchmod' href='" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=siteinfo&amp;" . NV_OP_VARIABLE . "=checkchmod'>(" . $lang_module['checkchmod'] . ")</a>&nbsp;&nbsp;<span id='wait'></span>";
  15. }
  16. $info[] = array( //
  17. 'caption' => $lang_module['site_configs_info'], //
  18. 'field' => array( //
  19. array( //
  20. 'key' => $lang_module['site_domain'], //
  21. 'value' => NV_MY_DOMAIN
  22. ), //
  23. //
  24. array( //
  25. 'key' => $lang_module['site_url'], //
  26. 'value' => $global_config['site_url']
  27. ), //
  28. //
  29. array( //
  30. 'key' => $lang_module['site_root'], //
  31. 'value' => NV_ROOTDIR
  32. ), //
  33. //
  34. array( //
  35. 'key' => $lang_module['site_script_path'], //
  36. 'value' => $nv_Request->base_siteurl
  37. ), //
  38. //
  39. array( //
  40. 'key' => $lang_module['site_cookie_domain'], //
  41. 'value' => $global_config['cookie_domain']
  42. ), //
  43. //
  44. array( //
  45. 'key' => $lang_module['site_cookie_path'], //
  46. 'value' => $global_config['cookie_path']
  47. ), //
  48. //
  49. array( //
  50. 'key' => $lang_module['site_session_path'], //
  51. 'value' => $sys_info['sessionpath']
  52. ), //
  53. //
  54. array( //
  55. 'key' => $lang_module['site_timezone'], //
  56. 'value' => NV_SITE_TIMEZONE_NAME . ( NV_SITE_TIMEZONE_GMT_NAME != NV_SITE_TIMEZONE_NAME ? " (" . NV_SITE_TIMEZONE_GMT_NAME . ")" : "" )
  57. )
  58. ) //
  59. ); //
  60. //
  61. $info[] = array( //
  62. 'caption' => $lang_module['server_configs_info'], //
  63. 'field' => array( //
  64. array( //
  65. 'key' => $lang_module['version'], //
  66. 'value' => $global_config['version']
  67. ), //
  68. //
  69. array( //
  70. 'key' => $lang_module['server_phpversion'], //
  71. 'value' => ( PHP_VERSION != '' ? PHP_VERSION : phpversion() )
  72. ), //
  73. //
  74. array( //
  75. 'key' => $lang_module['server_api'], //
  76. 'value' => ( function_exists( 'apache_get_version' ) ? apache_get_version() . ', ' : ( nv_getenv( 'SERVER_SOFTWARE' ) != '' ? nv_getenv( 'SERVER_SOFTWARE' ) . ', ' : '' ) ) . ( PHP_SAPI != '' ? PHP_SAPI : php_sapi_name() )
  77. ), //
  78. //
  79. array( //
  80. 'key' => $lang_module['server_phpos'], //
  81. 'value' => $sys_info['os']
  82. ), //
  83. //
  84. array( //
  85. 'key' => $lang_module['server_mysqlversion'], //
  86. 'value' => $db->sql_version
  87. )
  88. ) //
  89. ); //
  90. //
  91. if ( defined( 'NV_IS_GODADMIN' ) )
  92. {
  93. $info[] = array(
  94. 'caption' => $lang_module['chmod'] . $global_config['chmod'], 'field' => array(
  95. array(
  96. 'key' => NV_DATADIR, 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_DATADIR ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  97. ), array(
  98. 'key' => NV_SESSION_SAVE_PATH, 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_SESSION_SAVE_PATH ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  99. ), array(
  100. 'key' => NV_LOGS_DIR, 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  101. ), array(
  102. 'key' => NV_CACHEDIR, 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_CACHEDIR ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  103. ), array(
  104. 'key' => NV_UPLOADS_DIR, 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_UPLOADS_DIR ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  105. ), array(
  106. 'key' => NV_TEMP_DIR, 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_TEMP_DIR ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  107. ), array(
  108. 'key' => NV_LOGS_DIR . "/data_logs", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/data_logs" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  109. ), array(
  110. 'key' => NV_LOGS_DIR . "/dump_backup", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/error_logs" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  111. ), array(
  112. 'key' => NV_LOGS_DIR . "/error_logs", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/error_logs" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  113. ), array(
  114. 'key' => NV_LOGS_DIR . "/error_logs/errors256", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/error_logs/errors256" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  115. ), array(
  116. 'key' => NV_LOGS_DIR . "/error_logs/old", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/error_logs/old" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  117. ), array(
  118. 'key' => NV_LOGS_DIR . "/error_logs/tmp", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/error_logs/tmp" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  119. ), array(
  120. 'key' => NV_LOGS_DIR . "/ip_logs", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/ip_logs" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  121. ), array(
  122. 'key' => NV_LOGS_DIR . "/ref_logs", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/ref_logs" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  123. ), array(
  124. 'key' => NV_LOGS_DIR . "/voting_logs", 'value' => ( is_writable( NV_ROOTDIR . '/' . NV_LOGS_DIR . "/voting_logs" ) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'] )
  125. )
  126. )
  127. );
  128. }
  129. $xtpl = new XTemplate( "system_info.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file );
  130. foreach ( $info as $if )
  131. {
  132. $xtpl->assign( 'CAPTION', $if['caption'] );
  133. foreach ( $if['field'] as $key => $field )
  134. {
  135. $xtpl->assign( 'CLASS', ( $key % 2 ) ? " class=\"second\"" : "" );
  136. $xtpl->assign( 'KEY', $field['key'] );
  137. $xtpl->assign( 'VALUE', $field['value'] );
  138. $xtpl->parse( 'main.loop' );
  139. }
  140. $xtpl->parse( 'main' );
  141. }
  142. $contents = $xtpl->text( 'main' );
  143. if ( defined( 'NV_IS_GODADMIN' ) )
  144. {
  145. $contents .= '
  146. <script type="text/javascript">
  147. $("#checkchmod").click(function(event){
  148. event.preventDefault();
  149. var url = $(this).attr("href");
  150. $("#checkchmod").hide();
  151. $("#wait").html("<img src=\'../images/load.gif\'/>");
  152. $.ajax({
  153. type: "POST",
  154. url: url,
  155. data: "",
  156. success: function(data){
  157. $("#wait").html("");
  158. alert(data);
  159. $("#checkchmod").show();
  160. }
  161. });
  162. })
  163. </script>
  164. ';
  165. }
  166. include ( NV_ROOTDIR . "/includes/header.php" );
  167. echo nv_admin_theme( $contents );
  168. include ( NV_ROOTDIR . "/includes/footer.php" );
  169. ?>