roundcubemail/program/lib/Roundcube/rcube_user.php
function delete_identity($iid)
    {
        if (!$this->ID)
            return false;

        $sql_result = $this->db->query(
            "SELECT count(*) AS ident_count FROM ".$this->db->table_name('identities', true).
            " WHERE `user_id` = ? AND `del` <> 1",
            $this->ID);

        $sql_arr = $this->db->fetch_assoc($sql_result);

        // we'll not delete last identity
        if ($sql_arr['ident_count'] <= 1)
            return -1;

        $this->db->query(
            "UPDATE ".$this->db->table_name('identities', true).
            " SET `del` = 1, `changed` = ".$this->db->now().
            " WHERE `user_id` = ?".
                " AND `identity_id` = ?",
            $this->ID,
            $iid);

        // clear the cache
        $this->identities = array();
        $this->emails     = null;

        return $this->db->affected_rows();
    }
function delete_identity($iid)
    {
        if (!$this->ID)
            return false;

        $sql_result = $this->db->query(
            "SELECT count(*) AS ident_count FROM ".$this->db->table_name('identities', true).
            " WHERE `user_id` = ? AND `del` <> 1",
            $this->ID);

        $sql_arr = $this->db->fetch_assoc($sql_result);

        // we'll not delete last identity
        if ($sql_arr['ident_count'] <= 1)
            return -1;

        $this->db->query(
            "UPDATE ".$this->db->table_name('identities', true).
            " SET `del` = 1, `changed` = ".$this->db->now().
            " WHERE `user_id` = ?".
                " AND `identity_id` = ?",
            $this->ID,
            $iid);

        // clear the cache
        $this->identities = array();
        $this->emails     = null;

        return $this->db->affected_rows();
    }
function delete_identity ( $ iid ) { if ( ! $ this -> ID ) return false ; $ sql_result = $ this -> db -> query ( "SELECT count(*) AS ident_count FROM " . $ this -> db -> table_name ( 'identities' , true ) . " WHERE `user_id` = ? AND `del` <> 1" , $ this -> ID ) ; $ sql_arr = $ this -> db -> fetch_assoc ( $ sql_result ) ; // we'll not delete last identity if ( $ sql_arr [ 'ident_count' ] <= 1 ) return - 1 ; $ this -> db -> query ( "UPDATE " . $ this -> db -> table_name ( 'identities' , true ) . " SET `del` = 1, `changed` = " . $ this -> db -> now ( ) . " WHERE `user_id` = ?" . " AND `identity_id` = ?" , $ this -> ID , $ iid ) ; // clear the cache $ this -> identities = array ( ) ; $ this -> emails = null ; return $ this -> db -> affected_rows ( ) ; }
Mark the given identity as deleted

@param  int     $iid Identity ID
@return boolean True if deleted successfully, false if nothing changed
Mark the given identity as deleted