Хранилища Subversion ant

Сравнить редакции

Не учитывать пробелы Редакция 61 → Редакция 62

/trunk/lib/core.php
33,38 → 33,42
return $result;
}
function getDistribution($message) {
$answer = "unknown";
if (preg_match("/debian/i",$message)) {
$answer = "debian";
}
if (preg_match("/ubuntu/i",$message)) {
$answer = "ubuntu";
}
if (preg_match("/infralinux/i",$message)) {
$answer = "infra";
}
return $answer;
}
function getLinuxOS($message) {
function getInfo($message,$dblink){
$answer = array();
 
if (preg_match("/linux/i",$message)) {
return true;
$dist_id = 0;
$dist_info = "";
$qd =& $dblink->query("SELECT * FROM distribution");
while ($qd->fetchInto($res, DB_FETCHMODE_ASSOC)) {
$vers_id = 0;
$vers_info = "";
if (preg_match("/".stripslashes($res["distua"])."/i",$message)) {
$dist_id = $res["dist_id"];
$dist_info = stripslashes($res["distname"]);
$qv =& $dblink->query("SELECT * FROM version WHERE dist_id='$dist_id'");
while($qv->fetchInto($rev, DB_FETCHMODE_ASSOC)) {
$vers_id = $rev["version_id"];
$vers_info = stripslashes($rev["version"])." ".stripslashes($rev["vname"]);
}
}
}
$answer[] = "Linux";
$answer[] = "Судя по всему у Вас операционная система ";
if ($dist_id!=0) {
$answer[] = $dist_id;
$answer[] = $dist_info;
}
if ($vers_id!=0) {
$answer[] = $vers_id;
$answer[] = $vers_info;
}
 
} else {
return false;
$answer[] = "unknown";
$answer[] = "Ресурс рассчитан явно не на Вашу операционную систему!";
}
}
function getDistVersion($message,$distro){
$answer = "unknown";
if ($distro == "debian") {
if (preg_match("/sarge/i",$message)) $answer = "sarge";
if (preg_match("/etch/i",$message)) $answer = "etch";
if (preg_match("/lenny/i",$message)) $answer = "lenny";
}
if ($distro == "ubuntu" || $distro == "infra") {
if (preg_match("/hardy/i",$message)) $answer = "hardy";
if (preg_match("/intrepid/i",$message)) $answer = "intrepid";
}
 
return $answer;
}
}
/trunk/telepathy.php
Новый файл
0,0 → 1,57
<?php
 
/**
* Project: Ant: sources.list generator
* File: modern.php
*
* This application is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
include "lib/init.php";
 
$query =& $db->query("SELECT * FROM settings WHERE opt LIKE 'version'");
$query->fetchInto($antv, DB_FETCHMODE_ASSOC);
$antversion = $antv["optvalue"];
 
$info = array();
 
$info = $core->getInfo($_SERVER["HTTP_USER_AGENT"],$db);
 
$telepathy = $info[1];
 
if ($info[0]!="unknown") {
$cnt = count($info);
switch ($cnt) {
case '2':
$telepathy .= "GNU/Linux, но явно не та, которую мы поддерживаем или дистрибутив и его версия тчательно замаскированы.";
break;
case '4':
$telepathy .= $info[3].", а что за версия не могу разобрать.";
break;
case '6':
$telepathy .= $info[3]." ".$info[5];
break;
}
};
 
$smarty->assign('modern',$telepathy);
$smarty->assign('antversion',$antversion);
$smarty->assign('interface'," &bull; <a href='./classic.php'>Классический интерфейс</a>");
 
$smarty->display('modern.tpl');
 
?>