From d49cfa2a851337f0216903e07c36c00da8a10bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rytis=20Slatkevi=C4=8Dius?= Date: Wed, 15 Aug 2007 14:09:10 +0000 Subject: [PATCH] -user web: when merging hosts, remove CPU capabilities before any other action. svn path=/trunk/boinc/; revision=13322 --- html/inc/host.inc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/html/inc/host.inc b/html/inc/host.inc index c6ae677742..ce89dca737 100644 --- a/html/inc/host.inc +++ b/html/inc/host.inc @@ -1,4 +1,5 @@ p_vendor $host1->p_model"; - $p2 = "$host2->p_vendor $host2->p_model"; + + // Get rid of cpu capabilities before check + $pos = strpos($host1->p_model, '['); + $host1pm = $host1->p_model; + if($pos) { + $host1pm = trim(substr($host1->p_model, 0, $pos)); + } + $pos = strpos($host2->p_model, '['); + $host2pm = $host2->p_model; + if($pos) { + $host2pm = trim(substr($host2->p_model, 0, $pos)); + } + $p1 = "$host1->p_vendor $host1pm"; + $p1 = "$host2->p_vendor $host2pm"; + if (strstr($p1, "Pentium") && strstr($p1, "Intel") && strstr($p2, "Pentium") && strstr($p2, "Intel") ) { @@ -281,17 +294,6 @@ function cpus_compatible($host1, $host2) { // they're compatible if models are the same, // or contents of [family/model/stepping] are the same - // - $pos = strpos($host1->p_model, '['); - $host1pm = $host1->p_model; - if($pos) { - $host1pm = trim(substr($host1->p_model, 0, $pos)); - } - $pos = strpos($host2->p_model, '['); - $host2pm = $host2->p_model; - if($pos) { - $host2pm = trim(substr($host2->p_model, 0, $pos)); - } if ($host1pm != $host2pm) return false; } return true;