Code

Don't save anything to database if hardware is 'automatic'.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Dec 2006 10:15:25 +0000 (10:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Dec 2006 10:15:25 +0000 (10:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5455 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/class_phoneAccount.inc

index dd4bc090e3a0b9ca2bd67cc5d49dfbc615aed219..757412c937e4d951b32b5159de98578dc42132e1 100644 (file)
@@ -104,13 +104,11 @@ class phoneAccount extends plugin
         print_red( sprintf(_("The MySQL Server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
             $cur_cfg['SERVER'],$cur_cfg['LOGIN']));
         gosa_log(mysql_error());
-        return false;
       }
       $db  =  @mysql_select_db($cur_cfg['DB'],$r_con);
       if(!$db){
         print_red(sprintf(_("Can't select database %s on %s."),$cur_cfg['DB'],$cur_cfg['SERVER']));
         gosa_log(mysql_error());
-        return false;
       }
 
       $first = false; 
@@ -751,10 +749,12 @@ class phoneAccount extends plugin
       }
 
       // Perform queries ...
-      foreach($SQL_query_array as $query){
-        if(!@mysql_query($query,$new_connection)){
-          print_red(_("Error while performing query:")." ".mysql_error());
-          return false;
+      if($this->goFonHardware != "automatic"){
+        foreach($SQL_query_array as $query){
+          if(!@mysql_query($query,$new_connection)){
+            print_red(_("Error while performing query:")." ".mysql_error());
+            return false;
+          }
         }
       }
     }