root/dev/common/admin/admin_troubleshooting.php @ 461

Revision 461, 4.4 KB (checked in by kovell, 11 years ago)

Fixes: eve-dev changed to eve-id, recursive clearup scripts recurse more than one level, defunct admin sync removed.

Line 
1<?php
2require_once('common/admin/admin_menu.php');
3
4$page = new Page('Administration - Troubleshooting');
5$page->setAdmin();
6
7$html .= '<table class=kb-table cellspacing=1>';
8$html .= '<div class="block-header2">Graphics</div>';
9if (function_exists('imagecreatefromstring'))
10{
11        $html .= '<img src="'.IMG_URL .'/panel/working.jpg" border="0">';
12    $html .= '  GD is available.<br/></tr>';
13    if (!function_exists('imagecreatetruecolor'))
14    {
15            $html .=  '<img src="'.IMG_URL .'/panel/error.jpg" border="0">';
16        $html .=  '  Your GD is outdated though and will cause problems, please contact your system administrator to upgrade to GD 2.0 or higher.<br/>';
17    }
18    if (function_exists('imagettftext'))
19    {
20            $html .=  '<img src="'.IMG_URL .'/panel/working.jpg" border="0">';
21        $html .=  '  FreeType support is enabled<br/>';
22    }
23    else
24    {
25            $html .=  '<img src="'.IMG_URL .'/panel/error.jpg" border="0">';
26        $html .=  '  Unfortunatly you do not have FreeType support so you cannot use all available signatures. :(<br/>';
27    }
28}
29else
30{
31        $html .=  '<img src="'.IMG_URL .'/panel/error.jpg" border="0">';
32    $html .=  '  GD is NOT available.<br/>The Killboard is unable to output character portraits or corporation logos, please speak with your system administrator to install GD 2.0 or higher.<br/>';
33    $html .=  '  However, you can continue to use the Killboard but it might not run smoothly.<br/>';
34}
35
36function checkdir($dir)
37{
38    if (is_writeable($dir))
39    {
40            //not working atm, might be fixed later
41        $html .= 'Directory '.$dir.' is there and writeable, excellent.<br/>';
42    }
43    else
44    {
45        $html .=  '<img src="'.IMG_URL .'/panel/error.jpg" border="0">';
46    $html .= '  I cannot write into ../cache.<br/>';
47    $html .= '  Please issue a "chmod 777 ../cache" and "chmod 777 ../cache/*" on the commandline inside of this directory<br/>';
48        global $stoppage;
49        $stoppage = true;
50    }
51}
52
53if (is_writeable('cache'))
54{
55        $html .=  '<img src="'.IMG_URL .'/panel/working.jpg" border="0">';
56    $html .=  '  Cache directory is writeable<br/>';
57    checkdir('cache/corps');
58    checkdir('cache/data');
59    checkdir('cache/map');
60    checkdir('cache/portraits');
61    checkdir('cache/templates_c');
62}
63else
64{
65    $stoppage = true;
66    $html .=  '<img src="'.IMG_URL .'/panel/error.jpg" border="0">';
67    $html .= '  I cannot write into ../cache.<br/>';
68    $html .= '  Please issue a "chmod 777 ../cache" and "chmod 777 ../cache/*" on the commandline inside of this directory<br/>';
69}
70
71
72$html .=  '<br/><div class="block-header2">Connectivity</div>';
73// connectivity
74$url = 'http://www.eve-id.net/logo.png';
75if (ini_get('allow_url_fopen'))
76{
77    if (count(file($url)))
78    {
79            $html .=  '<img src="'.IMG_URL .'/panel/working.jpg" border="0">';
80        $html .=  '  allow_url_fopen is available.<br/>';
81    }
82    else
83    {
84            $html .=  '<img src="'.IMG_URL .'/panel/error.jpg" border="0">';
85        $html .=  '  I could not get the file, this might be a firewall related issue or the eve-dev server is not available.<br/>';
86    }
87}
88
89{
90    include('common/includes/class.http.php');
91
92    $http = new http_request($url);
93    if ($http->get_content())
94    {
95            $html .=  '<img src="'.IMG_URL .'/panel/working.jpg" border="0">';
96        $html .=  '  Socket Connect is available.<br/>';
97    }
98    else
99    {
100            $html .=  '<img src="'.IMG_URL .'/panel/error.jpg" border="0">';
101        $html .=  '  I could not get the file, this might be a firewall related issue or the eve-dev server is not available.<br/>';
102    }
103}
104
105//yes this is a mess, pew pew and programming dont mix =P
106function find_SQL_Version() {
107        $conn = new DBConnection;
108        $value = (float) mysql_get_server_info($conn->id_);
109        return $value;
110// shell_exec is often not supported so ask the connection instead.
111//   $output = shell_exec('mysql -V');
112//   preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
113//   return $version[0];
114}
115
116$sqlver = 'MYSQL version: ' . find_SQL_Version();
117$phpver = 'PHP version: ' . phpversion();
118$html .= '<div class="block-header2">Server</div>';
119$html .= '<img src="'.IMG_URL .'/panel/working.jpg" border="0">';
120$html .= $phpver  <br>";
121$html .= '<img src="'.IMG_URL .'/panel/working.jpg"  border="0">';
122$html .= $sqlver";
123
124
125
126
127
128
129
130
131
132$html .= "</table>";
133
134$page->setContent($html);
135$page->addContext($menubox->generate());
136$page->generate();
137?>
Note: See TracBrowser for help on using the browser.