fix some failures to enforce required fields, and some code refactoring
[openemr.git] / gacl / admin / about.php
blob5eb76c22121397ce53a20e42889f8817f62060f6
1 <?php
2 //First make sure user has access
3 include_once("../../interface/globals.php");
4 include_once("$srcdir/acl.inc");
5 //ensure user has proper access
6 if (!acl_check('admin', 'acl')) {
7 echo xl('ACL Administration Not Authorized');
8 exit;
10 //ensure php is installed
11 if (!isset($phpgacl_location)) {
12 echo xl('php-GACL access controls are turned off');
13 exit;
16 require_once("gacl_admin.inc.php");
18 function get_system_info() {
19 global $gacl_api;
21 //Grab system info
22 $system_info .= 'PHP Version: '.phpversion()."\n";
23 $system_info .= 'Zend Version: '.zend_version()."\n";
24 $system_info .= 'Web Server: '.$_SERVER['SERVER_SOFTWARE']."\n\n";
25 $system_info .= 'phpGACL Settings: '."\n";
26 $system_info .= ' phpGACL Version: '.$gacl_api->get_version()."\n";
27 $system_info .= ' phpGACL Schema Version: '.$gacl_api->get_schema_version()."\n";
29 if($gacl_api->_caching == TRUE) {
30 $caching = 'True';
31 } else {
32 $caching = 'False';
34 $system_info .= ' Caching Enabled: '. $caching ."\n";
36 if($gacl_api->_force_cache_expire == TRUE) {
37 $force_cache_expire = 'True';
38 } else {
39 $force_cache_expire = 'False';
41 $system_info .= ' Force Cache Expire: '.$force_cache_expire."\n";
43 $system_info .= ' Database Prefix: \''.$gacl_api->_db_table_prefix."'\n";
44 $system_info .= ' Database Type: '.$gacl_api->_db_type."\n";
46 $database_server_info = $gacl_api->db->ServerInfo();
47 $system_info .= ' Database Version: '.$database_server_info['version']."\n";
48 $system_info .= ' Database Description: '.$database_server_info['description']."\n\n";
50 $system_info .= 'Server Name: '. $_SERVER["SERVER_NAME"] ."\n";
51 $system_info .= ' OS: '. PHP_OS ."\n";
52 $system_info .= ' IP Address: '. $_SERVER["REMOTE_ADDR"] ."\n";
53 $system_info .= ' Browser: '. $_SERVER["HTTP_USER_AGENT"] ."\n\n";
55 $system_info .= 'System Information: '. php_uname() ."\n";
57 return trim($system_info);
60 function submit_system_info($system_information, $system_info_md5) {
62 $md5sum = md5(trim($system_information));
63 if (trim($system_info_md5) == $md5sum) {
64 $tainted = 'FALSE';
65 } else {
66 $tainted = 'TRUE';
69 mail('phpgacl@snappymail.ca', 'phpGACL Report... ', "". $system_information ."\n\nTainted: $tainted");
71 return $tainted;
74 switch ($_POST['action']) {
75 case 'Submit':
76 $gacl_api->debug_text("Submit!!");
78 submit_system_info($_POST['system_information'], $_POST['system_info_md5']);
80 echo "<div align=center>Thanks for contributing to phpGACL. <br> Click <a href=\"acl_list.php\">here</a> to proceed to the Administration Interface.</div><br>\n";
81 exit;
82 break;
83 default:
84 $system_info = get_system_info();
86 //Read credits.
87 $smarty->assign("credits", htmlentities( implode('',file('../CREDITS')) ));
89 $smarty->assign("system_info", $system_info);
90 $smarty->assign("system_info_md5", md5($system_info) );
91 break;
94 $smarty->assign("first_run", $_GET['first_run'] );
95 $smarty->assign("return_page", $_SERVER['PHP_SELF'] );
97 $smarty->assign('current','about');
98 if ($_GET['first_run']) {
99 $smarty->assign('page_title', 'Installation Report');
100 $smarty->assign('hidemenu', 1);
101 } else {
102 $smarty->assign('page_title', 'About phpGACL');
105 $smarty->assign("phpgacl_version", $gacl_api->get_version() );
106 $smarty->assign("phpgacl_schema_version", $gacl_api->get_schema_version() );
108 $smarty->display('phpgacl/about.tpl');