Редакция 59 | Редакция 63 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 59 | Редакция 62 | ||
---|---|---|---|
Строка 31... | Строка 31... | ||
31 | $result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
31 | $result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
32 | }
|
32 | }
|
33 | return $result; |
33 | return $result; |
34 | }
|
34 | }
|
35 | 35 | ||
36 | function getDistribution($message) { |
36 | function getInfo($message,$dblink){ |
37 | $answer = "unknown"; |
- | |
38 | if (preg_match("/debian/i",$message)) { |
- | |
39 | $answer = "debian"; |
- | |
40 | }
|
- | |
41 | if (preg_match("/ubuntu/i",$message)) { |
- | |
42 | $answer = "ubuntu"; |
- | |
43 | }
|
- | |
44 | if (preg_match("/infralinux/i",$message)) { |
- | |
45 | $answer = "infra"; |
37 | $answer = array(); |
46 | }
|
- | |
47 | return $answer; |
- | |
48 | }
|
- | |
49 | 38 | ||
50 | function getLinuxOS($message) { |
- | |
51 | if (preg_match("/linux/i",$message)) { |
39 | if (preg_match("/linux/i",$message)) { |
52 | return true; |
40 | $dist_id = 0; |
- | 41 | $dist_info = ""; |
|
- | 42 | $qd =& $dblink->query("SELECT * FROM distribution"); |
|
- | 43 | while ($qd->fetchInto($res, DB_FETCHMODE_ASSOC)) { |
|
- | 44 | $vers_id = 0; |
|
- | 45 | $vers_info = ""; |
|
- | 46 | if (preg_match("/".stripslashes($res["distua"])."/i",$message)) { |
|
- | 47 | $dist_id = $res["dist_id"]; |
|
- | 48 | $dist_info = stripslashes($res["distname"]); |
|
- | 49 | $qv =& $dblink->query("SELECT * FROM version WHERE dist_id='$dist_id'"); |
|
- | 50 | while($qv->fetchInto($rev, DB_FETCHMODE_ASSOC)) { |
|
- | 51 | $vers_id = $rev["version_id"]; |
|
- | 52 | $vers_info = stripslashes($rev["version"])." ".stripslashes($rev["vname"]); |
|
- | 53 | }
|
|
- | 54 | }
|
|
- | 55 | }
|
|
- | 56 | $answer[] = "Linux"; |
|
- | 57 | $answer[] = "Судя по всему у Вас операционная система "; |
|
- | 58 | if ($dist_id!=0) { |
|
- | 59 | $answer[] = $dist_id; |
|
- | 60 | $answer[] = $dist_info; |
|
- | 61 | }
|
|
- | 62 | if ($vers_id!=0) { |
|
- | 63 | $answer[] = $vers_id; |
|
- | 64 | $answer[] = $vers_info; |
|
- | 65 | }
|
|
- | 66 | ||
53 | } else { |
67 | } else { |
54 | return false; |
- | |
55 | }
|
- | |
56 | }
|
- | |
57 | function getDistVersion($message,$distro){ |
- | |
58 | $answer = "unknown"; |
68 | $answer[] = "unknown"; |
59 | if ($distro == "debian") { |
- | |
60 | if (preg_match("/sarge/i",$message)) $answer = "sarge"; |
- | |
61 | if (preg_match("/etch/i",$message)) $answer = "etch"; |
- | |
62 | if (preg_match("/lenny/i",$message)) $answer = "lenny"; |
- | |
63 | }
|
- | |
64 | if ($distro == "ubuntu" || $distro == "infra") { |
- | |
65 | if (preg_match("/hardy/i",$message)) $answer = "hardy"; |
- | |
66 | if (preg_match("/intrepid/i",$message)) $answer = "intrepid"; |
69 | $answer[] = "Ресурс рассчитан явно не на Вашу операционную систему!"; |
67 | }
|
70 | }
|
- | 71 | ||
68 | return $answer; |
72 | return $answer; |
69 | }
|
73 | }
|
70 | }
|
74 | }
|
71 | 75 | ||
72 | ?>
|
76 | ?>
|