]> git.defcon.no Git - hermes/blobdiff - api/lib/alias_functions.php
Changed sql_dbquery to return result on zero rows. Resulted in some patchings. Added...
[hermes] / api / lib / alias_functions.php
index 51c3b58379bc9b6accb0cd44c369f77bd53a2869..aa6682111dd43fe44c955f8e4d62f492fae7ee9e 100644 (file)
@@ -25,7 +25,7 @@ function get_destination ( $alias_username, $alias_domain )
        // At this point, no error checking is performed, instead the empty array is returned.
        if ( ! $result ) return $aliases; 
 
-       while ( $row = mysql_fetch_assoc( $result ) )
+       while ( $row = @mysql_fetch_assoc( $result ) )
        {
                array_push( $aliases, array( 'destination' => $row['destination'], 'alias' => $row['alias'] ) );
        }
@@ -57,7 +57,7 @@ function get_aliases ( $dest_username, $dest_domain )
        // At this point, no error checking is performed, instead the empty array is returned.
        if ( ! $result ) return $aliases; 
 
-       while ( $row = mysql_fetch_assoc( $result ) )
+       while ( $row = @mysql_fetch_assoc( $result ) )
        {
                array_push( $aliases, array( 'destination' => $row['destination'], 'alias' => $row['alias'] ) );
        }
@@ -85,7 +85,7 @@ function alias_exists( $alias_username, $alias_domain )
        $result = sql_dbquery($config['kamailio_db'], $query);
 
        if ( !$result ) return true; // This is an error. Better to fail claiming alias exists...
-       $row = mysql_fetch_row($result);
+       $row = @mysql_fetch_row($result);
        if ( !$row ) return true; // This is an error. Better to fail claiming alias exists...
        $num_r = $row[0];
        if ( $num_r == 1 ) 
@@ -94,7 +94,7 @@ function alias_exists( $alias_username, $alias_domain )
                        $config['kamailio_alias_table'],
                        sql_clean($alias_username), sql_clean($alias_domain));
                $result = sql_dbquery($config['kamailio_db'], $query);
-               $row = mysql_fetch_row($result);
+               $row =  @mysql_fetch_row($result);
                if ( is_string( $row[0] ) ) return $row[0];
                return true; // Failure mode..
        }