root/modules/branches/2.10/irc/functions.inc.php

Revision 13091, 1.0 kB (checked in by p_lindheimer, 1 year ago)

adds FREEPBX_IS_AUTH checking to most module files re #5478

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
3 // Try to determine the distro and kernel of the current machine
4 function irc_getversioninfo() {
5   // Various places that may have the Distro Name..
6   $version = "";
7   $locations = array(
8       'Redhat' => '/etc/redhat-release',
9     'Fedora' => '/etc/fedora-release',
10     'Debian' => '/etc/debian_version',
11     'SuSE' => '/etc/SuSE-release',
12     'Gentoo' => '/etc/gentoo-release'
13   );
14   foreach ($locations as $distro => $loc) {
15     if (is_readable($loc)) {
16         $fh = fopen($loc, "r");
17         if ($version != "") {
18             $version .= " OR ".$distro.' '.fgets($fh, 80);
19         } else {
20             $version = $distro.' '.fgets($fh, 80);
21         }
22     }
23   }
24   if ($version == "") {
25     return "Unknown Version";
26   } else {
27     $lastchar = substr("$version", strlen("$version") - 1, 1);
28                if ($lastchar == "\n")
29                {
30                        $version = substr("$version", 0, -1);
31                }
32       return $version;
33   }
34 }
35 ?>
36
Note: See TracBrowser for help on using the browser.